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
-
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.double
getDouble(double defaultValue)
long
getLong(long defaultValue)
Get the first value of a field, ifisEmpty()
return defaultValue insteadGet all values of a multivalued field.boolean
isEmpty()
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:Field
Does the field have any values? An unmapped field may have values from source -
getValues
Description copied from class:Field
Get all values of a multivalued field. IfisEmpty()
this returns an empty list -
convert
Description copied from class:Field
Extensions 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:Field
Get the first value of a field, ifisEmpty()
return defaultValue instead -
getDouble
public double getDouble(double defaultValue)Description copied from class:Field
Get the underlying value as adouble
unlessField.isEmpty()
, in which case returndefaultValue
. May throwInvalidConversion
if the underlying value is not representable as adouble
. -
getLong
public long getLong(long defaultValue)Description copied from class:Field
Get the underlying value as along
unlessField.isEmpty()
, in which case returndefaultValue
. May throwInvalidConversion
if the underlying value is not representable as along
.
-