Package org.elasticsearch.script
Class EmptyField<T>
java.lang.Object
org.elasticsearch.script.Field<T>
org.elasticsearch.script.EmptyField<T>
Script field with no mapping, always returns
defaultValue.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.script.Field
Field.BigIntegerField, Field.BooleanField, Field.BytesRefField, Field.DateMillisField, Field.DateNanosField, Field.DoubleField, Field.GeoPointField, Field.IpField, Field.LongField, Field.StringField, Field.VersionField -
Field Summary
Fields inherited from class org.elasticsearch.script.Field
BigInteger, Long, name, values -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtensions outside the core package should override this method to implement their own conversions, calling the superclass of this method as a fallback.doublegetDouble(double defaultValue)longgetLong(long defaultValue)Get the first value of a field, ifisEmpty()return defaultValue insteadGet all values of a multivalued field.booleanisEmpty()Does the field have any values? An unmapped field may have values from sourceMethods inherited from class org.elasticsearch.script.Field
as, getFieldValues, getName
-
Constructor Details
-
EmptyField
-
-
Method Details
-
isEmpty
public boolean isEmpty()Description copied from class:FieldDoes the field have any values? An unmapped field may have values from source -
getValues
Description copied from class:FieldGet all values of a multivalued field. IfisEmpty()this returns an empty list -
convert
Description copied from class:FieldExtensions outside the core package should override this method to implement their own conversions, calling the superclass of this method as a fallback. -
getValue
Description copied from class:FieldGet the first value of a field, ifisEmpty()return defaultValue instead -
getDouble
public double getDouble(double defaultValue)Description copied from class:FieldGet the underlying value as adoubleunlessField.isEmpty(), in which case returndefaultValue. May throwInvalidConversionif the underlying value is not representable as adouble. -
getLong
public long getLong(long defaultValue)Description copied from class:FieldGet the underlying value as alongunlessField.isEmpty(), in which case returndefaultValue. May throwInvalidConversionif the underlying value is not representable as along.
-