Class Parameters
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.syntax.parameters.Parameters
-
- All Implemented Interfaces:
java.lang.Iterable<Parameter>,FromSourceLocation,ToNode,ToSmithyBuilder<Parameters>
public final class Parameters extends java.lang.Object implements FromSourceLocation, ToNode, ToSmithyBuilder<Parameters>, java.lang.Iterable<Parameter>
An iterable container forParameters defined in a rule-set.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameters.BuilderA builder used to create aParametersclass.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Parameters.Builderbuilder()Builder to create aParametersinstance.booleanequals(java.lang.Object o)voidforEach(java.util.function.Consumer<? super Parameter> action)static ParametersfromNode(ObjectNode node)Creates aParametersinstance from the given Node information.java.util.Optional<Parameter>get(Identifier name)Gets the parameter for the given name.SourceLocationgetSourceLocation()Gets the source location of a value.inthashCode()java.util.Iterator<Parameter>iterator()java.util.Spliterator<Parameter>spliterator()Parameters.BuildertoBuilder()Take this object and create a builder that contains all of the current property values of this object.NodetoNode()Converts a value to aNode.java.lang.StringtoString()voidwriteToScope(Scope<Type> scope)Writes the parameters in this collection to the given scope.
-
-
-
Method Detail
-
builder
public static Parameters.Builder builder()
Builder to create aParametersinstance.- Returns:
- returns a new Builder.
-
fromNode
public static Parameters fromNode(ObjectNode node) throws RuleError
Creates aParametersinstance from the given Node information.- Parameters:
node- the node to deserialize.- Returns:
- the created Parameters.
- Throws:
RuleError
-
writeToScope
public void writeToScope(Scope<Type> scope)
Writes the parameters in this collection to the given scope.- Parameters:
scope- the scope
-
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.
-
get
public java.util.Optional<Parameter> get(Identifier name)
Gets the parameter for the given name.- Returns:
- returns an optional containing the parameter if present, empty otherwise.
-
toBuilder
public Parameters.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<Parameters>- Returns:
- a builder for type T
-
iterator
public java.util.Iterator<Parameter> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Parameter>
-
forEach
public void forEach(java.util.function.Consumer<? super Parameter> action)
- Specified by:
forEachin interfacejava.lang.Iterable<Parameter>
-
spliterator
public java.util.Spliterator<Parameter> spliterator()
- Specified by:
spliteratorin interfacejava.lang.Iterable<Parameter>
-
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
-
-