Package org.kiwiproject.consul.model
Class ImmutableEventResponse
java.lang.Object
org.kiwiproject.consul.model.EventResponse
org.kiwiproject.consul.model.ImmutableEventResponse
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableEventResponse
extends EventResponse
Immutable implementation of
EventResponse.
Use the builder to create immutable instances:
ImmutableEventResponse.builder().
Use the static factory method to create immutable instances:
ImmutableEventResponse.of().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableEventResponse. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableEventResponse.static ImmutableEventResponsecopyOf(EventResponse instance) Creates an immutable copy of aEventResponsevalue.booleanThis instance is equal to all instances ofImmutableEventResponsethat have equal attribute values.com.google.common.collect.ImmutableList<Event>getIndex()inthashCode()Computes a hash code from attributes:events,index.static ImmutableEventResponseof(Iterable<? extends Event> events, BigInteger index) Construct a new immutableEventResponseinstance.static ImmutableEventResponseof(List<Event> events, BigInteger index) Construct a new immutableEventResponseinstance.toString()Prints the immutable valueEventResponsewith attribute values.final ImmutableEventResponsewithEvents(Iterable<? extends Event> elements) Copy the current immutable object with elements that replace the content ofevents.final ImmutableEventResponsewithEvents(Event... elements) Copy the current immutable object with elements that replace the content ofevents.final ImmutableEventResponsewithIndex(BigInteger value) Copy the current immutable object by setting a value for theindexattribute.
-
Method Details
-
getEvents
- Specified by:
getEventsin classEventResponse- Returns:
- The value of the
eventsattribute
-
getIndex
- Specified by:
getIndexin classEventResponse- Returns:
- The value of the
indexattribute
-
withEvents
Copy the current immutable object with elements that replace the content ofevents.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withEvents
Copy the current immutable object with elements that replace the content ofevents. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of events elements to set- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting a value for theindexattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for index- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableEventResponsethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:events,index. -
toString
Prints the immutable valueEventResponsewith attribute values. -
of
Construct a new immutableEventResponseinstance.- Parameters:
events- The value for theeventsattributeindex- The value for theindexattribute- Returns:
- An immutable EventResponse instance
-
of
Construct a new immutableEventResponseinstance.- Parameters:
events- The value for theeventsattributeindex- The value for theindexattribute- Returns:
- An immutable EventResponse instance
-
copyOf
Creates an immutable copy of aEventResponsevalue. 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 EventResponse instance
-
builder
Creates a builder forImmutableEventResponse.ImmutableEventResponse.builder() .addEvents|addAllEvents(org.kiwiproject.consul.model.event.Event) //eventselements .index(java.math.BigInteger) // requiredindex.build();- Returns:
- A new ImmutableEventResponse builder
-