Class ImmutableEvent.Builder

java.lang.Object
org.kiwiproject.consul.model.event.ImmutableEvent.Builder
Enclosing class:
ImmutableEvent

public static final class ImmutableEvent.Builder extends Object
Builds instances of type ImmutableEvent. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableEvent.Builder from(Event instance)
      Fill a builder with attribute values from the provided Event instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • id

      @CanIgnoreReturnValue public final ImmutableEvent.Builder id(String id)
      Initializes the value for the id attribute.
      Parameters:
      id - The value for id
      Returns:
      this builder for use in a chained invocation
    • name

      @CanIgnoreReturnValue public final ImmutableEvent.Builder name(String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name
      Returns:
      this builder for use in a chained invocation
    • payload

      @CanIgnoreReturnValue public final ImmutableEvent.Builder payload(String payload)
      Initializes the optional value payload to payload.
      Parameters:
      payload - The value for payload
      Returns:
      this builder for chained invocation
    • payload

      @CanIgnoreReturnValue public final ImmutableEvent.Builder payload(Optional<String> payload)
      Initializes the optional value payload to payload.
      Parameters:
      payload - The value for payload
      Returns:
      this builder for use in a chained invocation
    • nodeFilter

      @CanIgnoreReturnValue public final ImmutableEvent.Builder nodeFilter(String nodeFilter)
      Initializes the optional value nodeFilter to nodeFilter.
      Parameters:
      nodeFilter - The value for nodeFilter
      Returns:
      this builder for chained invocation
    • nodeFilter

      @CanIgnoreReturnValue public final ImmutableEvent.Builder nodeFilter(Optional<String> nodeFilter)
      Initializes the optional value nodeFilter to nodeFilter.
      Parameters:
      nodeFilter - The value for nodeFilter
      Returns:
      this builder for use in a chained invocation
    • serviceFilter

      @CanIgnoreReturnValue public final ImmutableEvent.Builder serviceFilter(String serviceFilter)
      Initializes the optional value serviceFilter to serviceFilter.
      Parameters:
      serviceFilter - The value for serviceFilter
      Returns:
      this builder for chained invocation
    • serviceFilter

      @CanIgnoreReturnValue public final ImmutableEvent.Builder serviceFilter(Optional<String> serviceFilter)
      Initializes the optional value serviceFilter to serviceFilter.
      Parameters:
      serviceFilter - The value for serviceFilter
      Returns:
      this builder for use in a chained invocation
    • tagFilter

      @CanIgnoreReturnValue public final ImmutableEvent.Builder tagFilter(String tagFilter)
      Initializes the optional value tagFilter to tagFilter.
      Parameters:
      tagFilter - The value for tagFilter
      Returns:
      this builder for chained invocation
    • tagFilter

      @CanIgnoreReturnValue public final ImmutableEvent.Builder tagFilter(Optional<String> tagFilter)
      Initializes the optional value tagFilter to tagFilter.
      Parameters:
      tagFilter - The value for tagFilter
      Returns:
      this builder for use in a chained invocation
    • version

      @CanIgnoreReturnValue public final ImmutableEvent.Builder version(int version)
      Initializes the value for the version attribute.
      Parameters:
      version - The value for version
      Returns:
      this builder for use in a chained invocation
    • lTime

      @CanIgnoreReturnValue public final ImmutableEvent.Builder lTime(Long lTime)
      Initializes the value for the lTime attribute.
      Parameters:
      lTime - The value for lTime
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableEvent build()
      Builds a new ImmutableEvent.
      Returns:
      An immutable instance of Event
      Throws:
      IllegalStateException - if any required attributes are missing