Class SortValue

java.lang.Object
org.elasticsearch.search.sort.SortValue
All Implemented Interfaces:
java.lang.Comparable<SortValue>, NamedWriteable, Writeable

public abstract class SortValue
extends java.lang.Object
implements NamedWriteable, java.lang.Comparable<SortValue>
A Comparable, DocValueFormat aware wrapper around a sort value.
  • Method Details

    • from

      public static SortValue from​(double d)
      Get a SortValue for a double.
    • from

      public static SortValue from​(long l)
      Get a SortValue for a long.
    • namedWriteables

      public static java.util.List<NamedWriteableRegistry.Entry> namedWriteables()
      Get the list of NamedWriteables that this class needs.
    • compareTo

      public final int compareTo​(SortValue other)
      Specified by:
      compareTo in interface java.lang.Comparable<SortValue>
    • toXContent

      public final XContentBuilder toXContent​(XContentBuilder builder, DocValueFormat format) throws java.io.IOException
      Write the key as xcontent.
      Throws:
      java.io.IOException
    • getKey

      public abstract java.lang.Object getKey()
      The java object representing the sort value.
    • format

      public abstract java.lang.String format​(DocValueFormat format)
      Format this value using the provided format.
    • rawToXContent

      protected abstract XContentBuilder rawToXContent​(XContentBuilder builder) throws java.io.IOException
      Write the key as xcontent using the most native type possible.
      Throws:
      java.io.IOException
    • compareToSameType

      protected abstract int compareToSameType​(SortValue obj)
      Compare this sort value to another sort value of the same type.
    • equals

      public abstract boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public abstract int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public abstract java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • numberValue

      public abstract java.lang.Number numberValue()
      Return this SortValue as a boxed Number.