Class ImmutableEvent.Builder

  • Enclosing class:
    ImmutableEvent

    @NotThreadSafe
    public static final class ImmutableEvent.Builder
    extends java.lang.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 Detail

      • 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​(java.lang.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​(java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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​(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 ImmutableEvent.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 ImmutableEvent.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 ImmutableEvent.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 ImmutableEvent.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 ImmutableEvent.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
      • 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​(java.lang.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:
        java.lang.IllegalStateException - if any required attributes are missing