Class EmptyField

java.lang.Object
org.elasticsearch.script.field.EmptyField
All Implemented Interfaces:
Iterable<Object>, Field<Object>

public class EmptyField extends Object implements Field<Object>
A script Field with no mapping, always returns defaultValue.
  • Constructor Details

    • EmptyField

      public EmptyField(String name)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Field
      Returns the name of this field.
      Specified by:
      getName in interface Field<Object>
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Field
      Returns true if this field has no values, otherwise false.
      Specified by:
      isEmpty in interface Field<Object>
    • size

      public int size()
      Description copied from interface: Field
      Returns the number of values this field has.
      Specified by:
      size in interface Field<Object>
    • get

      public Object get(Object defaultValue)
    • get

      public Object get(int index, Object defaultValue)
    • iterator

      public Iterator<Object> iterator()
      Specified by:
      iterator in interface Iterable<Object>