V
- concrete value typepublic abstract class ConstantExpression<V extends Value> extends Object implements Expression<V>
Value
extending Expression
directly, which would break the Acyclic Dependency principle since Expression
already has a reference to Value
.Modifier and Type | Field and Description |
---|---|
protected Optional<V> |
alwaysPresentValue |
Modifier | Constructor and Description |
---|---|
protected |
ConstantExpression(Datatype<V> datatype,
V v)
Creates instance of constant value expression
|
Modifier and Type | Method and Description |
---|---|
V |
evaluate(EvaluationContext context)
Returns the value itself
|
Datatype<V> |
getReturnType()
Gets the expected return type of the expression if evaluated.
|
Optional<V> |
getValue()
Returns the constant underlying value (always present)
|
String |
toString() |
protected ConstantExpression(Datatype<V> datatype, V v) throws IllegalArgumentException
datatype
- value datatypev
- constant valueIllegalArgumentException
- if datatype == null || v == null
public final Datatype<V> getReturnType()
Expression
getReturnType
in interface Expression<V extends Value>
public final V evaluate(EvaluationContext context) throws IndeterminateEvaluationException
evaluate
in interface Expression<V extends Value>
context
- the representation of the requestIndeterminateEvaluationException
- if evaluation is "Indeterminate" (see XACML core specification)public final Optional<V> getValue()
getValue
in interface Expression<V extends Value>
Copyright © 2012–2020. All rights reserved.