Class ImmutableEventResponse


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    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().

    • Method Detail

      • getEvents

        public com.google.common.collect.ImmutableList<Event> getEvents()
        Specified by:
        getEvents in class EventResponse
        Returns:
        The value of the events attribute
      • getIndex

        public java.math.BigInteger getIndex()
        Specified by:
        getIndex in class EventResponse
        Returns:
        The value of the index attribute
      • withEvents

        public final ImmutableEventResponse withEvents​(Event... elements)
        Copy the current immutable object with elements that replace the content of events.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withEvents

        public final ImmutableEventResponse withEvents​(java.lang.Iterable<? extends Event> elements)
        Copy the current immutable object with elements that replace the content of events. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of events elements to set
        Returns:
        A modified copy of this object
      • withIndex

        public final ImmutableEventResponse withIndex​(java.math.BigInteger value)
        Copy the current immutable object by setting a value for the index attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for index
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableEventResponse that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: events, index.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value EventResponse with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • of

        public static ImmutableEventResponse of​(java.util.List<Event> events,
                                                java.math.BigInteger index)
        Construct a new immutable EventResponse instance.
        Parameters:
        events - The value for the events attribute
        index - The value for the index attribute
        Returns:
        An immutable EventResponse instance
      • of

        public static ImmutableEventResponse of​(java.lang.Iterable<? extends Event> events,
                                                java.math.BigInteger index)
        Construct a new immutable EventResponse instance.
        Parameters:
        events - The value for the events attribute
        index - The value for the index attribute
        Returns:
        An immutable EventResponse instance
      • copyOf

        public static ImmutableEventResponse copyOf​(EventResponse instance)
        Creates an immutable copy of a EventResponse 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 EventResponse instance
      • builder

        public static ImmutableEventResponse.Builder builder()
        Creates a builder for ImmutableEventResponse.
         ImmutableEventResponse.builder()
            .addEvents|addAllEvents(com.orbitz.consul.model.event.Event) // events elements
            .index(java.math.BigInteger) // required index
            .build();
         
        Returns:
        A new ImmutableEventResponse builder