Package io.dialob.client.api
Class ImmutableBodySource.Builder
- java.lang.Object
-
- io.dialob.client.api.ImmutableBodySource.Builder
-
- Enclosing class:
- ImmutableBodySource
@NotThreadSafe public static final class ImmutableBodySource.Builder extends Object
Builds instances of typeImmutableBodySource. 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 ImmutableBodySource.BuilderbodyType(DialobStore.BodyType bodyType)Initializes the value for thebodyTypeattribute.ImmutableBodySourcebuild()Builds a newImmutableBodySource.ImmutableBodySource.Builderfrom(DialobStore.BodySource instance)Fill a builder with attribute values from the providedBodySourceinstance.ImmutableBodySource.Builderhash(String hash)Initializes the value for thehashattribute.ImmutableBodySource.Builderid(String id)Initializes the value for theidattribute.ImmutableBodySource.Buildervalue(String value)Initializes the value for thevalueattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableBodySource.Builder from(DialobStore.BodySource instance)
Fill a builder with attribute values from the providedBodySourceinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableBodySource.Builder id(String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
hash
@CanIgnoreReturnValue public final ImmutableBodySource.Builder hash(String hash)
Initializes the value for thehashattribute.- Parameters:
hash- The value for hash- Returns:
thisbuilder for use in a chained invocation
-
bodyType
@CanIgnoreReturnValue public final ImmutableBodySource.Builder bodyType(DialobStore.BodyType bodyType)
Initializes the value for thebodyTypeattribute.- Parameters:
bodyType- The value for bodyType- Returns:
thisbuilder for use in a chained invocation
-
value
@CanIgnoreReturnValue public final ImmutableBodySource.Builder value(String value)
Initializes the value for thevalueattribute.- Parameters:
value- The value for value- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableBodySource build()
Builds a newImmutableBodySource.- Returns:
- An immutable instance of BodySource
- Throws:
IllegalStateException- if any required attributes are missing
-
-