Class RangeAggregator.Range
java.lang.Object
org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.Range
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
- Direct Known Subclasses:
GeoDistanceAggregationBuilder.Range
- Enclosing class:
- RangeAggregator
public static class RangeAggregator.Range extends java.lang.Object implements Writeable, org.elasticsearch.common.xcontent.ToXContentObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields Modifier and Type Field Description protected double
from
static org.elasticsearch.common.ParseField
FROM_FIELD
protected java.lang.String
fromAsStr
protected java.lang.String
key
static org.elasticsearch.common.ParseField
KEY_FIELD
static org.elasticsearch.common.xcontent.ConstructingObjectParser<RangeAggregator.Range,java.lang.Void>
PARSER
protected double
to
static org.elasticsearch.common.ParseField
TO_FIELD
protected java.lang.String
toAsStr
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
Constructors Constructor Description Range(java.lang.String key, java.lang.Double from, java.lang.Double to)
Range(java.lang.String key, java.lang.Double from, java.lang.String fromAsStr, java.lang.Double to, java.lang.String toAsStr)
Build the range.Range(java.lang.String key, java.lang.String from, java.lang.String to)
Range(StreamInput in)
Read from a stream. -
Method Summary
Modifier and Type Method Description boolean
equals(java.lang.Object obj)
double
getFrom()
java.lang.String
getFromAsString()
java.lang.String
getKey()
double
getTo()
java.lang.String
getToAsString()
int
hashCode()
java.lang.String
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
KEY_FIELD
public static final org.elasticsearch.common.ParseField KEY_FIELD -
FROM_FIELD
public static final org.elasticsearch.common.ParseField FROM_FIELD -
TO_FIELD
public static final org.elasticsearch.common.ParseField TO_FIELD -
key
protected final java.lang.String key -
from
protected final double from -
fromAsStr
protected final java.lang.String fromAsStr -
to
protected final double to -
toAsStr
protected final java.lang.String toAsStr -
PARSER
public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<RangeAggregator.Range,java.lang.Void> PARSER
-
-
Constructor Details
-
Range
public Range(java.lang.String key, java.lang.Double from, java.lang.String fromAsStr, java.lang.Double to, java.lang.String toAsStr)Build the range. Generally callers should preferRange(String, Double, Double)
orRange(String, String, String)
. If you must call this know that consumers preferfrom
andto
parameters if they are non-null and finite. Otherwise they parse fromfromrStr
andtoStr
. -
Range
public Range(java.lang.String key, java.lang.Double from, java.lang.Double to) -
Range
public Range(java.lang.String key, java.lang.String from, java.lang.String to) -
Range
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
getFrom
public double getFrom() -
getTo
public double getTo() -
getFromAsString
public java.lang.String getFromAsString() -
getToAsString
public java.lang.String getToAsString() -
getKey
public java.lang.String getKey() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classjava.lang.Object
-