Enum YangBooleanConstantExpr
- java.lang.Object
-
- java.lang.Enum<YangBooleanConstantExpr>
-
- org.opendaylight.yangtools.yang.xpath.api.YangBooleanConstantExpr
-
- All Implemented Interfaces:
Serializable
,Comparable<YangBooleanConstantExpr>
,Identifiable<QName>
,Immutable
,MutationBehaviour<Immutable>
,YangConstantExpr<Boolean>
,YangExpr
@Beta public enum YangBooleanConstantExpr extends Enum<YangBooleanConstantExpr> implements YangConstantExpr<Boolean>
Expressions which evaluate to a logicaltrue
orfalse
. These expressions are equivalent to the result returned bytrue()
andfalse()
functions defined in XPath 1.0.They also map these functions' names to the constant pool under their
YangFunctionCallExpr.getName()
identity. All users should use these constants in favor of their equivalent function calls.- Author:
- Robert Varga
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description YangFunctionCallExpr
asFunction()
Convert this constant into the equivalent function.YangLiteralExpr
asStringLiteral()
Convert this constant into a string literal, i.e.static Optional<YangFunctionCallExpr>
forFunctionName(String functionName)
QName
getIdentifier()
Return this objects Identifier.Boolean
getValue()
Return this constant's value.static YangBooleanConstantExpr
of(boolean bool)
static YangBooleanConstantExpr
valueOf(String name)
Returns the enum constant of this type with the specified name.static YangBooleanConstantExpr[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FALSE
public static final YangBooleanConstantExpr FALSE
A constantfalse
expression.
-
TRUE
public static final YangBooleanConstantExpr TRUE
A constanttrue
expression.
-
-
Method Detail
-
values
public static YangBooleanConstantExpr[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (YangBooleanConstantExpr c : YangBooleanConstantExpr.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static YangBooleanConstantExpr valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getIdentifier
public QName getIdentifier()
Description copied from interface:Identifiable
Return this objects Identifier.- Specified by:
getIdentifier
in interfaceIdentifiable<QName>
- Returns:
- Object's identifier, must not be null.
-
getValue
public Boolean getValue()
Description copied from interface:YangConstantExpr
Return this constant's value.- Specified by:
getValue
in interfaceYangConstantExpr<Boolean>
- Returns:
- this constant's value.
-
asFunction
public YangFunctionCallExpr asFunction()
Convert this constant into the equivalent function. This function is provided for bridging purposes only.- Returns:
- Equivalent function invocation.
-
asStringLiteral
public YangLiteralExpr asStringLiteral()
Convert this constant into a string literal, i.e. the result of callingstring(boolean)
function on this constant.- Returns:
- Literal expression.
-
of
public static YangBooleanConstantExpr of(boolean bool)
-
forFunctionName
public static Optional<YangFunctionCallExpr> forFunctionName(String functionName)
-
-