Package com.telenordigital.nbiot
Class ImmutableOutputStatus
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableOutputStatus
-
- All Implemented Interfaces:
OutputStatus
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableOutputStatus extends Object implements OutputStatus
Immutable implementation ofOutputStatus.Use the builder to create immutable instances:
new ImmutableOutputStatus.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableOutputStatus.BuilderBuilds instances of typeImmutableOutputStatus.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableOutputStatuscopyOf(OutputStatus instance)Creates an immutable copy of aOutputStatusvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableOutputStatusthat have equal attribute values.interrorCount()The number of errors.intforwarded()The number of messages forwarded.inthashCode()Computes a hash code from attributes:errorCount,forwarded,received,retries.intreceived()The number of messages received.intretries()The number of messages retransmitted.StringtoString()Prints the immutable valueOutputStatuswith attribute values.ImmutableOutputStatuswithErrorCount(int value)Copy the current immutable object by setting a value for theerrorCountattribute.ImmutableOutputStatuswithForwarded(int value)Copy the current immutable object by setting a value for theforwardedattribute.ImmutableOutputStatuswithReceived(int value)Copy the current immutable object by setting a value for thereceivedattribute.ImmutableOutputStatuswithRetries(int value)Copy the current immutable object by setting a value for theretriesattribute.
-
-
-
Method Detail
-
errorCount
public int errorCount()
The number of errors.- Specified by:
errorCountin interfaceOutputStatus
-
forwarded
public int forwarded()
The number of messages forwarded.- Specified by:
forwardedin interfaceOutputStatus
-
received
public int received()
The number of messages received.- Specified by:
receivedin interfaceOutputStatus
-
retries
public int retries()
The number of messages retransmitted.- Specified by:
retriesin interfaceOutputStatus
-
withErrorCount
public final ImmutableOutputStatus withErrorCount(int value)
Copy the current immutable object by setting a value for theerrorCountattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for errorCount- Returns:
- A modified copy of the
thisobject
-
withForwarded
public final ImmutableOutputStatus withForwarded(int value)
Copy the current immutable object by setting a value for theforwardedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for forwarded- Returns:
- A modified copy of the
thisobject
-
withReceived
public final ImmutableOutputStatus withReceived(int value)
Copy the current immutable object by setting a value for thereceivedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for received- Returns:
- A modified copy of the
thisobject
-
withRetries
public final ImmutableOutputStatus withRetries(int value)
Copy the current immutable object by setting a value for theretriesattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for retries- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableOutputStatusthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:errorCount,forwarded,received,retries.
-
toString
public String toString()
Prints the immutable valueOutputStatuswith attribute values.
-
copyOf
public static ImmutableOutputStatus copyOf(OutputStatus instance)
Creates an immutable copy of aOutputStatusvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable OutputStatus instance
-
-