File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed
specification/src/main/java/com/iluwatar Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .iluwatar ;
2+
3+ import java .util .function .Predicate ;
4+
5+ public class ColorSelector implements Predicate <Creature > {
6+
7+ private final Color c ;
8+
9+ public ColorSelector (Color c ) {
10+ this .c = c ;
11+ }
12+
13+ @ Override
14+ public boolean test (Creature t ) {
15+ return t .getColor ().equals (c );
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ package com .iluwatar ;
2+
3+ import java .util .function .Predicate ;
4+
5+ public class MovementSelector implements Predicate <Creature > {
6+
7+ private final Movement m ;
8+
9+ public MovementSelector (Movement m ) {
10+ this .m = m ;
11+ }
12+
13+ @ Override
14+ public boolean test (Creature t ) {
15+ return t .getMovement ().equals (m );
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ package com .iluwatar ;
2+
3+ import java .util .function .Predicate ;
4+
5+ public class SizeSelector implements Predicate <Creature > {
6+
7+ private final Size s ;
8+
9+ public SizeSelector (Size s ) {
10+ this .s = s ;
11+ }
12+
13+ @ Override
14+ public boolean test (Creature t ) {
15+ return t .getSize ().equals (s );
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments