Package com.telenordigital.nbiot
Class ImmutableOutputLogEntry.Builder
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableOutputLogEntry.Builder
-
- Enclosing class:
- ImmutableOutputLogEntry
@NotThreadSafe public static final class ImmutableOutputLogEntry.Builder extends Object
Builds instances of typeImmutableOutputLogEntry. 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 forImmutableOutputLogEntryinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableOutputLogEntrybuild()Builds a newImmutableOutputLogEntry.ImmutableOutputLogEntry.Builderfrom(OutputLogEntry instance)Fill a builder with attribute values from the providedOutputLogEntryinstance.ImmutableOutputLogEntry.Buildermessage(String message)Initializes the value for themessageattribute.ImmutableOutputLogEntry.Builderrepeated(int repeated)Initializes the value for therepeatedattribute.ImmutableOutputLogEntry.Buildertimestamp(long timestamp)Initializes the value for thetimestampattribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableOutputLogEntryinstances.new ImmutableOutputLogEntry.Builder() .message(String) // requiredmessage.timestamp(long) // requiredtimestamp.repeated(int) // requiredrepeated.build();
-
-
Method Detail
-
from
public final ImmutableOutputLogEntry.Builder from(OutputLogEntry instance)
Fill a builder with attribute values from the providedOutputLogEntryinstance. 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
-
message
public final ImmutableOutputLogEntry.Builder message(String message)
Initializes the value for themessageattribute.- Parameters:
message- The value for message- Returns:
thisbuilder for use in a chained invocation
-
timestamp
public final ImmutableOutputLogEntry.Builder timestamp(long timestamp)
Initializes the value for thetimestampattribute.- Parameters:
timestamp- The value for timestamp- Returns:
thisbuilder for use in a chained invocation
-
repeated
public final ImmutableOutputLogEntry.Builder repeated(int repeated)
Initializes the value for therepeatedattribute.- Parameters:
repeated- The value for repeated- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableOutputLogEntry build()
Builds a newImmutableOutputLogEntry.- Returns:
- An immutable instance of OutputLogEntry
- Throws:
IllegalStateException- if any required attributes are missing
-
-