Class Parameter
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToCondition
,ToExpression
,ToSmithyBuilder<Parameter>
public final class Parameter
extends SyntaxElement
implements ToSmithyBuilder<Parameter>, FromSourceLocation, ToNode
A rule-set parameter, representing a value usable in conditions and rules.
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Parameter.Builder
builder()
Builder to create aParameter
instance.boolean
static Parameter
fromNode
(StringNode name, ObjectNode objectNode) Creates aParameter
instance from the given Node information.Gets the built-in parameter name.Gets the parameter's default value.Gets the deprecated status.Gets the documentation value.getName()
Gets the parameter name.Gets the source location of a value.Gets the parameter in template form.getType()
Gets the documentation value.getValue()
Gets the parameter's value.int
hashCode()
boolean
Gets if the parameter uses a built-in parameter.boolean
Gets if the parameter is required or not.template()
Converts this expression to a string template.Take this object and create a builder that contains all of the current property values of this object.Convert this into a condition builder for compositional use.Convert this into an expression.toNode()
Converts a value to aNode
.toString()
toType()
Gets aType
for the parameter's type.Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
booleanEqual, getAttr, getAttr, isSet, isValidHostLabel, not, parseUrl, stringEqual, substring
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition, toCondition
-
Field Details
-
TYPE
- See Also:
-
DEPRECATED
- See Also:
-
DOCUMENTATION
- See Also:
-
DEFAULT
- See Also:
-
-
Method Details
-
fromNode
Creates aParameter
instance from the given Node information.- Parameters:
name
- the name of the parameter being deserialized.objectNode
- the node to deserialize.- Returns:
- the created Parameter.
- Throws:
RuleError
-
builder
Builder to create aParameter
instance.- Returns:
- returns a new Builder.
-
getSourceLocation
Description copied from interface:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in interfaceFromSourceLocation
- Returns:
- Returns the source location of the value.
-
getName
Gets the parameter name.- Returns:
- returns the parameter name as an
Identifier
.
-
getTemplate
Gets the parameter in template form.- Returns:
- returns the template form of the parameter.
-
template
Description copied from class:SyntaxElement
Converts this expression to a string template. By default, this implementation returns aRuntimeException
.- Overrides:
template
in classSyntaxElement
- Returns:
- the String template.
-
isRequired
public boolean isRequired()Gets if the parameter is required or not.- Returns:
- true if the parameter is required, false otherwise.
-
getType
Gets the documentation value.- Returns:
- returns the optional documentation value.
-
toType
Gets aType
for the parameter's type.- Returns:
- a Type for the parameter.
-
getBuiltIn
Gets the built-in parameter name.- Returns:
- returns the optional built-in parameter name.
-
isBuiltIn
public boolean isBuiltIn()Gets if the parameter uses a built-in parameter.- Returns:
- returns true if the parameter uses a built-in, false otherwise.
-
getDeprecated
Gets the deprecated status.- Returns:
- returns the optional deprecated state.
-
getValue
Gets the parameter's value.- Returns:
- returns the optional value.
-
getDocumentation
Gets the documentation value.- Returns:
- returns the optional documentation value.
-
getDefault
Gets the parameter's default value.- Returns:
- returns the optional default value.
-
toConditionBuilder
Description copied from interface:ToCondition
Convert this into a condition builder for compositional use.- Specified by:
toConditionBuilder
in interfaceToCondition
- Returns:
- the condition builder.
-
toExpression
Description copied from interface:ToExpression
Convert this into an expression.- Specified by:
toExpression
in interfaceToExpression
- Returns:
- the expression.
-
toBuilder
Description copied from interface:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<Parameter>
- Returns:
- a builder for type T
-
toNode
Description copied from interface:ToNode
Converts a value to aNode
. -
equals
-
hashCode
public int hashCode() -
toString
-