Class ImmutableServiceProxy


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

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

    • Method Detail

      • getDestinationServiceName

        public java.lang.String getDestinationServiceName()
        Specified by:
        getDestinationServiceName in class ServiceProxy
        Returns:
        The value of the destinationServiceName attribute
      • getDestinationServiceId

        public java.lang.String getDestinationServiceId()
        Specified by:
        getDestinationServiceId in class ServiceProxy
        Returns:
        The value of the destinationServiceId attribute
      • getLocalServiceAddress

        public java.lang.String getLocalServiceAddress()
        Specified by:
        getLocalServiceAddress in class ServiceProxy
        Returns:
        The value of the localServiceAddress attribute
      • getLocalServicePort

        public int getLocalServicePort()
        Specified by:
        getLocalServicePort in class ServiceProxy
        Returns:
        The value of the localServicePort attribute
      • getConfig

        public com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> getConfig()
        Specified by:
        getConfig in class ServiceProxy
        Returns:
        The value of the config attribute
      • withDestinationServiceName

        public final ImmutableServiceProxy withDestinationServiceName​(java.lang.String value)
        Copy the current immutable object by setting a value for the destinationServiceName attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for destinationServiceName
        Returns:
        A modified copy of the this object
      • withDestinationServiceId

        public final ImmutableServiceProxy withDestinationServiceId​(java.lang.String value)
        Copy the current immutable object by setting a value for the destinationServiceId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for destinationServiceId
        Returns:
        A modified copy of the this object
      • withLocalServiceAddress

        public final ImmutableServiceProxy withLocalServiceAddress​(java.lang.String value)
        Copy the current immutable object by setting a value for the localServiceAddress attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for localServiceAddress
        Returns:
        A modified copy of the this object
      • withLocalServicePort

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

        public final ImmutableServiceProxy withConfig​(java.util.Map<java.lang.String,​? extends java.lang.String> entries)
        Copy the current immutable object by replacing the config map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the config map
        Returns:
        A modified copy of this object
      • withUpstreams

        public final ImmutableServiceProxy withUpstreams​(ServiceProxyUpstream... elements)
        Copy the current immutable object with elements that replace the content of upstreams.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withUpstreams

        public final ImmutableServiceProxy withUpstreams​(java.lang.Iterable<? extends ServiceProxyUpstream> elements)
        Copy the current immutable object with elements that replace the content of upstreams. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of upstreams elements to set
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableServiceProxy 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: destinationServiceName, destinationServiceId, localServiceAddress, localServicePort, config, upstreams.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableServiceProxy copyOf​(ServiceProxy instance)
        Creates an immutable copy of a ServiceProxy 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 ServiceProxy instance