Class StructMemberAccessExpression

All Implemented Interfaces:
TypedExpression, org.opengis.filter.expression.Expression, org.opengis.filter.expression.PropertyName

public class StructMemberAccessExpression extends Object implements org.opengis.filter.expression.PropertyName, TypedExpression

Access properties inside riskscape values using struct member lookups which gives consistent access times.

  • Constructor Details

    • StructMemberAccessExpression

      public StructMemberAccessExpression(boolean nullableResult, segmentsParam)
    • StructMemberAccessExpression

      public StructMemberAccessExpression(boolean nullableResult, List<> segments)
  • Method Details

    • build

      public static<StructMemberAccessExpression> build( sourceType, List<String> segments)

      Construct a StructMemberAccessExpression that will access the given type, using the path expression broken down in to a list of segments.

      sourceType - the type of thing being accessed, should be, or wrap, a Struct, or the result will fail
      segments - the list of attributes to traverse when accessing a property. If these properties don't exist on the given type, and it's child types, then the result will fail.
    • getRootStruct

      public getRootStruct()
      the struct that owns the first path segment in this expression. All tuples given to this expression's evaluate methods must have the same struct object as this of bad things will happen.
    • evaluateType

      public<> evaluateType( sourceType)
      Description copied from interface: TypedExpression

      The riskscape type this expression will return as a Value

      Specified by:
      evaluateType in interface TypedExpression
    • getType

      public getType()
    • setValue

      public void setValue( object, Object toSet)

      Use this expression to set a value to a tuple, rather than fetch it. This method is not type-safe in the sense that it allows you to set a invariant value to the tuple - it is on you to check it before it goes in.

      If a child tuple is null along the way, it will be created using the type found in this member's root struct

      object - target tuple to modify.
      toSet - a value to set to the tuple (or one of its children)
      IllegalArgumentException - if tuple not of the exact same type used to build this expression
    • evaluate

      public Object evaluate(Object object)
      Specified by:
      evaluate in interface org.opengis.filter.expression.Expression
    • evaluate

      public <T> T evaluate(Object object, Class<T> context)
      Specified by:
      evaluate in interface org.opengis.filter.expression.Expression
    • toString

      public String toString()
      toString in class Object
    • accept

      public Object accept(org.opengis.filter.expression.ExpressionVisitor visitor, Object extraData)
      Specified by:
      accept in interface org.opengis.filter.expression.Expression
    • getPropertyName

      public String getPropertyName()
      Specified by:
      getPropertyName in interface org.opengis.filter.expression.PropertyName
    • getSegments

      public List<> getSegments()
    • getNamespaceContext

      public NamespaceSupport getNamespaceContext()
      Specified by:
      getNamespaceContext in interface org.opengis.filter.expression.PropertyName
    • toExpression

      public toExpression()
    • equals

      public boolean equals(Object o)
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      hashCode in class Object