Class PredicateUtils
java.lang.Object
com.thanlinardos.spring_enterprise_library.objects.utils.PredicateUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,R> Predicate <T> contains(Collection<R> collection, Function<T, R> extractor) Applies the result of the extractor toCollection.contains(Object), returns it as a predicate itself.
Important the collection can throw exceptions if as an example it does not allow nulls, it is up to the Collection implementation
Is often a shorthand tofilterBy(Predicate, Function)when the predicate is a someCollection::contains method.static <T extends DateTemporal>
Predicate<T> containsDate(LocalDate date) Returns a predicate that checks theDateTemporal.containsDate(LocalDate)(LocalDate)} on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> containsDate(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.containsDate(LocalDate)on a temporal it takes theLocalDateas an input.static <T extends DateTemporal>
Predicate<T> Returns a predicate that checks theDateTemporal.endsAfter(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> Returns a predicate that checks theDateTemporal.endsAfter(LocalDate)on a temporal it takes theLocalDateas an input.static <T extends DateTemporal>
Predicate<T> endsAfterOrOn(LocalDate date) Returns a predicate that checks theDateTemporal.endsAfterOrOn(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> endsAfterOrOn(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.endsAfterOrOn(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R, I> Predicate <T> filterBy(BiPredicate<R, I> pred, Function<T, R> extractor, I argument) Applies the result of the extractor on the predicate together with the argument.static <T,R> Predicate <T> Applies the result of the extractor on the predicate, returns it as a predicate itself.static <T extends DateTemporal>
Predicate<T> isContainedIn(LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.isContainedIn(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.static <T,R extends DateTemporal>
Predicate<T> isContainedIn(Function<T, R> extractor, LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.isContainedIn(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.static <T,R> Predicate <T> isContainedIn(Function<T, R> extractor, Collection<R> objects) Applies the result of the extractor toCollectionUtils.isIn(Object, Collection), returns it as a predicate itself.static <T,R> Predicate <T> isContainedIn(Function<T, R> extractor, R... objects) Applies the result of the extractor toCollectionUtils.isIn(Object, Object[]), returns it as a predicate itself.static <T extends BasicIdJpa>
Predicate<T> isEqualByIdTo(T compareTo) Returns a predicate that checks if entity is equal to the compare to entity by id.static <T,R> Predicate <T> Applies the result of the extractor toObjects.equals(Object, Object), returns it as a predicate itself.static <T,R> Predicate <T> isEqualToByKey(T compareTo, Function<T, R> extractor) Returns a predicate that tests ifcompareTois not null, and the result ofextractoris equal to result ofextractoron the comparing object.static <T> Predicate<T> Returns a predicate that checks if the input extractor's return value is equal toBoolean.FALSE.static <T extends DateTemporal>
Predicate<T> Returns a predicate that checks theDateTemporal.isInRange(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.static <T,R extends DateTemporal>
Predicate<T> Returns a predicate that checks theDateTemporal.isInRange(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.static <T,R> Predicate <T> isNotContainedIn(Function<T, R> extractor, Collection<R> objects) Applies the result of the extractor toCollectionUtils.isNotIn(Object, Collection), returns it as a predicate itself.static <T,R> Predicate <T> isNotContainedIn(Function<T, R> extractor, R... objects) Applies the result of the extractor toCollectionUtils.isNotIn(Object, Object[]), returns it as a predicate itself.static <T extends BasicIdJpa>
Predicate<T> isNotEqualByIdTo(T compareTo) Returns a predicate that checks if the entity is not equal to the compare to entity by id.static <T,R> Predicate <T> isNotEqualTo(R compareTo, Function<T, R> extractor) Applies the result of the extractor toObjects.equals(Object, Object), returns it as a predicate itself.static <T,R> Predicate <T> Returns a predicate that checks if the result of the extractor is null.static <T> Predicate<T> Returns a predicate that checks if the input extractor's return value is equal toBoolean.TRUE.static <T> Predicate<T> Negates the input predicate.static <T,R> Predicate <T> Returns a predicate that checks if the result of the extractor is not null.static <T,R> Predicate <T> notContains(Collection<R> collection, Function<T, R> extractor) Applies the result of the extractor toCollection.contains(Object)and inverts the result, returns it as a predicate itself.
Important the collection can throw exceptions if as an example it does not allow nulls, it is up to the Collection implementation
Is often a shorthand tofilterBy(Predicate, Function)when the predicate is a negation of someCollection::contains method.static <T extends DateTemporal>
Predicate<T> overlap(DateTemporal other) Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.static <T,R extends DateTemporal>
Predicate<T> overlap(Function<T, R> extractor, DateTemporal other) Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.static <T extends DateTemporal>
Predicate<T> overlapsInterval(DateTemporal other) Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.static <T extends DateTemporal>
Predicate<T> overlapsInterval(LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.static <T,R extends DateTemporal>
Predicate<T> overlapsInterval(Function<T, R> extractor, DateTemporal other) Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.static <T,R extends DateTemporal>
Predicate<T> overlapsInterval(Function<T, R> extractor, LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.static <T extends DateTemporal>
Predicate<T> overlapsMonth(YearMonth yearMonth) Returns a predicate that checks theDateTemporal.overlapsMonth(YearMonth)on a temporal it takes theYearMonthas an input.static <T,R extends DateTemporal>
Predicate<T> overlapsMonth(Function<T, R> extractor, YearMonth yearMonth) Returns a predicate that checks theDateTemporal.overlapsMonth(YearMonth)on a temporal it takes theYearMonthas an input.static <T extends DateTemporal>
Predicate<T> overlapsYear(LocalDate year) Returns a predicate that checks theDateTemporal.overlapsYear(LocalDate)on a temporal it takes theLocalDateas an input.static <T extends DateTemporal>
Predicate<T> overlapsYear(Year year) Returns a predicate that checks theDateTemporal.overlapsYear(Year)on a temporal it takes theYearas an input.static <T,R extends DateTemporal>
Predicate<T> overlapsYear(Function<T, R> extractor, LocalDate year) Returns a predicate that checks theDateTemporal.overlapsYear(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> overlapsYear(Function<T, R> extractor, Year year) Returns a predicate that checks theDateTemporal.overlapsYear(Year)on a temporal it takes theYearas an input.static <T extends DateTemporal>
Predicate<T> startsAfter(LocalDate date) Returns a predicate that checks theDateTemporal.startsAfter(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> startsAfter(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.startsAfter(LocalDate)on a temporal it takes theLocalDateas an input.static <T extends DateTemporal>
Predicate<T> startsBefore(LocalDate date) Returns a predicate that checks theDateTemporal.startsBefore(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> startsBefore(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.startsBefore(LocalDate)on a temporal it takes theLocalDateas an input.static <T extends DateTemporal>
Predicate<T> startsBeforeOrOn(LocalDate date) Returns a predicate that checks theDateTemporal.startsBeforeOrOn(LocalDate)on a temporal it takes theLocalDateas an input.static <T,R extends DateTemporal>
Predicate<T> startsBeforeOrOn(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.startsBeforeOrOn(LocalDate)on a temporal it takes theLocalDateas an input.static <T> Predicate<T> throwIfNot(Predicate<T> predicate, ErrorCode errorCode, String message, String... strings) Returns a predicate that always evaluate to true unless the input predicate is not satisfied.
-
Constructor Details
-
PredicateUtils
public PredicateUtils()
-
-
Method Details
-
filterBy
Applies the result of the extractor on the predicate, returns it as a predicate itself.- Type Parameters:
T- the type of the input object to the returned predicateR- the type of the result of the extractor- Parameters:
pred- the predicate to test the extracted value against.extractor- the extractor to get the value to test the predicate on.- Returns:
- a
Predicatethat tests the extracted value against the input predicate.
-
filterBy
public static <T,R, Predicate<T> filterByI> (BiPredicate<R, I> pred, Function<T, R> extractor, I argument) Applies the result of the extractor on the predicate together with the argument.- Type Parameters:
T- the type of the input object to the returned predicateR- the type of the result of the extractorI- the type of the input argument to the predicate that on R- Parameters:
pred- the predicate to test the extracted value against.extractor- the extractor to get the value to test the predicate on.argument- the argument to use for the input to the predicate- Returns:
- a
Predicatethat tests the extracted value against the input predicate.
-
isEqualTo
Applies the result of the extractor toObjects.equals(Object, Object), returns it as a predicate itself. Is often a shorthand tofilterBy(Predicate, Function)when the predicate is a someObject::equals method.- Type Parameters:
T- the type of the input object to the returned predicateR- the type of the result of the extractor- Parameters:
compareTo- the object to test the extracted value against.extractor- the extractor to get the value to test the predicate on.- Returns:
- a
Predicatethat tests the extracted value is equal to the compareTo value.
-
isNotEqualTo
Applies the result of the extractor toObjects.equals(Object, Object), returns it as a predicate itself. Is often a shorthand tofilterBy(Predicate, Function)when the predicate is negate(someObject::equals) method.- Type Parameters:
T- the type of the input object to the returned predicateR- the type of the result of the extractor- Parameters:
compareTo- the object to test the extracted value against.extractor- the extractor to get the value to test the predicate on.- Returns:
- a
Predicatethat tests the extracted value is not equal to the compareTo value.
-
isContainedIn
Applies the result of the extractor toCollectionUtils.isIn(Object, Object[]), returns it as a predicate itself.- Type Parameters:
T- the type of the object from which the property to test is extracted.R- the type of the objects in the array.- Parameters:
extractor- the extractor to get the value to test the predicate on.objects- the objects that the extracted value should be equal to one of- Returns:
- a
Predicatethat tests the extracted value is one of the supplied.
-
isContainedIn
Applies the result of the extractor toCollectionUtils.isIn(Object, Collection), returns it as a predicate itself.- Type Parameters:
T- the type of the object from which the property to test is extracted.R- the type of the objects in the collection.- Parameters:
extractor- the extractor to get the value to test the predicate on.objects- theCollectionof objects that the extracted value should not be equal to one of.- Returns:
- a
Predicatethat tests the extracted value is not one of the supplied.
-
isNotContainedIn
@SafeVarargs public static <T,R> Predicate<T> isNotContainedIn(Function<T, R> extractor, R... objects) Applies the result of the extractor toCollectionUtils.isNotIn(Object, Object[]), returns it as a predicate itself.- Type Parameters:
T- the type of the object from which the property to test is extracted.R- the type of the objects in the array.- Parameters:
extractor- the extractor to get the value to test the predicate on.objects- the objects that the extracted value should not be equal to one of- Returns:
- a
Predicatethat tests the extracted value is not one of the supplied.
-
isNotContainedIn
Applies the result of the extractor toCollectionUtils.isNotIn(Object, Collection), returns it as a predicate itself.- Type Parameters:
T- the type of the object from which the property to test is extracted.R- the type of the objects in the collection.- Parameters:
extractor- the extractor to get the value to test the predicate on.objects- theCollectionof objects that the extracted value should not be equal to one of- Returns:
- a
Predicatethat tests the extracted value is not one of the supplied.
-
contains
Applies the result of the extractor toCollection.contains(Object), returns it as a predicate itself.
Important the collection can throw exceptions if as an example it does not allow nulls, it is up to the Collection implementation
Is often a shorthand tofilterBy(Predicate, Function)when the predicate is a someCollection::contains method.- Type Parameters:
T- the type of the input object to the returned predicateR- the type of the result of the extractor- Parameters:
collection- the collection to test if it contains the extracted value.extractor- the extractor to get the value to test the predicate on.- Returns:
- a
Predicatethat tests the extracted value is contained in the collection.
-
notContains
Applies the result of the extractor toCollection.contains(Object)and inverts the result, returns it as a predicate itself.
Important the collection can throw exceptions if as an example it does not allow nulls, it is up to the Collection implementation
Is often a shorthand tofilterBy(Predicate, Function)when the predicate is a negation of someCollection::contains method.- Type Parameters:
T- the type of the input object to the returned predicateR- the type of the result of the extractor- Parameters:
collection- the collection to test if it does not contain the extracted value.extractor- the extractor to get the value to test the predicate on.- Returns:
- a
Predicatethat tests the extracted value is not contained in the collection.
-
negate
-
nonNull
Returns a predicate that checks if the result of the extractor is not null.- Type Parameters:
T- the type of the input object to the returned predicate.R- the type of the result of the extractor.- Parameters:
extractor- the extractor to get the value by.- Returns:
- a
Predicatethat tests the extracted value is not null
-
isNull
Returns a predicate that checks if the result of the extractor is null.- Type Parameters:
T- the type of the input object to the returned predicate.R- the type of the result of the extractor.- Parameters:
extractor- the extractor to get the value by.- Returns:
- a
Predicatethat tests the extracted value is null
-
throwIfNot
public static <T> Predicate<T> throwIfNot(Predicate<T> predicate, ErrorCode errorCode, String message, String... strings) Returns a predicate that always evaluate to true unless the input predicate is not satisfied. If the predicate is not satisfied, aCoreExceptionis thrown with the supplied error code, message and message arguments. This is meant to be used in an optional or stream chain to throw exceptions if some critical assumption does not hold.- Type Parameters:
T- the type of the input to the predicate.- Parameters:
predicate- the predicate that should always evaluate to true.errorCode- the error code.message- the error messagestrings- the error message arguments.- Returns:
- a predicate that throws an exception if the supplied predicate evaluates to false, otherwise the returned predicate evaluates to true.
-
isEqualByIdTo
Returns a predicate that checks if entity is equal to the compare to entity by id. If the object we are comparing to does not have an id then it can never be equal by id.- Type Parameters:
T- the type of the entity that extendsBasicIdJpa.- Parameters:
compareTo- the object to test the id against.- Returns:
- a predicate that represents if the entity is equal to the entity by id or false.
-
isNotEqualByIdTo
Returns a predicate that checks if the entity is not equal to the compare to entity by id.- Type Parameters:
T- the type of the entity that extendsBasicIdJpa.- Parameters:
compareTo- the object to test the id against.- Returns:
- a predicate that represents if the entity is not equal to the entity by id
-
isEqualToByKey
Returns a predicate that tests ifcompareTois not null, and the result ofextractoris equal to result ofextractoron the comparing object.- Type Parameters:
T- the type of the object to testR- the type of the extracted key to compare by- Parameters:
compareTo- the object to compare againstextractor- the function to apply to the compareTo and the comparing object- Returns:
- a predicate that tests true if
compareTois nonnull, and the result ofextractorapplied to bothcompareToand the predicate object are equal (usingObjects.equals(java.lang.Object, java.lang.Object)).
-
isInRange
Returns a predicate that checks theDateTemporal.isInRange(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.- Type Parameters:
T- the type of the temporal- Parameters:
from- theLocalDatefromto- from theLocalDatefrom- Returns:
- a predicate that checks the
DateTemporal.isInRange(LocalDate, LocalDate)on a temporal
-
isInRange
public static <T,R extends DateTemporal> Predicate<T> isInRange(Function<T, R> extractor, LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.isInRange(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectfrom- theLocalDatefromto- from theLocalDatefrom- Returns:
- a predicate that checks the
DateTemporal.isInRange(LocalDate, LocalDate)on a temporal
-
containsDate
Returns a predicate that checks theDateTemporal.containsDate(LocalDate)(LocalDate)} on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal- Parameters:
date- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.containsDate(LocalDate)on a temporal
-
containsDate
public static <T,R extends DateTemporal> Predicate<T> containsDate(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.containsDate(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectdate- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.containsDate(LocalDate)on a temporal
-
overlapsInterval
Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.- Type Parameters:
T- the type of the temporal- Parameters:
other- theDateTemporal- Returns:
- a predicate that checks the
DateTemporal.overlapsInterval(DateTemporal)on a temporal
-
overlapsInterval
public static <T,R extends DateTemporal> Predicate<T> overlapsInterval(Function<T, R> extractor, DateTemporal other) Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectother- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.containsDate(LocalDate)on a temporal
-
overlapsInterval
Returns a predicate that checks theDateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.- Type Parameters:
T- the type of the temporal- Parameters:
from- theLocalDatefromto- from theLocalDatefrom- Returns:
- a predicate that checks the
DateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal
-
overlapsInterval
public static <T,R extends DateTemporal> Predicate<T> overlapsInterval(Function<T, R> extractor, LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectfrom- theLocalDatefromto- from theLocalDatefrom- Returns:
- a predicate that checks the
DateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal
-
isContainedIn
Returns a predicate that checks theDateTemporal.isContainedIn(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.- Type Parameters:
T- the type of the temporal- Parameters:
from- theLocalDatefromto- from theLocalDatefrom- Returns:
- a predicate that checks the
DateTemporal.isContainedIn(LocalDate, LocalDate)on a temporal
-
isContainedIn
public static <T,R extends DateTemporal> Predicate<T> isContainedIn(Function<T, R> extractor, LocalDate from, LocalDate to) Returns a predicate that checks theDateTemporal.isContainedIn(LocalDate, LocalDate)on a temporal it takes theLocalDates as an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectfrom- theLocalDatefromto- from theLocalDatefrom- Returns:
- a predicate that checks the
DateTemporal.overlapsInterval(LocalDate, LocalDate)on a temporal
-
overlapsMonth
Returns a predicate that checks theDateTemporal.overlapsMonth(YearMonth)on a temporal it takes theYearMonthas an input.- Type Parameters:
T- the type of the temporal- Parameters:
yearMonth- theYearMonth- Returns:
- a predicate that checks the
DateTemporal.overlapsMonth(YearMonth)on a temporal
-
overlapsMonth
public static <T,R extends DateTemporal> Predicate<T> overlapsMonth(Function<T, R> extractor, YearMonth yearMonth) Returns a predicate that checks theDateTemporal.overlapsMonth(YearMonth)on a temporal it takes theYearMonthas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectyearMonth- theYearMonth- Returns:
- a predicate that checks the
DateTemporal.overlapsMonth(YearMonth)on a temporal
-
overlapsYear
Returns a predicate that checks theDateTemporal.overlapsYear(Year)on a temporal it takes theYearas an input.- Type Parameters:
T- the type of the temporal- Parameters:
year- theYear- Returns:
- a predicate that checks the
DateTemporal.overlapsYear(Year)} on a temporal
-
overlapsYear
public static <T,R extends DateTemporal> Predicate<T> overlapsYear(Function<T, R> extractor, Year year) Returns a predicate that checks theDateTemporal.overlapsYear(Year)on a temporal it takes theYearas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectyear- theYear- Returns:
- a predicate that checks the
DateTemporal.overlapsYear(Year)on a temporal
-
overlapsYear
Returns a predicate that checks theDateTemporal.overlapsYear(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal- Parameters:
year- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.overlapsYear(LocalDate)on a temporal
-
overlapsYear
public static <T,R extends DateTemporal> Predicate<T> overlapsYear(Function<T, R> extractor, LocalDate year) Returns a predicate that checks theDateTemporal.overlapsYear(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectyear- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.overlapsYear(LocalDate)on a temporal
-
startsAfter
Returns a predicate that checks theDateTemporal.startsAfter(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal.- Parameters:
date- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.startsAfter(LocalDate)on a temporal
-
startsAfter
public static <T,R extends DateTemporal> Predicate<T> startsAfter(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.startsAfter(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectdate- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.startsAfter(LocalDate)on a temporal
-
startsBefore
Returns a predicate that checks theDateTemporal.startsBefore(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal.- Parameters:
date- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.startsBefore(LocalDate)on a temporal
-
startsBefore
public static <T,R extends DateTemporal> Predicate<T> startsBefore(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.startsBefore(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectdate- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.startsBefore(LocalDate)on a temporal
-
startsBeforeOrOn
Returns a predicate that checks theDateTemporal.startsBeforeOrOn(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal.- Parameters:
date- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.startsBeforeOrOn(LocalDate)on a temporal
-
startsBeforeOrOn
public static <T,R extends DateTemporal> Predicate<T> startsBeforeOrOn(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.startsBeforeOrOn(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectdate- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.startsBeforeOrOn(LocalDate)on a temporal
-
endsAfter
Returns a predicate that checks theDateTemporal.endsAfter(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal.- Parameters:
date- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.endsAfter(LocalDate)on a temporal
-
endsAfter
public static <T,R extends DateTemporal> Predicate<T> endsAfter(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.endsAfter(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectdate- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.endsAfter(LocalDate)on a temporal
-
endsAfterOrOn
Returns a predicate that checks theDateTemporal.endsAfterOrOn(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the temporal.- Parameters:
date- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.endsAfterOrOn(LocalDate)on a temporal
-
endsAfterOrOn
public static <T,R extends DateTemporal> Predicate<T> endsAfterOrOn(Function<T, R> extractor, LocalDate date) Returns a predicate that checks theDateTemporal.endsAfterOrOn(LocalDate)on a temporal it takes theLocalDateas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectdate- theLocalDate- Returns:
- a predicate that checks the
DateTemporal.endsAfterOrOn(LocalDate)on a temporal
-
overlap
Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.- Type Parameters:
T- the type of the temporal- Parameters:
other- theDateTemporal- Returns:
- a predicate that checks the
DateTemporal.overlapsInterval(DateTemporal)on a temporal
-
overlap
public static <T,R extends DateTemporal> Predicate<T> overlap(Function<T, R> extractor, DateTemporal other) Returns a predicate that checks theDateTemporal.overlapsInterval(DateTemporal)on a temporal it takes theDateTemporalas an input.- Type Parameters:
T- the type of the object from which the temporal is extractedR- the type of the temporal- Parameters:
extractor- the extractor to get the temporal from an objectother- theDateTemporal- Returns:
- a predicate that checks the
DateTemporal.overlapsInterval(DateTemporal)on a temporal
-
isTrue
Returns a predicate that checks if the input extractor's return value is equal toBoolean.TRUE.- Type Parameters:
T- the type of the object from which the boolean is extracted- Parameters:
extractor- the extractor to get the boolean from an object- Returns:
- the predicate that checks if the input extractor's return value
is equal to
Boolean.TRUE.
-
isFalse
Returns a predicate that checks if the input extractor's return value is equal toBoolean.FALSE.- Type Parameters:
T- the type of the object from which the boolean is extracted- Parameters:
extractor- the extractor to get the boolean from an object- Returns:
- the predicate that checks if the input extractor's return value
is equal to
Boolean.FALSE.
-