public class IfFunction extends AnalyticsValueStream.AbstractAnalyticsValueStream
Three arguments are required. The first, the conditional parameter, must be a BooleanValue
and
the later two, the if and else parameters, can be any type of AnalyticsValueStream
.
For each document, if the conditional value is true then the if-value is used otherwise the else-value is used.
The resulting Value or ValueStream will be typed with the closest super-type of the two non-conditional parameters.
(e.g. "if"(boolean,double,int) will return a double)
If two AnalyticsValue
s are passed as the if-else parameters, an AnalyticsValue
will be returned.
If either parameter isn't single-valued, a AnalyticsValueStream
will be returned.
AnalyticsValueStream.AbstractAnalyticsValueStream, AnalyticsValueStream.ExpressionType
Modifier and Type | Field and Description |
---|---|
static ExpressionFactory.CreatorFunction |
creatorFunction |
static String |
name |
Constructor and Description |
---|
IfFunction(BooleanValue ifExpr,
AnalyticsValueStream thenExpr,
AnalyticsValueStream elseExpr) |
Modifier and Type | Method and Description |
---|---|
String |
getExpressionStr()
Get the expression string of the analytics value stream.
|
AnalyticsValueStream.ExpressionType |
getExpressionType()
Get the type of the expression that this class represents.
|
String |
getName()
Get the name of function or value.
|
void |
streamObjects(Consumer<Object> cons)
Stream the object representations of all current values, if any exist.
|
convertToConstant
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createExpressionString, determineMappingPhase
public static final String name
public static final ExpressionFactory.CreatorFunction creatorFunction
public IfFunction(BooleanValue ifExpr, AnalyticsValueStream thenExpr, AnalyticsValueStream elseExpr) throws SolrException
SolrException
public void streamObjects(Consumer<Object> cons)
AnalyticsValueStream
cons
- The consumer to accept the valuespublic String getName()
AnalyticsValueStream
public String getExpressionStr()
AnalyticsValueStream
ExpressionFactory.createExpression(String)
, the exact same expression should be created.public AnalyticsValueStream.ExpressionType getExpressionType()
AnalyticsValueStream
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.