Package com.attivio.sdk.search.facet
Class FacetBucket
- java.lang.Object
-
- com.attivio.sdk.search.facet.FacetBucket
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
QueryFacetBucket,RangeFacetBucket,SchemaFieldBucket
public class FacetBucket extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableA bucket in aFacetResponse.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FacetBucketschildrenprotected longcountprotected java.lang.Objectvalue
-
Constructor Summary
Constructors Constructor Description FacetBucket()FacetBucket(Point value, long count)FacetBucket(FacetRange range, long count)FacetBucket(Query query, long count)FacetBucket(java.lang.Boolean value, long count)FacetBucket(java.lang.Number value, long count)FacetBucket(java.lang.String value, long count)FacetBucket(java.util.Date value, long count)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(FacetBucket other)Add the count forotherto this bucket.booleanbooleanValue()Gets the value as aboolean.FacetBucketclone()protected static java.lang.Objectclone(java.lang.Object value)java.util.DatedateValue()Gets the value as aDate.java.math.BigDecimaldecimalValue()Gets the value as aBigDecimal.doubledoubleValue()Gets the value as adouble.booleanequals(java.lang.Object other)protected static booleanequals(java.lang.Object a, java.lang.Object b)floatfloatValue()Gets the value as afloat.FacetBucketsgetChildren()Get the child buckets.longgetCount()Get the count for this bucket.protected java.lang.LonggetDate()java.lang.StringgetDisplayValue()Get a string value that is suitable as a display value for this bucket.static java.lang.StringgetDisplayValue(java.lang.Object value, java.lang.String defaultValue)Get a display value forvalueprotected QuerygetFilter()JSON SUPPORT FOLLOWSQuerygetQueryFilter(FacetResponse facet)Deprecated.usegetQueryFilter(String)instead.QuerygetQueryFilter(java.lang.String field)Get theQueryto use for drilling down on this bucket viafield.FacetRangegetRange()Get the range for this bucket, ornullif this bucket does not represent a range.java.lang.Comparable<?>getSortValue()Deprecated.usegetValue()instead.FacetStatisticsgetStatistics()Get theFacetStatisticsfor child buckets, ornullif not available.java.lang.ObjectgetValue()Get the value for this bucket.protected java.lang.ObjectgetValue_json()inthashCode()intintValue()Gets the value as anint.longlongValue()Gets the value as along.PointpointValue()Gets the value as aPoint.FacetBucketsetChildren(FacetBuckets value)Set the child buckets.voidsetCount(long count)Set the count for this bucket.protected voidsetDate(long value)voidsetValue(double value)voidsetValue(long value)voidsetValue(Point value)Set aPointvalue.voidsetValue(FacetRange value)Set the range for this bucket.voidsetValue(Query value)Set aQueryvalue.voidsetValue(java.lang.Boolean value)Set aBooleanvalue.voidsetValue(java.lang.Number value)Set anumericvalue.voidsetValue(java.lang.String value)Set aStringvalue.voidsetValue(java.util.Date value)Set aDatevalue.protected voidsetValue_json(java.lang.Object value)java.lang.StringstringValue()Gets the value as a string.java.lang.StringtoString()
-
-
-
Field Detail
-
value
protected java.lang.Object value
-
count
protected long count
-
children
protected FacetBuckets children
-
-
Constructor Detail
-
FacetBucket
public FacetBucket()
-
FacetBucket
public FacetBucket(java.lang.String value, long count)
-
FacetBucket
public FacetBucket(java.lang.Number value, long count)
-
FacetBucket
public FacetBucket(java.util.Date value, long count)
-
FacetBucket
public FacetBucket(java.lang.Boolean value, long count)
-
FacetBucket
public FacetBucket(Point value, long count)
-
FacetBucket
public FacetBucket(FacetRange range, long count)
-
FacetBucket
public FacetBucket(Query query, long count)
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
Get the value for this bucket.
-
getRange
public FacetRange getRange()
Get the range for this bucket, ornullif this bucket does not represent a range.
-
stringValue
public java.lang.String stringValue()
Gets the value as a string.
-
intValue
public int intValue()
Gets the value as anint.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as anint.
-
longValue
public long longValue()
Gets the value as along.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as along.
-
doubleValue
public double doubleValue()
Gets the value as adouble.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as adouble.
-
floatValue
public float floatValue()
Gets the value as afloat.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as afloat.
-
dateValue
public java.util.Date dateValue()
Gets the value as aDate.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as aDate.
-
booleanValue
public boolean booleanValue()
Gets the value as aboolean.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as aboolean.
-
pointValue
public Point pointValue()
Gets the value as aPoint.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as aPoint.
-
decimalValue
public java.math.BigDecimal decimalValue()
Gets the value as aBigDecimal.- Throws:
java.lang.IllegalArgumentException- if this value cannot be represented as aBigDecimal.
-
setValue
public void setValue(java.lang.String value)
Set aStringvalue.
-
setValue
public void setValue(java.lang.Number value)
Set anumericvalue.
-
setValue
public void setValue(long value)
-
setValue
public void setValue(double value)
-
setValue
public void setValue(java.util.Date value)
Set aDatevalue.
-
setValue
public void setValue(java.lang.Boolean value)
Set aBooleanvalue.
-
setValue
public void setValue(FacetRange value)
Set the range for this bucket.
-
getSortValue
@Deprecated public java.lang.Comparable<?> getSortValue()
Deprecated.usegetValue()instead.
-
getDisplayValue
public java.lang.String getDisplayValue()
Get a string value that is suitable as a display value for this bucket.
-
getCount
public long getCount()
Get the count for this bucket.
-
setCount
public void setCount(long count)
Set the count for this bucket.
-
add
public void add(FacetBucket other)
Add the count forotherto this bucket.
-
getChildren
public FacetBuckets getChildren()
Get the child buckets.Returns
nullif no child buckets exist.
-
setChildren
public FacetBucket setChildren(FacetBuckets value)
Set the child buckets.
-
getStatistics
public FacetStatistics getStatistics()
Get theFacetStatisticsfor child buckets, ornullif not available.
-
getQueryFilter
public Query getQueryFilter(java.lang.String field)
Get theQueryto use for drilling down on this bucket viafield.
-
getQueryFilter
@Deprecated public Query getQueryFilter(FacetResponse facet)
Deprecated.usegetQueryFilter(String)instead.Get theQueryto use for drilling down on this bucket.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
clone
public FacetBucket clone()
- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
clone
protected static java.lang.Object clone(java.lang.Object value)
-
equals
protected static boolean equals(java.lang.Object a, java.lang.Object b)
-
getDisplayValue
public static java.lang.String getDisplayValue(java.lang.Object value, java.lang.String defaultValue)Get a display value forvalue
-
getFilter
protected Query getFilter()
JSON SUPPORT FOLLOWS
-
getDate
protected java.lang.Long getDate()
-
setDate
protected void setDate(long value)
-
getValue_json
protected java.lang.Object getValue_json()
-
setValue_json
protected void setValue_json(java.lang.Object value)
-
-