Class UnaryFunction.IsNil<R>

Type Parameters:
R - the type of resources used as inputs.
All Implemented Interfaces:
Serializable, Predicate<R>, Filter<R>, Optimization.OnFilter<R>
Enclosing class:
UnaryFunction<R,V>

static final class UnaryFunction.IsNil<R> extends UnaryFunction<R,Object> implements Filter<R>, Optimization.OnFilter<R>
Filter operator that checks if an expression's value is nil. The difference with UnaryFunction.IsNull is that a value should exist but cannot be provided for the reason given by getNilReason().
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • nilReason

      private final String nilReason
      The reason why the value is nil, or null for accepting any reason.
  • Constructor Details

    • IsNil

      IsNil(Expression<? super R,?> expression, String nilReason)
      Creates a new operator.
  • Method Details

    • getOperatorType

      public ComparisonOperatorName getOperatorType()
      Description copied from interface: Filter
      Returns the nature of the operator.
      Specified by:
      getOperatorType in interface Filter<R>
      Returns:
      the nature of this operator.
    • recreate

      public Filter<R> recreate(Expression<? super R,?>[] effective)
      Creates a new filter of the same type but different parameters.
      Specified by:
      recreate in interface Optimization.OnFilter<R>
      Parameters:
      effective - the expressions to use as a replacement of this filter expressions.
      Returns:
      the new filter, or this if unsupported.
    • getNilReason

      public Optional<String> getNilReason()
      Returns the reason why the value is nil.
    • test

      public boolean test(R object)
      Evaluate this filter on the given object.
      Specified by:
      test in interface Filter<R>
      Specified by:
      test in interface Predicate<R>
      Parameters:
      object - the object (often a Feature instance) to evaluate.
      Returns:
      true if the test(s) are passed for the provided object.