Package com.telenordigital.nbiot
Class ImmutableOutputList
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableOutputList
-
- All Implemented Interfaces:
Output.OutputList
@ParametersAreNonnullByDefault @Immutable public final class ImmutableOutputList extends Object implements Output.OutputList
Immutable implementation ofOutput.OutputList.Use the builder to create immutable instances:
new ImmutableOutputList.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableOutputList.BuilderBuilds instances of typeImmutableOutputList.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableOutputListcopyOf(Output.OutputList instance)Creates an immutable copy of aOutput.OutputListvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableOutputListthat have equal attribute values.inthashCode()Computes a hash code from attributes:outputs.Output[]outputs()StringtoString()Prints the immutable valueOutputListwith attribute values.ImmutableOutputListwithOutputs(Output... elements)Copy the current immutable object with elements that replace the content ofoutputs.
-
-
-
Method Detail
-
outputs
@Nullable public Output[] outputs()
- Specified by:
outputsin interfaceOutput.OutputList- Returns:
- A cloned
outputsarray
-
withOutputs
public final ImmutableOutputList withOutputs(@Nullable Output... elements)
Copy the current immutable object with elements that replace the content ofoutputs. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for outputs- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableOutputListthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:outputs.
-
toString
public String toString()
Prints the immutable valueOutputListwith attribute values.
-
copyOf
public static ImmutableOutputList copyOf(Output.OutputList instance)
Creates an immutable copy of aOutput.OutputListvalue. 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 OutputList instance
-
-