Class Parameter
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter
-
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToSmithyBuilder<Parameter>
public final class Parameter extends java.lang.Object implements ToSmithyBuilder<Parameter>, FromSourceLocation, ToNode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameter.Builderstatic classParameter.Deprecated
-
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()Functionequal(boolean b)Provides a function comparing this parameter to a boolean value.Functionequal(Expression expression)Provides a function comparing this parameter to expression.booleanequals(java.lang.Object o)static ParameterfromNode(StringNode name, ObjectNode node)java.util.Optional<java.lang.String>getBuiltIn()java.util.Optional<Value>getDefault()The default value for this Parameter.java.util.Optional<Value>getDefaultValue()java.util.Optional<Parameter.Deprecated>getDeprecated()java.util.Optional<java.lang.String>getDocumentation()IdentifiergetName()SourceLocationgetSourceLocation()Gets the source location of a value.ParameterTypegetType()java.util.Optional<Value>getValue()inthashCode()booleanisBuiltIn()booleanisRequired()java.lang.Stringtemplate()Parameter.BuildertoBuilder()Take this object and create a builder that contains all of the current property values of this object.ExpressiontoExpression()Provides a reference to this parameter as an expression.NodetoNode()Converts a value to aNode.java.lang.StringtoString()TypetoType()
-
-
-
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 node) throws RuleError
- Throws:
RuleError
-
builder
public static Parameter.Builder builder()
-
getBuiltIn
public java.util.Optional<java.lang.String> getBuiltIn()
-
getDefaultValue
public java.util.Optional<Value> getDefaultValue()
-
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.
-
getDeprecated
public java.util.Optional<Parameter.Deprecated> getDeprecated()
-
isRequired
public boolean isRequired()
-
getType
public ParameterType getType()
-
toType
public Type toType()
-
getName
public Identifier getName()
-
isBuiltIn
public boolean isBuiltIn()
-
getValue
public java.util.Optional<Value> getValue()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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
-
template
public java.lang.String template()
-
toExpression
public Expression toExpression()
Provides a reference to this parameter as an expression.- Returns:
- the reference to the parameter.
-
equal
public Function equal(boolean b)
Provides a function comparing this parameter to a boolean value.- Parameters:
b- the boolean value to compare the parameter to.- Returns:
- the BooleanEquals function comparing the parameter.
-
equal
public Function equal(Expression expression)
Provides a function comparing this parameter to expression.- Parameters:
expression- the expression.- Returns:
- the BooleanEquals function comparing the parameter.
-
getDocumentation
public java.util.Optional<java.lang.String> getDocumentation()
-
getDefault
public java.util.Optional<Value> getDefault()
The default value for this Parameter.- Returns:
- The value. This value must match the type of this parameter.
-
-