public static final class SecurityGroup.Builder extends Object
SecurityGroup
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
Modifier and Type | Method and Description |
---|---|
SecurityGroup.Builder |
addAllRules(Iterable<? extends Rule> elements)
Adds elements to
rules list. |
SecurityGroup |
build()
Builds a new
SecurityGroup . |
SecurityGroup.Builder |
from(SecurityGroup instance)
Fill a builder with attribute values from the provided
SecurityGroup instance. |
SecurityGroup.Builder |
name(String name)
Initializes the value for the
name attribute. |
SecurityGroup.Builder |
rule(Rule... elements)
Adds elements to
rules list. |
SecurityGroup.Builder |
rule(Rule element)
Adds one element to
rules list. |
SecurityGroup.Builder |
rules(Iterable<? extends Rule> elements)
Sets or replaces all elements for
rules list. |
public final SecurityGroup.Builder from(SecurityGroup instance)
SecurityGroup
instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance
- The instance from which to copy valuesthis
builder for use in a chained invocationpublic final SecurityGroup.Builder name(String name)
name
attribute.name
- The value for namethis
builder for use in a chained invocationpublic final SecurityGroup.Builder rule(Rule element)
rules
list.element
- A rules elementthis
builder for use in a chained invocationpublic final SecurityGroup.Builder rule(Rule... elements)
rules
list.elements
- An array of rules elementsthis
builder for use in a chained invocationpublic final SecurityGroup.Builder rules(Iterable<? extends Rule> elements)
rules
list.elements
- An iterable of rules elementsthis
builder for use in a chained invocationpublic final SecurityGroup.Builder addAllRules(Iterable<? extends Rule> elements)
rules
list.elements
- An iterable of rules elementsthis
builder for use in a chained invocationpublic SecurityGroup build()
SecurityGroup
.IllegalStateException
- if any required attributes are missingCopyright © 2016 Pivotal Software, Inc.. All rights reserved.