Class ImmutableLifecycle.Builder
- java.lang.Object
-
- com.sap.cloudfoundry.client.facade.domain.ImmutableLifecycle.Builder
-
- Enclosing class:
- ImmutableLifecycle
public static final class ImmutableLifecycle.Builder extends Object
Builds instances of typeImmutableLifecycle. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableLifecyclebuild()Builds a newImmutableLifecycle.ImmutableLifecycle.Builderdata(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for thedatamap.ImmutableLifecycle.Builderfrom(Lifecycle instance)Fill a builder with attribute values from the providedLifecycleinstance.ImmutableLifecycle.BuilderputAllData(Map<String,? extends Object> entries)Put all mappings from the specified map as entries todatamap.ImmutableLifecycle.BuilderputData(String key, Object value)Put one entry to thedatamap.ImmutableLifecycle.BuilderputData(Map.Entry<String,? extends Object> entry)Put one entry to thedatamap.ImmutableLifecycle.Buildertype(LifecycleType type)Initializes the value for thetypeattribute.
-
-
-
Method Detail
-
from
public final ImmutableLifecycle.Builder from(Lifecycle instance)
Fill a builder with attribute values from the providedLifecycleinstance. 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.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
type
public final ImmutableLifecycle.Builder type(LifecycleType type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
putData
public final ImmutableLifecycle.Builder putData(String key, Object value)
Put one entry to thedatamap.- Parameters:
key- The key in the data mapvalue- The associated value in the data map- Returns:
thisbuilder for use in a chained invocation
-
putData
public final ImmutableLifecycle.Builder putData(Map.Entry<String,? extends Object> entry)
Put one entry to thedatamap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
data
public final ImmutableLifecycle.Builder data(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for thedatamap. Nulls are not permitted as keys or values, but parameter itself can be null- Parameters:
entries- The entries that will be added to the data map- Returns:
thisbuilder for use in a chained invocation
-
putAllData
public final ImmutableLifecycle.Builder putAllData(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries todatamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the data map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableLifecycle build()
Builds a newImmutableLifecycle.- Returns:
- An immutable instance of Lifecycle
- Throws:
IllegalStateException- if any required attributes are missing
-
-