Package com.telenordigital.nbiot
Class ImmutableOutputDataMessage.Builder
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableOutputDataMessage.Builder
-
- Enclosing class:
- ImmutableOutputDataMessage
@NotThreadSafe public static final class ImmutableOutputDataMessage.Builder extends Object
Builds instances of typeImmutableOutputDataMessage. 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 forImmutableOutputDataMessageinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableOutputDataMessagebuild()Builds a newImmutableOutputDataMessage.ImmutableOutputDataMessage.Builderdevice(Device device)Initializes the value for thedeviceattribute.ImmutableOutputDataMessage.Builderfrom(OutputDataMessage instance)Fill a builder with attribute values from the providedOutputDataMessageinstance.ImmutableOutputDataMessage.BuilderkeepAlive(boolean keepAlive)Initializes the value for thekeepAliveattribute.ImmutableOutputDataMessage.Builderpayload(byte... payload)Initializes the value for thepayloadattribute.ImmutableOutputDataMessage.Builderreceived(int received)Initializes the value for thereceivedattribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableOutputDataMessageinstances.
-
-
Method Detail
-
from
public final ImmutableOutputDataMessage.Builder from(OutputDataMessage instance)
Fill a builder with attribute values from the providedOutputDataMessageinstance. 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
-
keepAlive
public final ImmutableOutputDataMessage.Builder keepAlive(boolean keepAlive)
Initializes the value for thekeepAliveattribute.- Parameters:
keepAlive- The value for keepAlive- Returns:
thisbuilder for use in a chained invocation
-
device
public final ImmutableOutputDataMessage.Builder device(@Nullable Device device)
Initializes the value for thedeviceattribute.- Parameters:
device- The value for device (can benull)- Returns:
thisbuilder for use in a chained invocation
-
payload
public final ImmutableOutputDataMessage.Builder payload(byte... payload)
Initializes the value for thepayloadattribute.- Parameters:
payload- The elements for payload- Returns:
thisbuilder for use in a chained invocation
-
received
public final ImmutableOutputDataMessage.Builder received(int received)
Initializes the value for thereceivedattribute.- Parameters:
received- The value for received- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableOutputDataMessage build()
Builds a newImmutableOutputDataMessage.- Returns:
- An immutable instance of OutputDataMessage
- Throws:
IllegalStateException- if any required attributes are missing
-
-