Enum ParameterType
- java.lang.Object
-
- java.lang.Enum<ParameterType>
-
- software.amazon.smithy.rulesengine.language.syntax.parameters.ParameterType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ParameterType>
public enum ParameterType extends java.lang.Enum<ParameterType>
The types that parameters can be.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN
A "boolean" parameter type.STRING
A "string" parameter type.STRING_ARRAY
An array (list) of strings parameter type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParameterType
fromNode(Node node)
Creates aParameterType
of a specific type from the given Node type.static ParameterType
fromNode(StringNode node)
Creates aParameterType
of a specific type from the given Node information.static ParameterType
fromShapeType(ShapeType type)
Creates aParameterType
of a specific type from the given ShapeType.static ParameterType
fromType(Type type)
Creates aParameterType
of a specific type from the given parameter Type.java.lang.String
toString()
static ParameterType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ParameterType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRING
public static final ParameterType STRING
A "string" parameter type.
-
BOOLEAN
public static final ParameterType BOOLEAN
A "boolean" parameter type.
-
STRING_ARRAY
public static final ParameterType STRING_ARRAY
An array (list) of strings parameter type.
-
-
Method Detail
-
values
public static ParameterType[] 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 (ParameterType c : ParameterType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ParameterType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromNode
public static ParameterType fromNode(StringNode node) throws RuleError
Creates aParameterType
of a specific type from the given Node information.- Parameters:
node
- the node to deserialize.- Returns:
- the created ParameterType.
- Throws:
RuleError
- when the value is not a valid ParameterType.
-
fromNode
public static ParameterType fromNode(Node node) throws RuleError
Creates aParameterType
of a specific type from the given Node type.- Parameters:
node
- the node to deserialize.- Returns:
- the created ParameterType.
- Throws:
RuleError
- when the node would not create a valid ParameterType.
-
fromType
public static ParameterType fromType(Type type)
Creates aParameterType
of a specific type from the given parameter Type.- Parameters:
type
- the Type to create from.- Returns:
- the created ParameterType.
- Throws:
java.lang.RuntimeException
- when the value would not create a valid ParameterType.
-
fromShapeType
public static ParameterType fromShapeType(ShapeType type)
Creates aParameterType
of a specific type from the given ShapeType.- Parameters:
type
- the ShapeType to create from.- Returns:
- the created ParameterType.
- Throws:
java.lang.RuntimeException
- when the value would not create a valid ParameterType.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<ParameterType>
-
-