Class ImmutableOutputStatus.Builder

  • Enclosing class:
    ImmutableOutputStatus

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

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for ImmutableOutputStatus instances.
         new ImmutableOutputStatus.Builder()
            .errorCount(int) // required errorCount
            .forwarded(int) // required forwarded
            .received(int) // required received
            .retries(int) // required retries
            .build();
         
    • Method Detail

      • from

        public final ImmutableOutputStatus.Builder from​(OutputStatus instance)
        Fill a builder with attribute values from the provided OutputStatus 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
      • errorCount

        public final ImmutableOutputStatus.Builder errorCount​(int errorCount)
        Initializes the value for the errorCount attribute.
        Parameters:
        errorCount - The value for errorCount
        Returns:
        this builder for use in a chained invocation
      • forwarded

        public final ImmutableOutputStatus.Builder forwarded​(int forwarded)
        Initializes the value for the forwarded attribute.
        Parameters:
        forwarded - The value for forwarded
        Returns:
        this builder for use in a chained invocation
      • received

        public final ImmutableOutputStatus.Builder received​(int received)
        Initializes the value for the received attribute.
        Parameters:
        received - The value for received
        Returns:
        this builder for use in a chained invocation
      • retries

        public final ImmutableOutputStatus.Builder retries​(int retries)
        Initializes the value for the retries attribute.
        Parameters:
        retries - The value for retries
        Returns:
        this builder for use in a chained invocation