Package com.telenordigital.nbiot
Class ImmutableBroadcastResult
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableBroadcastResult
-
- All Implemented Interfaces:
BroadcastResult
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableBroadcastResult extends Object implements BroadcastResult
Immutable implementation ofBroadcastResult.Use the builder to create immutable instances:
new ImmutableBroadcastResult.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableBroadcastResult.BuilderBuilds instances of typeImmutableBroadcastResult.-
Nested classes/interfaces inherited from interface com.telenordigital.nbiot.BroadcastResult
BroadcastResult.Error
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableBroadcastResultcopyOf(BroadcastResult instance)Creates an immutable copy of aBroadcastResultvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableBroadcastResultthat have equal attribute values.BroadcastResult.Error[]errors()Any errors.intfailed()The number of failed messages.inthashCode()Computes a hash code from attributes:sent,failed,errors.intsent()The number of sent messages.StringtoString()Prints the immutable valueBroadcastResultwith attribute values.ImmutableBroadcastResultwithErrors(BroadcastResult.Error... elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableBroadcastResultwithFailed(int value)Copy the current immutable object by setting a value for thefailedattribute.ImmutableBroadcastResultwithSent(int value)Copy the current immutable object by setting a value for thesentattribute.
-
-
-
Method Detail
-
sent
public int sent()
The number of sent messages.- Specified by:
sentin interfaceBroadcastResult
-
failed
public int failed()
The number of failed messages.- Specified by:
failedin interfaceBroadcastResult
-
errors
public BroadcastResult.Error[] errors()
Any errors.- Specified by:
errorsin interfaceBroadcastResult
-
withSent
public final ImmutableBroadcastResult withSent(int value)
Copy the current immutable object by setting a value for thesentattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sent- Returns:
- A modified copy of the
thisobject
-
withFailed
public final ImmutableBroadcastResult withFailed(int value)
Copy the current immutable object by setting a value for thefailedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for failed- Returns:
- A modified copy of the
thisobject
-
withErrors
public final ImmutableBroadcastResult withErrors(BroadcastResult.Error... elements)
Copy the current immutable object with elements that replace the content oferrors. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for errors- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableBroadcastResultthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sent,failed,errors.
-
toString
public String toString()
Prints the immutable valueBroadcastResultwith attribute values.
-
copyOf
public static ImmutableBroadcastResult copyOf(BroadcastResult instance)
Creates an immutable copy of aBroadcastResultvalue. 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 BroadcastResult instance
-
-