Package io.resys.thena.api.envelope
Class ImmutableMessage
java.lang.Object
io.resys.thena.api.envelope.ImmutableMessage
- All Implemented Interfaces:
Message
@Generated(from="Message",
generator="Immutables")
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMessage
extends Object
implements Message
Immutable implementation of
Message.
Use the builder to create immutable instances:
ImmutableMessage.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableMessage.Builderbuilder()Creates a builder forImmutableMessage.static ImmutableMessageCreates an immutable copy of aMessagevalue.booleanThis instance is equal to all instances ofImmutableMessagethat have equal attribute values.getText()inthashCode()Computes a hash code from attributes:text,exception.toString()Prints the immutable valueMessagewith attribute values.final ImmutableMessagewithException(Throwable value) Copy the current immutable object by setting a value for theexceptionattribute.final ImmutableMessageCopy the current immutable object by setting a value for thetextattribute.
-
Method Details
-
getText
-
getException
- Specified by:
getExceptionin interfaceMessage- Returns:
- The value of the
exceptionattribute
-
withText
Copy the current immutable object by setting a value for thetextattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for text- Returns:
- A modified copy or the
thisobject
-
withException
Copy the current immutable object by setting a value for theexceptionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for exception (can benull)- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableMessagethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:text,exception. -
toString
Prints the immutable valueMessagewith attribute values. -
copyOf
Creates an immutable copy of aMessagevalue. 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 Message instance
-
builder
Creates a builder forImmutableMessage.ImmutableMessage.builder() .text(String) // requiredtext.exception(Throwable | null) // nullableexception.build();- Returns:
- A new ImmutableMessage builder
-