Package org.elasticsearch.search.sort
Class SortValue
java.lang.Object
org.elasticsearch.search.sort.SortValue
- All Implemented Interfaces:
Comparable<SortValue>,NamedWriteable,Writeable
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 TypeMethodDescriptionfinal intprotected abstract intCompare this sort value to another sort value of the same type.abstract booleanabstract 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.static SortValuefrom(org.apache.lucene.util.BytesRef bytes) Get a SortValue for bytes.abstract ObjectgetKey()The java object representing the sort value.abstract inthashCode()static List<NamedWriteableRegistry.Entry>Get the list of NamedWriteables that this class needs.abstract Numberprotected abstract XContentBuilderrawToXContent(XContentBuilder builder) Write the key as xcontent using the most native type possible.abstract StringtoString()final XContentBuildertoXContent(XContentBuilder builder, DocValueFormat format) Write the key as xcontent.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Method Details
-
from
Get a SortValue for a double. -
from
Get a SortValue for a long. -
from
Get a SortValue for bytes. Callers should be sure that they have aBytesRef.deepCopyOf(org.apache.lucene.util.BytesRef)of any mutable references. -
namedWriteables
Get the list of NamedWriteables that this class needs. -
compareTo
- Specified by:
compareToin interfaceComparable<SortValue>
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, DocValueFormat format) throws IOException Write the key as xcontent.- Throws:
IOException
-
getKey
The java object representing the sort value. -
format
Format this value using the provided format. -
rawToXContent
Write the key as xcontent using the most native type possible.- Throws:
IOException
-
compareToSameType
Compare this sort value to another sort value of the same type. -
equals
-
hashCode
public abstract int hashCode() -
toString
-
numberValue
Return this SortValue as a boxed Number orDouble.NaNif it isn't a number. Or if it is actuallyDouble.NaN.
-