Class FieldPathEntry


  • public class FieldPathEntry
    extends java.lang.Object
    Author:
    thomasg
    • Method Detail

      • getResultingDataType

        public DataType getResultingDataType()
      • getFieldRef

        public Field getFieldRef()
      • getLookupIndex

        public int getLookupIndex()
      • getVariableName

        public java.lang.String getVariableName()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • newStructFieldEntry

        public static FieldPathEntry newStructFieldEntry​(Field fieldRef)
        Creates a new field path entry that references a struct field. For these kinds of field path entries, getFieldRef() is valid.
        Parameters:
        fieldRef - The field to look up in the struct.
        Returns:
        The new field path entry
      • newArrayLookupEntry

        public static FieldPathEntry newArrayLookupEntry​(int lookupIndex,
                                                         DataType resultingDataType)
        Creates a new field path entry that references an array index.
        Parameters:
        lookupIndex - The index to look up
        resultingDataType - The datatype of the contents of the array
        Returns:
        The new field path entry
      • newMapLookupEntry

        public static FieldPathEntry newMapLookupEntry​(FieldValue lookupKey,
                                                       DataType resultingDataType)
        Creates a new field path entry that references a map or weighted set.
        Parameters:
        lookupKey - The value of the key in the map or weighted set to recurse into.
        resultingDataType - The datatype of values in the map or weighted set.
        Returns:
        The new field path entry
      • newAllKeysLookupEntry

        public static FieldPathEntry newAllKeysLookupEntry​(DataType resultingDataType)
        Creates a new field path entry that digs through all the keys of a map or weighted set.
        Parameters:
        resultingDataType - The datatype of the keys in the map or weighted set.
        Returns:
        The new field path entry.
      • newAllValuesLookupEntry

        public static FieldPathEntry newAllValuesLookupEntry​(DataType resultingDataType)
        Creates a new field path entry that digs through all the values of a map or weighted set.
        Parameters:
        resultingDataType - The datatype of the values in the map or weighted set.
        Returns:
        The new field path entry.
      • newVariableLookupEntry

        public static FieldPathEntry newVariableLookupEntry​(java.lang.String variableName,
                                                            DataType resultingDataType)
        Creates a new field path entry that digs through all the keys in a map or weighted set, or all the indexes of an array, an sets the given variable name as it does so (or, if the variable is set, uses the set variable to look up the collection.
        Parameters:
        variableName - The name of the variable to lookup in the collection
        resultingDataType - The value type of the collection we're digging through
        Returns:
        The new field path entry.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • parseKey

        public static FieldPathEntry.KeyParseResult parseKey​(java.lang.String key)
        Parse a field path map key of the form {xyz} or {"xyz"} with optional trailing data. If the key contains a '}' or '"' character, the key must be in quotes and all double-quote characters must be escaped. Only '"' chars may be escaped. Any trailing string data past the '}' is ignored.
        Parameters:
        key - Part of a field path that contains a key at its start
        Returns:
        A parse result containing the parsed/unescaped key and the number of input characters the parse consumed. Does not include any characters beyond the '}' char.