Class Exp
java.lang.Object
io.openems.edge.core.appmanager.formly.Exp
-
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayExpression
Creates a array of the given values.static Variable
currentModelValue
(Nameable property) Creates aVariable
of the given property of the current value in the model.static Variable
currentValue
(Nameable property) Creates aVariable
of the given property of the current value in the form control.static Variable
Creates a dynamicVariable
.static StringExpression
ifElse
(BooleanExpression statement, StringExpression ifTrue, StringExpression ifFalse) Creates a combinedStringExpression
of the givenBooleanExpression
andStringExpression
, which returns the firstStringExpression
if the givenBooleanExpression
returns true otherwise the secondStringExpression
gets returned.static Variable
initialModelValue
(Nameable property) Creates aVariable
to access the initial value of a property.static <E extends Enum<E> & TranslatableEnum>
VariablestaticValue
(E enumValue) static Variable
staticValue
(Number value) static Variable
staticValue
(String value) static Collector
<Variable, ?, ArrayExpression>
-
Method Details
-
currentValue
Creates aVariable
of the given property of the current value in the form control.The difference between this method and the
currentModelValue(Nameable)
method is, that the value of thecurrentValue(Nameable)
method may be null when a default value was set and the field is readonly.- Parameters:
property
- the property to access the value- Returns:
- the
Variable
-
currentModelValue
Creates aVariable
of the given property of the current value in the model.The difference between this method and the
currentValue(Nameable)
method is, that the value of thecurrentValue(Nameable)
method may be null when a default value was set and the field is readonly.- Parameters:
property
- the property of the value- Returns:
- the
Variable
-
initialModelValue
Creates aVariable
to access the initial value of a property. Only helpful for already installed instances, otherwise this value is undefined.- Parameters:
property
- the property of the value- Returns:
- the
Variable
-
staticValue
- Parameters:
value
- the value of the variable- Returns:
- the
Variable
-
staticValue
- Type Parameters:
E
- the type of the enum- Parameters:
enumValue
- the value of the variable- Returns:
- the
Variable
-
staticValue
- Parameters:
value
- the value of the variable- Returns:
- the
Variable
-
dynamic
Creates a dynamicVariable
.- Parameters:
name
- the name of the variable- Returns:
- the created
Variable
-
array
Creates a array of the given values.- Parameters:
variable
- the variables of the array- Returns:
- a
ArrayExpression
-
toArrayExpression
- Returns:
- the
Collector
-
ifElse
public static StringExpression ifElse(BooleanExpression statement, StringExpression ifTrue, StringExpression ifFalse) Creates a combinedStringExpression
of the givenBooleanExpression
andStringExpression
, which returns the firstStringExpression
if the givenBooleanExpression
returns true otherwise the secondStringExpression
gets returned.- Parameters:
statement
- theBooleanExpression
to determine whichStringExpression
should be usedifTrue
- theStringExpression
to use when the statement returns trueifFalse
- theStringExpression
to use when the statement returns false- Returns:
- the final
StringExpression
-