Class ImmutablePorts


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutablePorts
    extends Ports
    Immutable implementation of Ports.

    Use the builder to create immutable instances: ImmutablePorts.builder().

    • Method Detail

      • getDns

        public int getDns()
        Specified by:
        getDns in class Ports
        Returns:
        The value of the dns attribute
      • getHttp

        public int getHttp()
        Specified by:
        getHttp in class Ports
        Returns:
        The value of the http attribute
      • getRpc

        public int getRpc()
        Specified by:
        getRpc in class Ports
        Returns:
        The value of the rpc attribute
      • getSerfLan

        public int getSerfLan()
        Specified by:
        getSerfLan in class Ports
        Returns:
        The value of the serfLan attribute
      • getSerfWan

        public int getSerfWan()
        Specified by:
        getSerfWan in class Ports
        Returns:
        The value of the serfWan attribute
      • getServer

        public int getServer()
        Specified by:
        getServer in class Ports
        Returns:
        The value of the server attribute
      • withDns

        public final ImmutablePorts withDns​(int value)
        Copy the current immutable object by setting a value for the dns attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for dns
        Returns:
        A modified copy of the this object
      • withHttp

        public final ImmutablePorts withHttp​(int value)
        Copy the current immutable object by setting a value for the http attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for http
        Returns:
        A modified copy of the this object
      • withRpc

        public final ImmutablePorts withRpc​(int value)
        Copy the current immutable object by setting a value for the rpc attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for rpc
        Returns:
        A modified copy of the this object
      • withSerfLan

        public final ImmutablePorts withSerfLan​(int value)
        Copy the current immutable object by setting a value for the serfLan attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for serfLan
        Returns:
        A modified copy of the this object
      • withSerfWan

        public final ImmutablePorts withSerfWan​(int value)
        Copy the current immutable object by setting a value for the serfWan attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for serfWan
        Returns:
        A modified copy of the this object
      • withServer

        public final ImmutablePorts withServer​(int value)
        Copy the current immutable object by setting a value for the server attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for server
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutablePorts that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: dns, http, rpc, serfLan, serfWan, server.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value Ports with attribute values.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutablePorts copyOf​(Ports instance)
        Creates an immutable copy of a Ports value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable Ports instance
      • builder

        public static ImmutablePorts.Builder builder()
        Creates a builder for ImmutablePorts.
         ImmutablePorts.builder()
            .dns(int) // required dns
            .http(int) // required http
            .rpc(int) // required rpc
            .serfLan(int) // required serfLan
            .serfWan(int) // required serfWan
            .server(int) // required server
            .build();
         
        Returns:
        A new ImmutablePorts builder