Interface FieldLocationPredicate
- All Superinterfaces:
Predicate<FieldLocation>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface for predicates that test
FieldLocation instances.
Provides factory methods for common field location matching scenarios such as:
- Matching fields by position (odd/even row or column index)
- Matching fields by name or index
- Matching fields by value or type
- See Also:
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic FieldLocationPredicateall()Returns a predicate that matches all field locations.static FieldLocationPredicateReturns a predicate that matches field locations with even field indexes (columns).static FieldLocationPredicateReturns a predicate that matches field locations with even row indexes.static FieldLocationPredicatefieldEquals(Object value) Returns a predicate that matches field locations where the field value equals the given value.static FieldLocationPredicatefieldEquals(String fieldName, Object value) Returns a predicate that matches field locations where the specified field in the record equals the given value.static FieldLocationPredicatefieldIndexes(int... fieldIndexes) Returns a predicate that matches field locations where the field index is one of the specified indexes.static FieldLocationPredicatefieldNames(String... fieldNames) Returns a predicate that matches field locations where the field name is one of the specified names.static FieldLocationPredicatefieldTypeEquals(FieldType fieldType) Returns a predicate that matches field locations where the field type equals the specified field type.static FieldLocationPredicateReturns a predicate that matches field locations where the field value is a negative number.static FieldLocationPredicatenullToAll(FieldLocationPredicate predicate) Returns the given predicate if not null, otherwise returns a predicate that matches all locations.static FieldLocationPredicateReturns a predicate that matches field locations with odd field indexes (columns).static FieldLocationPredicateReturns a predicate that matches field locations with odd row indexes.
-
Method Details
-
nullToAll
Returns the given predicate if not null, otherwise returns a predicate that matches all locations.- Parameters:
predicate- the predicate to check, may be null- Returns:
- the predicate if not null, otherwise
all()
-
all
Returns a predicate that matches all field locations.- Returns:
- a predicate that always returns true
-
oddRowIndex
Returns a predicate that matches field locations with odd row indexes. Row indexes are one-based for this check (i.e., row 1, 3, 5, etc.).- Returns:
- a predicate that matches odd row indexes
-
evenRowIndex
Returns a predicate that matches field locations with even row indexes. Row indexes are one-based for this check (i.e., row 0, 2, 4, 6, etc.).- Returns:
- a predicate that matches even row indexes
-
oddFieldIndex
Returns a predicate that matches field locations with odd field indexes (columns). Field indexes are one-based for this check (i.e., column 1, 3, 5, etc.).- Returns:
- a predicate that matches odd field indexes
-
evenFieldIndex
Returns a predicate that matches field locations with even field indexes (columns). Field indexes are one-based for this check (i.e., column 0, 2, 4, 6, etc.).- Returns:
- a predicate that matches even field indexes
-
fieldNames
Returns a predicate that matches field locations where the field name is one of the specified names.- Parameters:
fieldNames- the field names to match- Returns:
- a predicate that matches the specified field names
-
fieldIndexes
Returns a predicate that matches field locations where the field index is one of the specified indexes.- Parameters:
fieldIndexes- the field indexes to match- Returns:
- a predicate that matches the specified field indexes
-
negativeNumber
Returns a predicate that matches field locations where the field value is a negative number. Supports INT, LONG, BYTE, SHORT, DOUBLE, FLOAT, BIG_DECIMAL, and BIG_INTEGER field types.- Returns:
- a predicate that matches negative numeric field values
-
fieldEquals
Returns a predicate that matches field locations where the specified field in the record equals the given value.- Parameters:
fieldName- the name of the field to checkvalue- the value to match- Returns:
- a predicate that matches when the specified field equals the value
-
fieldEquals
Returns a predicate that matches field locations where the field value equals the given value.- Parameters:
value- the value to match- Returns:
- a predicate that matches when the field value equals the given value
-
fieldTypeEquals
Returns a predicate that matches field locations where the field type equals the specified field type.- Parameters:
fieldType- the field type to match- Returns:
- a predicate that matches when the field type equals the specified type
-