Class ImmutableMessage
- java.lang.Object
-
- io.thestencil.staticontent.spi.visitor.ImmutableMessage
-
- All Implemented Interfaces:
SiteVisitor.Message
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMessage extends Object implements SiteVisitor.Message
Immutable implementation ofSiteVisitor.Message.Use the builder to create immutable instances:
ImmutableMessage.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableMessage.BuilderBuilds instances of typeImmutableMessage.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMessage.Builderbuilder()Creates a builder forImmutableMessage.static ImmutableMessagecopyOf(SiteVisitor.Message instance)Creates an immutable copy of aSiteVisitor.Messagevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMessagethat have equal attribute values.ObjectgetObject()StringgetText()inthashCode()Computes a hash code from attributes:text,object.StringtoString()Prints the immutable valueMessagewith attribute values.ImmutableMessagewithObject(Object value)Copy the current immutable object by setting a value for theobjectattribute.ImmutableMessagewithText(String value)Copy the current immutable object by setting a value for thetextattribute.
-
-
-
Method Detail
-
getText
public String getText()
- Specified by:
getTextin interfaceSiteVisitor.Message- Returns:
- The value of the
textattribute
-
getObject
@Nullable public Object getObject()
- Specified by:
getObjectin interfaceSiteVisitor.Message- Returns:
- The value of the
objectattribute
-
withText
public final ImmutableMessage withText(String value)
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 of the
thisobject
-
withObject
public final ImmutableMessage withObject(@Nullable Object value)
Copy the current immutable object by setting a value for theobjectattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for object (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMessagethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:text,object.
-
toString
public String toString()
Prints the immutable valueMessagewith attribute values.
-
copyOf
public static ImmutableMessage copyOf(SiteVisitor.Message instance)
Creates an immutable copy of aSiteVisitor.Messagevalue. 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
public static ImmutableMessage.Builder builder()
Creates a builder forImmutableMessage.ImmutableMessage.builder() .text(String) // requiredtext.object(Object | null) // nullableobject.build();- Returns:
- A new ImmutableMessage builder
-
-