Class ImmutableEventOptions.Builder

  • Enclosing class:
    ImmutableEventOptions

    @NotThreadSafe
    public static final class ImmutableEventOptions.Builder
    extends java.lang.Object
    Builds instances of type ImmutableEventOptions. 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 Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder from​(ParamAdder instance)
        Fill a builder with attribute values from the provided com.orbitz.consul.option.ParamAdder instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder from​(EventOptions instance)
        Fill a builder with attribute values from the provided com.orbitz.consul.option.EventOptions instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • putToHeaders

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder putToHeaders​(java.lang.String key,
                                                                java.lang.String value)
        Put one entry to the toHeaders map.
        Parameters:
        key - The key in the toHeaders map
        value - The associated value in the toHeaders map
        Returns:
        this builder for use in a chained invocation
      • putToHeaders

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder putToHeaders​(java.util.Map.Entry<java.lang.String,​? extends java.lang.String> entry)
        Put one entry to the toHeaders map. Nulls are not permitted
        Parameters:
        entry - The key and value entry
        Returns:
        this builder for use in a chained invocation
      • toHeaders

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder toHeaders​(java.util.Map<java.lang.String,​? extends java.lang.String> entries)
        Sets or replaces all mappings from the specified map as entries for the toHeaders map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the toHeaders map
        Returns:
        this builder for use in a chained invocation
      • putAllToHeaders

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder putAllToHeaders​(java.util.Map<java.lang.String,​? extends java.lang.String> entries)
        Put all mappings from the specified map as entries to toHeaders map. Nulls are not permitted
        Parameters:
        entries - The entries that will be added to the toHeaders map
        Returns:
        this builder for use in a chained invocation
      • datacenter

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder datacenter​(java.lang.String datacenter)
        Initializes the optional value datacenter to datacenter.
        Parameters:
        datacenter - The value for datacenter
        Returns:
        this builder for chained invocation
      • datacenter

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

        @CanIgnoreReturnValue
        public final ImmutableEventOptions.Builder nodeFilter​(java.lang.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 ImmutableEventOptions.Builder nodeFilter​(java.util.Optional<java.lang.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 ImmutableEventOptions.Builder serviceFilter​(java.lang.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 ImmutableEventOptions.Builder serviceFilter​(java.util.Optional<java.lang.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 ImmutableEventOptions.Builder tagFilter​(java.lang.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 ImmutableEventOptions.Builder tagFilter​(java.util.Optional<java.lang.String> tagFilter)
        Initializes the optional value tagFilter to tagFilter.
        Parameters:
        tagFilter - The value for tagFilter
        Returns:
        this builder for use in a chained invocation
      • build

        public ImmutableEventOptions build()
        Builds a new ImmutableEventOptions.
        Returns:
        An immutable instance of EventOptions
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing