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.Builder
builder()
Creates a builder forImmutableEvent
.static ImmutableEvent
Creates an immutable copy of aEvent
value.boolean
This instance is equal to all instances ofImmutableEvent
that have equal attribute values.getId()
getLTime()
getName()
int
int
hashCode()
Computes a hash code from attributes:id
,name
,payload
,nodeFilter
,serviceFilter
,tagFilter
,version
,lTime
.toString()
Prints the immutable valueEvent
with attribute values.final ImmutableEvent
Copy the current immutable object by setting a value for theid
attribute.final ImmutableEvent
Copy the current immutable object by setting a value for thelTime
attribute.final ImmutableEvent
Copy the current immutable object by setting a value for thename
attribute.final ImmutableEvent
withNodeFilter
(String value) Copy the current immutable object by setting a present value for the optionalnodeFilter
attribute.final ImmutableEvent
withNodeFilter
(Optional<String> optional) Copy the current immutable object by setting an optional value for thenodeFilter
attribute.final ImmutableEvent
withPayload
(String value) Copy the current immutable object by setting a present value for the optionalpayload
attribute.final ImmutableEvent
withPayload
(Optional<String> optional) Copy the current immutable object by setting an optional value for thepayload
attribute.final ImmutableEvent
withServiceFilter
(String value) Copy the current immutable object by setting a present value for the optionalserviceFilter
attribute.final ImmutableEvent
withServiceFilter
(Optional<String> optional) Copy the current immutable object by setting an optional value for theserviceFilter
attribute.final ImmutableEvent
withTagFilter
(String value) Copy the current immutable object by setting a present value for the optionaltagFilter
attribute.final ImmutableEvent
withTagFilter
(Optional<String> optional) Copy the current immutable object by setting an optional value for thetagFilter
attribute.final ImmutableEvent
withVersion
(int value) Copy the current immutable object by setting a value for theversion
attribute.
-
Method Details
-
getId
-
getName
-
getPayload
- Specified by:
getPayload
in classEvent
- Returns:
- The value of the
payload
attribute
-
getNodeFilter
- Specified by:
getNodeFilter
in classEvent
- Returns:
- The value of the
nodeFilter
attribute
-
getServiceFilter
- Specified by:
getServiceFilter
in classEvent
- Returns:
- The value of the
serviceFilter
attribute
-
getTagFilter
- Specified by:
getTagFilter
in classEvent
- Returns:
- The value of the
tagFilter
attribute
-
getVersion
public int getVersion()- Specified by:
getVersion
in classEvent
- Returns:
- The value of the
version
attribute
-
getLTime
-
withId
Copy the current immutable object by setting a value for theid
attribute. 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
this
object
-
withName
Copy the current immutable object by setting a value for thename
attribute. 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
this
object
-
withPayload
Copy the current immutable object by setting a present value for the optionalpayload
attribute.- Parameters:
value
- The value for payload- Returns:
- A modified copy of
this
object
-
withPayload
Copy the current immutable object by setting an optional value for thepayload
attribute. 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
this
object
-
withNodeFilter
Copy the current immutable object by setting a present value for the optionalnodeFilter
attribute.- Parameters:
value
- The value for nodeFilter- Returns:
- A modified copy of
this
object
-
withNodeFilter
Copy the current immutable object by setting an optional value for thenodeFilter
attribute. 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
this
object
-
withServiceFilter
Copy the current immutable object by setting a present value for the optionalserviceFilter
attribute.- Parameters:
value
- The value for serviceFilter- Returns:
- A modified copy of
this
object
-
withServiceFilter
Copy the current immutable object by setting an optional value for theserviceFilter
attribute. 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
this
object
-
withTagFilter
Copy the current immutable object by setting a present value for the optionaltagFilter
attribute.- Parameters:
value
- The value for tagFilter- Returns:
- A modified copy of
this
object
-
withTagFilter
Copy the current immutable object by setting an optional value for thetagFilter
attribute. 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
this
object
-
withVersion
Copy the current immutable object by setting a value for theversion
attribute. 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
this
object
-
withLTime
Copy the current immutable object by setting a value for thelTime
attribute. 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
this
object
-
equals
This instance is equal to all instances ofImmutableEvent
that 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 valueEvent
with attribute values. -
copyOf
Creates an immutable copy of aEvent
value. 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) // required
id
.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
-