Package com.telenordigital.nbiot
Class ImmutableOutputStatus.Builder
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableOutputStatus.Builder
-
- Enclosing class:
- ImmutableOutputStatus
@NotThreadSafe public static final class ImmutableOutputStatus.Builder extends Object
Builds instances of typeImmutableOutputStatus. 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 forImmutableOutputStatusinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableOutputStatusbuild()Builds a newImmutableOutputStatus.ImmutableOutputStatus.BuildererrorCount(int errorCount)Initializes the value for theerrorCountattribute.ImmutableOutputStatus.Builderforwarded(int forwarded)Initializes the value for theforwardedattribute.ImmutableOutputStatus.Builderfrom(OutputStatus instance)Fill a builder with attribute values from the providedOutputStatusinstance.ImmutableOutputStatus.Builderreceived(int received)Initializes the value for thereceivedattribute.ImmutableOutputStatus.Builderretries(int retries)Initializes the value for theretriesattribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableOutputStatusinstances.new ImmutableOutputStatus.Builder() .errorCount(int) // requirederrorCount.forwarded(int) // requiredforwarded.received(int) // requiredreceived.retries(int) // requiredretries.build();
-
-
Method Detail
-
from
public final ImmutableOutputStatus.Builder from(OutputStatus instance)
Fill a builder with attribute values from the providedOutputStatusinstance. 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
-
errorCount
public final ImmutableOutputStatus.Builder errorCount(int errorCount)
Initializes the value for theerrorCountattribute.- Parameters:
errorCount- The value for errorCount- Returns:
thisbuilder for use in a chained invocation
-
forwarded
public final ImmutableOutputStatus.Builder forwarded(int forwarded)
Initializes the value for theforwardedattribute.- Parameters:
forwarded- The value for forwarded- Returns:
thisbuilder for use in a chained invocation
-
received
public final ImmutableOutputStatus.Builder received(int received)
Initializes the value for thereceivedattribute.- Parameters:
received- The value for received- Returns:
thisbuilder for use in a chained invocation
-
retries
public final ImmutableOutputStatus.Builder retries(int retries)
Initializes the value for theretriesattribute.- Parameters:
retries- The value for retries- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableOutputStatus build()
Builds a newImmutableOutputStatus.- Returns:
- An immutable instance of OutputStatus
- Throws:
IllegalStateException- if any required attributes are missing
-
-