Package org.elasticsearch.search.sort
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Method Summary
Modifier and Type Method Description intcompareTo(SortValue other)protected abstract intcompareToSameType(SortValue obj)Compare this sort value to another sort value of the same type.abstract booleanequals(java.lang.Object obj)abstract java.lang.Stringformat(DocValueFormat format)Format this value using the provided format.static SortValuefrom(double d)Get a SortValue for a double.static SortValuefrom(long l)Get a SortValue for a long.abstract java.lang.ObjectgetKey()The java object representing the sort value.abstract inthashCode()static java.util.List<NamedWriteableRegistry.Entry>namedWriteables()Get the list of NamedWriteables that this class needs.abstract java.lang.NumbernumberValue()Return this SortValue as a boxed Number.protected abstract org.elasticsearch.common.xcontent.XContentBuilderrawToXContent(org.elasticsearch.common.xcontent.XContentBuilder builder)Write the key as xcontent using the most native type possible.abstract java.lang.StringtoString()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, DocValueFormat format)Write the key as xcontent.
-
Method Details
-
from
Get a SortValue for a double. -
from
Get a SortValue for a long. -
namedWriteables
Get the list of NamedWriteables that this class needs. -
compareTo
- Specified by:
compareToin interfacejava.lang.Comparable<SortValue>
-
toXContent
public final org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, DocValueFormat format) throws java.io.IOExceptionWrite the key as xcontent.- Throws:
java.io.IOException
-
getKey
public abstract java.lang.Object getKey()The java object representing the sort value. -
format
Format this value using the provided format. -
rawToXContent
protected abstract org.elasticsearch.common.xcontent.XContentBuilder rawToXContent(org.elasticsearch.common.xcontent.XContentBuilder builder) throws java.io.IOExceptionWrite the key as xcontent using the most native type possible.- Throws:
java.io.IOException
-
compareToSameType
Compare this sort value to another sort value of the same type. -
equals
public abstract boolean equals(java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public abstract int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public abstract java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
numberValue
public abstract java.lang.Number numberValue()Return this SortValue as a boxed Number.
-