public class FieldPathEntry extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FieldPathEntry.KeyParseResult |
static class |
FieldPathEntry.Type |
Modifier and Type | Field and Description |
---|---|
private Field |
fieldRef |
private int |
lookupIndex |
private FieldValue |
lookupKey |
private DataType |
resultingDataType |
private FieldPathEntry.Type |
type |
private String |
variableName |
Modifier | Constructor and Description |
---|---|
private |
FieldPathEntry(boolean keysOnly,
boolean valuesOnly,
DataType resultingDataType) |
private |
FieldPathEntry(Field fieldRef) |
private |
FieldPathEntry(FieldValue lookupKey,
DataType resultingDataType) |
private |
FieldPathEntry(int lookupIndex,
DataType resultingDataType) |
private |
FieldPathEntry(String variableName,
DataType resultingDataType) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Field |
getFieldRef() |
int |
getLookupIndex() |
FieldValue |
getLookupKey() |
DataType |
getResultingDataType() |
FieldPathEntry.Type |
getType() |
String |
getVariableName() |
int |
hashCode() |
static FieldPathEntry |
newAllKeysLookupEntry(DataType resultingDataType)
Creates a new field path entry that digs through all the keys of a map or weighted set.
|
static FieldPathEntry |
newAllValuesLookupEntry(DataType resultingDataType)
Creates a new field path entry that digs through all the values of a map or weighted set.
|
static FieldPathEntry |
newArrayLookupEntry(int lookupIndex,
DataType resultingDataType)
Creates a new field path entry that references an array index.
|
static FieldPathEntry |
newMapLookupEntry(FieldValue lookupKey,
DataType resultingDataType)
Creates a new field path entry that references a map or weighted set.
|
static FieldPathEntry |
newStructFieldEntry(Field fieldRef)
Creates a new field path entry that references a struct field.
|
static FieldPathEntry |
newVariableLookupEntry(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.
|
static FieldPathEntry.KeyParseResult |
parseKey(String key)
Parse a field path map key of the form {xyz} or {"xyz"} with optional trailing data.
|
private static int |
parseQuotedString(String key,
int offset,
int len,
StringBuilder builder) |
private static int |
skipWhitespace(String str,
int offset,
int len) |
String |
toString() |
private final FieldPathEntry.Type type
private final int lookupIndex
private final FieldValue lookupKey
private final String variableName
private final Field fieldRef
private final DataType resultingDataType
private FieldPathEntry(Field fieldRef)
private FieldPathEntry(int lookupIndex, DataType resultingDataType)
private FieldPathEntry(FieldValue lookupKey, DataType resultingDataType)
private FieldPathEntry(boolean keysOnly, boolean valuesOnly, DataType resultingDataType)
public DataType getResultingDataType()
public FieldPathEntry.Type getType()
public Field getFieldRef()
public int getLookupIndex()
public FieldValue getLookupKey()
public String getVariableName()
public static FieldPathEntry newStructFieldEntry(Field fieldRef)
fieldRef
- The field to look up in the struct.public static FieldPathEntry newArrayLookupEntry(int lookupIndex, DataType resultingDataType)
lookupIndex
- The index to look upresultingDataType
- The datatype of the contents of the arraypublic static FieldPathEntry newMapLookupEntry(FieldValue lookupKey, DataType resultingDataType)
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.public static FieldPathEntry newAllKeysLookupEntry(DataType resultingDataType)
resultingDataType
- The datatype of the keys in the map or weighted set.public static FieldPathEntry newAllValuesLookupEntry(DataType resultingDataType)
resultingDataType
- The datatype of the values in the map or weighted set.public static FieldPathEntry newVariableLookupEntry(String variableName, DataType resultingDataType)
variableName
- The name of the variable to lookup in the collectionresultingDataType
- The value type of the collection we're digging throughprivate static int parseQuotedString(String key, int offset, int len, StringBuilder builder)
private static int skipWhitespace(String str, int offset, int len)
public static FieldPathEntry.KeyParseResult parseKey(String key)
key
- Part of a field path that contains a key at its startCopyright © 2018. All rights reserved.