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 forParameter
s defined in a rule-set.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Parameters.Builder
A builder used to create aParameters
class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Parameters.Builder
builder()
Builder to create aParameters
instance.boolean
equals(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super Parameter> action)
static Parameters
fromNode(ObjectNode node)
Creates aParameters
instance from the given Node information.java.util.Optional<Parameter>
get(Identifier name)
Gets the parameter for the given name.SourceLocation
getSourceLocation()
Gets the source location of a value.int
hashCode()
java.util.Iterator<Parameter>
iterator()
java.util.Spliterator<Parameter>
spliterator()
Parameters.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.Node
toNode()
Converts a value to aNode
.java.lang.String
toString()
void
writeToScope(Scope<Type> scope)
Writes the parameters in this collection to the given scope.
-
-
-
Method Detail
-
builder
public static Parameters.Builder builder()
Builder to create aParameters
instance.- Returns:
- returns a new Builder.
-
fromNode
public static Parameters fromNode(ObjectNode node) throws RuleError
Creates aParameters
instance 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:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in 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:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<Parameters>
- Returns:
- a builder for type T
-
iterator
public java.util.Iterator<Parameter> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<Parameter>
-
forEach
public void forEach(java.util.function.Consumer<? super Parameter> action)
- Specified by:
forEach
in interfacejava.lang.Iterable<Parameter>
-
spliterator
public java.util.Spliterator<Parameter> spliterator()
- Specified by:
spliterator
in interfacejava.lang.Iterable<Parameter>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-