Package com.telenordigital.nbiot
Class ImmutableOutputLogEntry
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableOutputLogEntry
-
- All Implemented Interfaces:
OutputLogEntry
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableOutputLogEntry extends Object implements OutputLogEntry
Immutable implementation ofOutputLogEntry.Use the builder to create immutable instances:
new ImmutableOutputLogEntry.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableOutputLogEntry.BuilderBuilds instances of typeImmutableOutputLogEntry.-
Nested classes/interfaces inherited from interface com.telenordigital.nbiot.OutputLogEntry
OutputLogEntry.OutputLog
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableOutputLogEntrycopyOf(OutputLogEntry instance)Creates an immutable copy of aOutputLogEntryvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableOutputLogEntrythat have equal attribute values.inthashCode()Computes a hash code from attributes:message,timestamp,repeated.Stringmessage()The log message.intrepeated()The number of times the entry was repeated.longtimestamp()The time the entry was received, in milliseconds since Unix epoch.StringtoString()Prints the immutable valueOutputLogEntrywith attribute values.ImmutableOutputLogEntrywithMessage(String value)Copy the current immutable object by setting a value for themessageattribute.ImmutableOutputLogEntrywithRepeated(int value)Copy the current immutable object by setting a value for therepeatedattribute.ImmutableOutputLogEntrywithTimestamp(long value)Copy the current immutable object by setting a value for thetimestampattribute.
-
-
-
Method Detail
-
message
public String message()
The log message.- Specified by:
messagein interfaceOutputLogEntry
-
timestamp
public long timestamp()
The time the entry was received, in milliseconds since Unix epoch.- Specified by:
timestampin interfaceOutputLogEntry
-
repeated
public int repeated()
The number of times the entry was repeated.- Specified by:
repeatedin interfaceOutputLogEntry
-
withMessage
public final ImmutableOutputLogEntry withMessage(String value)
Copy the current immutable object by setting a value for themessageattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for message- Returns:
- A modified copy of the
thisobject
-
withTimestamp
public final ImmutableOutputLogEntry withTimestamp(long value)
Copy the current immutable object by setting a value for thetimestampattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for timestamp- Returns:
- A modified copy of the
thisobject
-
withRepeated
public final ImmutableOutputLogEntry withRepeated(int value)
Copy the current immutable object by setting a value for therepeatedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for repeated- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableOutputLogEntrythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:message,timestamp,repeated.
-
toString
public String toString()
Prints the immutable valueOutputLogEntrywith attribute values.
-
copyOf
public static ImmutableOutputLogEntry copyOf(OutputLogEntry instance)
Creates an immutable copy of aOutputLogEntryvalue. 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 OutputLogEntry instance
-
-