Class EndpointRuleSet.Builder
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.RulesComponentBuilder<EndpointRuleSet.Builder,EndpointRuleSet>
-
- software.amazon.smithy.rulesengine.language.EndpointRuleSet.Builder
-
- All Implemented Interfaces:
FromSourceLocation
,SmithyBuilder<EndpointRuleSet>
- Enclosing class:
- EndpointRuleSet
public static class EndpointRuleSet.Builder extends RulesComponentBuilder<EndpointRuleSet.Builder,EndpointRuleSet>
A builder used to create aEndpointRuleSet
class.
-
-
Constructor Summary
Constructors Constructor Description Builder(FromSourceLocation sourceLocation)
Construct a builder from aSourceLocation
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EndpointRuleSet.Builder
addRule(int index, Rule rule)
Inserts a rule into the ruleset.EndpointRuleSet.Builder
addRule(Rule rule)
Adds a rule to this ruleset.EndpointRuleSet
build()
Creates an immutable object that is created from the properties that have been set on the builder.EndpointRuleSet.Builder
parameters(Parameters parameters)
Set the parameters for thisEndpointRuleSet
.EndpointRuleSet.Builder
rules(java.util.Collection<Rule> rules)
Add rules to this ruleset.EndpointRuleSet.Builder
version(java.lang.String version)
Sets the version for theEndpointRuleSet
.-
Methods inherited from class software.amazon.smithy.rulesengine.language.RulesComponentBuilder
getSourceLocation, javaLocation, sourceLocation
-
-
-
-
Constructor Detail
-
Builder
public Builder(FromSourceLocation sourceLocation)
Construct a builder from aSourceLocation
.- Parameters:
sourceLocation
- The source location
-
-
Method Detail
-
version
public EndpointRuleSet.Builder version(java.lang.String version)
Sets the version for theEndpointRuleSet
. If not set, the version will default to the latest version.- Parameters:
version
- The version to set- Returns:
- the
EndpointRuleSet.Builder
-
addRule
public EndpointRuleSet.Builder addRule(Rule rule)
Adds a rule to this ruleset. The rule be evaluated if all previous rules do not match.- Parameters:
rule
- TheRule
to add- Returns:
- the
EndpointRuleSet.Builder
-
addRule
public EndpointRuleSet.Builder addRule(int index, Rule rule)
Inserts a rule into the ruleset.- Parameters:
index
- the position to add the rule at.rule
- TheRule
to add- Returns:
- the
EndpointRuleSet.Builder
-
rules
public EndpointRuleSet.Builder rules(java.util.Collection<Rule> rules)
Add rules to this ruleset. The rules be evaluated if all previous rules do not match.- Parameters:
rules
- The Collection ofRule
to add- Returns:
- the
EndpointRuleSet.Builder
-
parameters
public EndpointRuleSet.Builder parameters(Parameters parameters)
Set the parameters for thisEndpointRuleSet
.- Parameters:
parameters
-Parameters
to set- Returns:
- the
EndpointRuleSet.Builder
-
build
public EndpointRuleSet build()
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Returns:
- an instance of T
-
-