Class ImmutablePair.Builder

  • Enclosing class:
    ImmutablePair

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

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

        public final ImmutablePair.Builder nt1​(String nt1)
        Initializes the value for the nt1 attribute.
        Parameters:
        nt1 - The value for nt1
        Returns:
        this builder for use in a chained invocation
      • nt2

        public final ImmutablePair.Builder nt2​(String nt2)
        Initializes the value for the nt2 attribute.
        Parameters:
        nt2 - The value for nt2
        Returns:
        this builder for use in a chained invocation
      • saenger

        public final ImmutablePair.Builder saenger​(String saenger)
        Initializes the value for the saenger attribute.
        Parameters:
        saenger - The value for saenger
        Returns:
        this builder for use in a chained invocation
      • lw

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