Class ConstantDateValue
- java.lang.Object
-
- org.apache.solr.analytics.value.constant.ConstantValue
-
- org.apache.solr.analytics.value.constant.ConstantDateValue
-
- All Implemented Interfaces:
AnalyticsValue
,AnalyticsValueStream
,ComparableValue
,DateValue
,DateValue.CastingDateValue
,DateValueStream
,LongValue
,LongValueStream
,StringValue
,StringValueStream
public class ConstantDateValue extends ConstantValue implements DateValue.CastingDateValue
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValue
AnalyticsValue.AbstractAnalyticsValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
AnalyticsValueStream.AbstractAnalyticsValueStream, AnalyticsValueStream.ExpressionType
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.DateValue
DateValue.AbstractDateValue, DateValue.CastingDateValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.DateValueStream
DateValueStream.AbstractDateValueStream, DateValueStream.CastingDateValueStream
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.LongValue
LongValue.AbstractLongValue, LongValue.CastingLongValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.LongValueStream
LongValueStream.AbstractLongValueStream, LongValueStream.CastingLongValueStream
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValue
StringValue.AbstractStringValue, StringValue.CastingStringValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValueStream
StringValueStream.AbstractStringValueStream, StringValueStream.CastingStringValueStream
-
-
Field Summary
Fields Modifier and Type Field Description static String
name
-
Fields inherited from class org.apache.solr.analytics.value.constant.ConstantValue
creatorFunction
-
-
Constructor Summary
Constructors Constructor Description ConstantDateValue(long value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists()
Check whether the current value exists.Date
getDate()
Get the date representation of the current value.String
getExpressionStr()
Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionType
getExpressionType()
Get the type of the expression that this class represents.long
getLong()
Get the long representation of the current value.String
getName()
Get the name of function or value.Object
getObject()
Get the object representation of the current value.ConstantComparator
getObjectComparator(String expression)
Create an entry comparator used to sort the facet-value buckets of a facet.String
getString()
Get the String representation of the current value.void
streamDates(Consumer<Date> cons)
Stream the date representations of all current values, if any exist.void
streamLongs(LongConsumer cons)
Stream the long representations of all current values, if any exist.void
streamObjects(Consumer<Object> cons)
Stream the object representations of all current values, if any exist.void
streamStrings(Consumer<String> cons)
Stream the String representations of all current values, if any exist.-
Methods inherited from class org.apache.solr.analytics.value.constant.ConstantValue
convertToConstant
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
convertToConstant
-
-
-
-
Field Detail
-
name
public static final String name
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLong
public long getLong()
Description copied from interface:LongValue
Get the long representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.
-
getDate
public Date getDate()
Description copied from interface:DateValue
Get the date representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.
-
getString
public String getString()
Description copied from interface:StringValue
Get the String representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()
afterwards returnsTRUE
.- Specified by:
getString
in interfaceStringValue
- Returns:
- the current value
-
getObject
public Object getObject()
Description copied from interface:AnalyticsValue
Get the object representation of the current value.- Specified by:
getObject
in interfaceAnalyticsValue
- Returns:
- the current value
-
exists
public boolean exists()
Description copied from interface:AnalyticsValue
Check whether the current value exists.
NOTE: The result of this method is only guaranteed after anyget<Type>()
method is called.- Specified by:
exists
in interfaceAnalyticsValue
- Returns:
- whether the current value exists
-
streamLongs
public void streamLongs(LongConsumer cons)
Description copied from interface:LongValueStream
Stream the long representations of all current values, if any exist.- Specified by:
streamLongs
in interfaceLongValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamDates
public void streamDates(Consumer<Date> cons)
Description copied from interface:DateValueStream
Stream the date representations of all current values, if any exist.- Specified by:
streamDates
in interfaceDateValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamStrings
public void streamStrings(Consumer<String> cons)
Description copied from interface:StringValueStream
Stream the String representations of all current values, if any exist.- Specified by:
streamStrings
in interfaceStringValueStream
- Parameters:
cons
- The consumer to accept the values
-
streamObjects
public void streamObjects(Consumer<Object> cons)
Description copied from interface:AnalyticsValueStream
Stream the object representations of all current values, if any exist.- Specified by:
streamObjects
in interfaceAnalyticsValueStream
- Parameters:
cons
- The consumer to accept the values
-
getObjectComparator
public ConstantComparator getObjectComparator(String expression)
Description copied from interface:ComparableValue
Create an entry comparator used to sort the facet-value buckets of a facet.- Specified by:
getObjectComparator
in interfaceComparableValue
- Parameters:
expression
- the name of the expression in the results array- Returns:
- a comparator to sort the buckets with
-
getName
public String getName()
Description copied from interface:AnalyticsValueStream
Get the name of function or value.- Specified by:
getName
in interfaceAnalyticsValueStream
- Returns:
- the name of function/value
-
getExpressionStr
public String getExpressionStr()
Description copied from interface:AnalyticsValueStream
Get the expression string of the analytics value stream. Must be unique to the expression. If passed toExpressionFactory.createExpression(String)
, the exact same expression should be created.- Specified by:
getExpressionStr
in interfaceAnalyticsValueStream
- Returns:
- the name of function/value
-
getExpressionType
public AnalyticsValueStream.ExpressionType getExpressionType()
Description copied from interface:AnalyticsValueStream
Get the type of the expression that this class represents.- Specified by:
getExpressionType
in interfaceAnalyticsValueStream
- Returns:
- the expression type
-
-