-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1450395
commit 7a59882
Showing
8 changed files
with
760 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/io/github/avegera/predicate4j/api/WhereList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.github.avegera.predicate4j.api; | ||
|
||
import java.util.List; | ||
|
||
public interface WhereList<T, R> extends WhereObject<T, List<R>> { | ||
|
||
RichPredicate<T> isEmpty(); | ||
|
||
RichPredicate<T> notEmpty(); | ||
|
||
RichPredicate<T> hasSize(int size); | ||
|
||
RichPredicate<T> notHaveSize(int size); | ||
|
||
RichPredicate<T> contains(R element); | ||
|
||
RichPredicate<T> notContain(R element); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/java/io/github/avegera/predicate4j/api/WhereType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package io.github.avegera.predicate4j.api; | ||
|
||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
public interface WhereType { | ||
|
||
<T> WhereBoolean<T> booleanValue(Function<T, Boolean> mapper); | ||
|
||
<T, R> WhereList<T, R> list(Function<T, List<R>> mapper); | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/io/github/avegera/predicate4j/impl/WhereListImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package io.github.avegera.predicate4j.impl; | ||
|
||
import io.github.avegera.predicate4j.Predicates; | ||
import io.github.avegera.predicate4j.api.RichPredicate; | ||
import io.github.avegera.predicate4j.api.WhereList; | ||
|
||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
public class WhereListImpl<T, R> extends WhereObjectImpl<T, List<R>> implements WhereList<T, R> { | ||
|
||
public WhereListImpl(Function<T, List<R>> mapper) { | ||
super(mapper); | ||
} | ||
|
||
@Override | ||
public RichPredicate<T> isEmpty() { | ||
return getPredicate(Predicates.isEmpty()); | ||
} | ||
|
||
@Override | ||
public RichPredicate<T> notEmpty() { | ||
return getPredicate(Predicates.notEmpty()); | ||
} | ||
|
||
@Override | ||
public RichPredicate<T> hasSize(int size) { | ||
return getPredicate(Predicates.hasSize(size)); | ||
} | ||
|
||
@Override | ||
public RichPredicate<T> notHaveSize(int size) { | ||
return getPredicate(Predicates.notHaveSize(size)); | ||
} | ||
|
||
@Override | ||
public RichPredicate<T> contains(R element) { | ||
return getPredicate(Predicates.contains(element)); | ||
} | ||
|
||
@Override | ||
public RichPredicate<T> notContain(R element) { | ||
return getPredicate(Predicates.notContain(element)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.