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
Nested Classes Modifier and Type Class Description static classParameter.BuilderA builder used to create aParameterclass.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULTstatic java.lang.StringDEPRECATEDstatic java.lang.StringDOCUMENTATIONstatic java.lang.StringTYPE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Parameter.Builderbuilder()Builder to create aParameterinstance.booleanequals(java.lang.Object o)static ParameterfromNode(StringNode name, ObjectNode objectNode)Creates aParameterinstance from the given Node information.java.util.Optional<java.lang.String>getBuiltIn()Gets the built-in parameter name.java.util.Optional<Value>getDefault()Gets the parameter's default value.java.util.Optional<Deprecated>getDeprecated()Gets the deprecated status.java.util.Optional<java.lang.String>getDocumentation()Gets the documentation value.IdentifiergetName()Gets the parameter name.SourceLocationgetSourceLocation()Gets the source location of a value.java.lang.StringgetTemplate()Gets the parameter in template form.ParameterTypegetType()Gets the documentation value.java.util.Optional<Value>getValue()Gets the parameter's value.inthashCode()booleanisBuiltIn()Gets if the parameter uses a built-in parameter.booleanisRequired()Gets if the parameter is required or not.java.lang.Stringtemplate()Converts this expression to a string template.Parameter.BuildertoBuilder()Take this object and create a builder that contains all of the current property values of this object.Condition.BuildertoConditionBuilder()Convert this into a condition builder for compositional use.ExpressiontoExpression()Convert this into an expression.NodetoNode()Converts a value to aNode.java.lang.StringtoString()TypetoType()Gets aTypefor 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 Detail
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
DEPRECATED
public static final java.lang.String DEPRECATED
- See Also:
- Constant Field Values
-
DOCUMENTATION
public static final java.lang.String DOCUMENTATION
- See Also:
- Constant Field Values
-
DEFAULT
public static final java.lang.String DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromNode
public static Parameter fromNode(StringNode name, ObjectNode objectNode) throws RuleError
Creates aParameterinstance 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
public static Parameter.Builder builder()
Builder to create aParameterinstance.- Returns:
- returns a new Builder.
-
getSourceLocation
public SourceLocation getSourceLocation()
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
getName
public Identifier getName()
Gets the parameter name.- Returns:
- returns the parameter name as an
Identifier.
-
getTemplate
public java.lang.String getTemplate()
Gets the parameter in template form.- Returns:
- returns the template form of the parameter.
-
template
public java.lang.String template()
Description copied from class:SyntaxElementConverts this expression to a string template. By default, this implementation returns aRuntimeException.- Overrides:
templatein 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
public ParameterType getType()
Gets the documentation value.- Returns:
- returns the optional documentation value.
-
toType
public Type toType()
Gets aTypefor the parameter's type.- Returns:
- a Type for the parameter.
-
getBuiltIn
public java.util.Optional<java.lang.String> 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
public java.util.Optional<Deprecated> getDeprecated()
Gets the deprecated status.- Returns:
- returns the optional deprecated state.
-
getValue
public java.util.Optional<Value> getValue()
Gets the parameter's value.- Returns:
- returns the optional value.
-
getDocumentation
public java.util.Optional<java.lang.String> getDocumentation()
Gets the documentation value.- Returns:
- returns the optional documentation value.
-
getDefault
public java.util.Optional<Value> getDefault()
Gets the parameter's default value.- Returns:
- returns the optional default value.
-
toConditionBuilder
public Condition.Builder toConditionBuilder()
Description copied from interface:ToConditionConvert this into a condition builder for compositional use.- Specified by:
toConditionBuilderin interfaceToCondition- Returns:
- the condition builder.
-
toExpression
public Expression toExpression()
Description copied from interface:ToExpressionConvert this into an expression.- Specified by:
toExpressionin interfaceToExpression- Returns:
- the expression.
-
toBuilder
public Parameter.Builder toBuilder()
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<Parameter>- Returns:
- a builder for type T
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-