@Internal public abstract class FieldAccessor<T,F> extends Object implements Serializable
Field expressions that specify nested fields (e.g. "f1.a.foo") result in nested field accessors. These penetrate one layer, and then delegate the rest of the work to an "innerAccessor". (see PojoFieldAccessor, RecursiveTupleFieldAccessor, RecursiveProductFieldAccessor)
Modifier and Type | Field and Description |
---|---|
protected TypeInformation |
fieldType |
Constructor and Description |
---|
FieldAccessor() |
Modifier and Type | Method and Description |
---|---|
abstract F |
get(T record)
Gets the value of the field (specified in the constructor) of the given record.
|
TypeInformation<F> |
getFieldType()
Gets the TypeInformation for the type of the field.
|
abstract T |
set(T record,
F fieldValue)
Sets the field (specified in the constructor) of the given record to the given value.
|
protected TypeInformation fieldType
public TypeInformation<F> getFieldType()
public abstract F get(T record)
record
- The record on which the field will be accessedpublic abstract T set(T record, F fieldValue)
Warning: This might modify the original object, or might return a new object instance. (This is necessary, because the record might be immutable.)
record
- The record to modifyfieldValue
- The new value of the fieldCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.