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().

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in class Event
      Returns:
      The value of the id attribute
    • getName

      public String getName()
      Specified by:
      getName in class Event
      Returns:
      The value of the name attribute
    • getPayload

      public Optional<String> getPayload()
      Specified by:
      getPayload in class Event
      Returns:
      The value of the payload attribute
    • getNodeFilter

      public Optional<String> getNodeFilter()
      Specified by:
      getNodeFilter in class Event
      Returns:
      The value of the nodeFilter attribute
    • getServiceFilter

      public Optional<String> getServiceFilter()
      Specified by:
      getServiceFilter in class Event
      Returns:
      The value of the serviceFilter attribute
    • getTagFilter

      public Optional<String> getTagFilter()
      Specified by:
      getTagFilter in class Event
      Returns:
      The value of the tagFilter attribute
    • getVersion

      public int getVersion()
      Specified by:
      getVersion in class Event
      Returns:
      The value of the version attribute
    • getLTime

      public Long getLTime()
      Specified by:
      getLTime in class Event
      Returns:
      The value of the lTime attribute
    • withId

      public final ImmutableEvent withId(String value)
      Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutableEvent withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withPayload

      public final ImmutableEvent withPayload(String value)
      Copy the current immutable object by setting a present value for the optional payload attribute.
      Parameters:
      value - The value for payload
      Returns:
      A modified copy of this object
    • withPayload

      public final ImmutableEvent withPayload(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the payload attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for payload
      Returns:
      A modified copy of this object
    • withNodeFilter

      public final ImmutableEvent withNodeFilter(String value)
      Copy the current immutable object by setting a present value for the optional nodeFilter attribute.
      Parameters:
      value - The value for nodeFilter
      Returns:
      A modified copy of this object
    • withNodeFilter

      public final ImmutableEvent withNodeFilter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the nodeFilter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for nodeFilter
      Returns:
      A modified copy of this object
    • withServiceFilter

      public final ImmutableEvent withServiceFilter(String value)
      Copy the current immutable object by setting a present value for the optional serviceFilter attribute.
      Parameters:
      value - The value for serviceFilter
      Returns:
      A modified copy of this object
    • withServiceFilter

      public final ImmutableEvent withServiceFilter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the serviceFilter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for serviceFilter
      Returns:
      A modified copy of this object
    • withTagFilter

      public final ImmutableEvent withTagFilter(String value)
      Copy the current immutable object by setting a present value for the optional tagFilter attribute.
      Parameters:
      value - The value for tagFilter
      Returns:
      A modified copy of this object
    • withTagFilter

      public final ImmutableEvent withTagFilter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the tagFilter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for tagFilter
      Returns:
      A modified copy of this object
    • withVersion

      public final ImmutableEvent withVersion(int value)
      Copy the current immutable object by setting a value for the version attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy of the this object
    • withLTime

      public final ImmutableEvent withLTime(Long value)
      Copy the current immutable object by setting a value for the lTime attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for lTime
      Returns:
      A modified copy of the this object
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: id, name, payload, nodeFilter, serviceFilter, tagFilter, version, lTime.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableEvent copyOf(Event instance)
      Creates an immutable copy of a Event 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

      public static ImmutableEvent.Builder builder()
      Creates a builder for ImmutableEvent.
       ImmutableEvent.builder()
          .id(String) // required id
          .name(String) // required name
          .payload(String) // optional payload
          .nodeFilter(String) // optional nodeFilter
          .serviceFilter(String) // optional serviceFilter
          .tagFilter(String) // optional tagFilter
          .version(int) // required version
          .lTime(Long) // required lTime
          .build();
       
      Returns:
      A new ImmutableEvent builder