Class ImmutableEvent
java.lang.Object
org.kiwiproject.consul.model.event.Event
org.kiwiproject.consul.model.event.ImmutableEvent
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableEvent
extends Event
Immutable implementation of
Event.
Use the builder to create immutable instances:
ImmutableEvent.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableEvent.Builderbuilder()Creates a builder forImmutableEvent.static ImmutableEventCreates an immutable copy of aEventvalue.booleanThis instance is equal to all instances ofImmutableEventthat have equal attribute values.getId()getLTime()getName()intinthashCode()Computes a hash code from attributes:id,name,payload,nodeFilter,serviceFilter,tagFilter,version,lTime.toString()Prints the immutable valueEventwith attribute values.final ImmutableEventCopy the current immutable object by setting a value for theidattribute.final ImmutableEventCopy the current immutable object by setting a value for thelTimeattribute.final ImmutableEventCopy the current immutable object by setting a value for thenameattribute.final ImmutableEventwithNodeFilter(String value) Copy the current immutable object by setting a present value for the optionalnodeFilterattribute.final ImmutableEventwithNodeFilter(Optional<String> optional) Copy the current immutable object by setting an optional value for thenodeFilterattribute.final ImmutableEventwithPayload(String value) Copy the current immutable object by setting a present value for the optionalpayloadattribute.final ImmutableEventwithPayload(Optional<String> optional) Copy the current immutable object by setting an optional value for thepayloadattribute.final ImmutableEventwithServiceFilter(String value) Copy the current immutable object by setting a present value for the optionalserviceFilterattribute.final ImmutableEventwithServiceFilter(Optional<String> optional) Copy the current immutable object by setting an optional value for theserviceFilterattribute.final ImmutableEventwithTagFilter(String value) Copy the current immutable object by setting a present value for the optionaltagFilterattribute.final ImmutableEventwithTagFilter(Optional<String> optional) Copy the current immutable object by setting an optional value for thetagFilterattribute.final ImmutableEventwithVersion(int value) Copy the current immutable object by setting a value for theversionattribute.
-
Method Details
-
getId
-
getName
-
getPayload
- Specified by:
getPayloadin classEvent- Returns:
- The value of the
payloadattribute
-
getNodeFilter
- Specified by:
getNodeFilterin classEvent- Returns:
- The value of the
nodeFilterattribute
-
getServiceFilter
- Specified by:
getServiceFilterin classEvent- Returns:
- The value of the
serviceFilterattribute
-
getTagFilter
- Specified by:
getTagFilterin classEvent- Returns:
- The value of the
tagFilterattribute
-
getVersion
public int getVersion()- Specified by:
getVersionin classEvent- Returns:
- The value of the
versionattribute
-
getLTime
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withPayload
Copy the current immutable object by setting a present value for the optionalpayloadattribute.- Parameters:
value- The value for payload- Returns:
- A modified copy of
thisobject
-
withPayload
Copy the current immutable object by setting an optional value for thepayloadattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for payload- Returns:
- A modified copy of
thisobject
-
withNodeFilter
Copy the current immutable object by setting a present value for the optionalnodeFilterattribute.- Parameters:
value- The value for nodeFilter- Returns:
- A modified copy of
thisobject
-
withNodeFilter
Copy the current immutable object by setting an optional value for thenodeFilterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for nodeFilter- Returns:
- A modified copy of
thisobject
-
withServiceFilter
Copy the current immutable object by setting a present value for the optionalserviceFilterattribute.- Parameters:
value- The value for serviceFilter- Returns:
- A modified copy of
thisobject
-
withServiceFilter
Copy the current immutable object by setting an optional value for theserviceFilterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for serviceFilter- Returns:
- A modified copy of
thisobject
-
withTagFilter
Copy the current immutable object by setting a present value for the optionaltagFilterattribute.- Parameters:
value- The value for tagFilter- Returns:
- A modified copy of
thisobject
-
withTagFilter
Copy the current immutable object by setting an optional value for thetagFilterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for tagFilter- Returns:
- A modified copy of
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withLTime
Copy the current immutable object by setting a value for thelTimeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for lTime- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableEventthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:id,name,payload,nodeFilter,serviceFilter,tagFilter,version,lTime. -
toString
Prints the immutable valueEventwith attribute values. -
copyOf
Creates an immutable copy of aEventvalue. 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 Event instance
-
builder
Creates a builder forImmutableEvent.ImmutableEvent.builder() .id(String) // requiredid.name(String) // requiredname.payload(String) // optionalpayload.nodeFilter(String) // optionalnodeFilter.serviceFilter(String) // optionalserviceFilter.tagFilter(String) // optionaltagFilter.version(int) // requiredversion.lTime(Long) // requiredlTime.build();- Returns:
- A new ImmutableEvent builder
-