Package org.apache.solr.analytics.value
Class StringValue.AbstractStringValue
- java.lang.Object
-
- org.apache.solr.analytics.value.StringValue.AbstractStringValue
-
- All Implemented Interfaces:
AnalyticsValue
,AnalyticsValueStream
,ComparableValue
,StringValue
,StringValue.CastingStringValue
,StringValueStream
- Enclosing interface:
- StringValue
public abstract static class StringValue.AbstractStringValue extends Object implements StringValue.CastingStringValue
An abstract base forStringValue.CastingStringValue
that automatically casts to all types ifStringValue.getString()
andAnalyticsValue.exists()
are implemented.
-
-
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.StringValue
StringValue.AbstractStringValue, StringValue.CastingStringValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValueStream
StringValueStream.AbstractStringValueStream, StringValueStream.CastingStringValueStream
-
-
Constructor Summary
Constructors Constructor Description AbstractStringValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnalyticsValue
convertToConstant()
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.String
getObject()
Get the object representation of the current value.ExpressionComparator<String>
getObjectComparator(String expression)
Create an entry comparator used to sort the facet-value buckets of a facet.void
streamObjects(Consumer<Object> func)
Stream the object representations of all current values, if any exist.void
streamStrings(Consumer<String> func)
Stream the String representations of all current values, if any exist.-
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.AnalyticsValue
exists
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
getExpressionStr, getExpressionType, getName
-
Methods inherited from interface org.apache.solr.analytics.value.StringValue
getString
-
-
-
-
Method Detail
-
getObject
public String getObject()
Description copied from interface:AnalyticsValue
Get the object representation of the current value.- Specified by:
getObject
in interfaceAnalyticsValue
- Returns:
- the current value
-
streamStrings
public void streamStrings(Consumer<String> func)
Description copied from interface:StringValueStream
Stream the String representations of all current values, if any exist.- Specified by:
streamStrings
in interfaceStringValueStream
- Parameters:
func
- The consumer to accept the values
-
streamObjects
public void streamObjects(Consumer<Object> func)
Description copied from interface:AnalyticsValueStream
Stream the object representations of all current values, if any exist.- Specified by:
streamObjects
in interfaceAnalyticsValueStream
- Parameters:
func
- The consumer to accept the values
-
convertToConstant
public AnalyticsValue convertToConstant()
Description copied from interface:AnalyticsValueStream
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.If the value is reduced then no conversion will occur and the value itself will be returned.
- Specified by:
convertToConstant
in interfaceAnalyticsValueStream
- Returns:
- a constant representation of this value
-
getObjectComparator
public ExpressionComparator<String> 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
-
-