Package com.telenordigital.nbiot
Class ImmutableInvite.Builder
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableInvite.Builder
-
- Enclosing class:
- ImmutableInvite
@NotThreadSafe public static final class ImmutableInvite.Builder extends Object
Builds instances of typeImmutableInvite. 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.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder forImmutableInviteinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableInvitebuild()Builds a newImmutableInvite.ImmutableInvite.Buildercode(String code)Initializes the value for thecodeattribute.ImmutableInvite.BuildercreatedAt(long createdAt)Initializes the value for thecreatedAtattribute.ImmutableInvite.Builderfrom(Invite instance)Fill a builder with attribute values from the providedInviteinstance.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableInviteinstances.new ImmutableInvite.Builder() .code(String | null) // nullablecode.createdAt(long) // requiredcreatedAt.build();
-
-
Method Detail
-
from
public final ImmutableInvite.Builder from(Invite instance)
Fill a builder with attribute values from the providedInviteinstance. 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
-
code
public final ImmutableInvite.Builder code(@Nullable String code)
Initializes the value for thecodeattribute.- Parameters:
code- The value for code (can benull)- Returns:
thisbuilder for use in a chained invocation
-
createdAt
public final ImmutableInvite.Builder createdAt(long createdAt)
Initializes the value for thecreatedAtattribute.- Parameters:
createdAt- The value for createdAt- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableInvite build()
Builds a newImmutableInvite.- Returns:
- An immutable instance of Invite
- Throws:
IllegalStateException- if any required attributes are missing
-
-