Class PropertyValue.AsObject

All Implemented Interfaces:
Serializable, Function<AbstractFeature,Object>, Expression<AbstractFeature,Object>, Optimization.OnExpression<AbstractFeature,Object>, FeatureExpression<AbstractFeature,Object>, ValueReference<AbstractFeature,Object>
Enclosing class:
PropertyValue<V>

private static final class PropertyValue.AsObject extends PropertyValue<Object>
An expression fetching property values as Object. This expression does not need to apply any type conversion.
  • Field Details

    • serialVersionUID

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

    • AsObject

      AsObject(String name, boolean isVirtual)
      Creates a new expression retrieving values from a property of the given name.
  • Method Details

    • apply

      public Object apply(AbstractFeature instance)
      Returns the value of the property of the name given at construction time. If no value is found for the given feature, then this method returns null.
      Parameters:
      instance - the object to be evaluated by the expression. Can be null if this expression allows null values.
      Returns:
      value computed by the expression.
    • optimize

      public PropertyValue<Object> optimize(Optimization optimization)
      If the evaluated property is a link, replaces this expression by a more direct reference to the target property. This optimization is important for allowing SQLStore to put the column name in the SQL WHERE clause. It makes the difference between using or not the database index.
      Specified by:
      optimize in interface Optimization.OnExpression<AbstractFeature,Object>
      Specified by:
      optimize in class PropertyValue<Object>
      Parameters:
      optimization - the simplifications or optimizations to apply on this expression.
      Returns:
      the simplified or optimized expression, or this if no optimization has been applied.