Class ImmutableFullService


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

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

    • Method Detail

      • getKind

        public java.util.Optional<java.lang.String> getKind()
        Specified by:
        getKind in class FullService
        Returns:
        The value of the kind attribute
      • getId

        public java.lang.String getId()
        Specified by:
        getId in class FullService
        Returns:
        The value of the id attribute
      • getService

        public java.lang.String getService()
        Specified by:
        getService in class FullService
        Returns:
        The value of the service attribute
      • getTags

        public com.google.common.collect.ImmutableList<java.lang.String> getTags()
        Specified by:
        getTags in class FullService
        Returns:
        The value of the tags attribute
      • getMeta

        public com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> getMeta()
        Specified by:
        getMeta in class FullService
        Returns:
        The value of the meta attribute
      • getPort

        public int getPort()
        Specified by:
        getPort in class FullService
        Returns:
        The value of the port attribute
      • getAddress

        public java.lang.String getAddress()
        Specified by:
        getAddress in class FullService
        Returns:
        The value of the address attribute
      • getEnableTagOverride

        public java.util.Optional<java.lang.Boolean> getEnableTagOverride()
        Specified by:
        getEnableTagOverride in class FullService
        Returns:
        The value of the enableTagOverride attribute
      • getContentHash

        public java.lang.String getContentHash()
        Specified by:
        getContentHash in class FullService
        Returns:
        The value of the contentHash attribute
      • withKind

        public final ImmutableFullService withKind​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional kind attribute.
        Parameters:
        value - The value for kind
        Returns:
        A modified copy of this object
      • withKind

        public final ImmutableFullService withKind​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the kind attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for kind
        Returns:
        A modified copy of this object
      • withId

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

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

        public final ImmutableFullService withTags​(java.lang.String... elements)
        Copy the current immutable object with elements that replace the content of tags.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withTags

        public final ImmutableFullService withTags​(java.lang.Iterable<java.lang.String> elements)
        Copy the current immutable object with elements that replace the content of tags. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of tags elements to set
        Returns:
        A modified copy of this object
      • withMeta

        public final ImmutableFullService withMeta​(java.util.Map<java.lang.String,​? extends java.lang.String> entries)
        Copy the current immutable object by replacing the meta 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 meta map
        Returns:
        A modified copy of this object
      • withPort

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

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

        public final ImmutableFullService withWeights​(ServiceWeights value)
        Copy the current immutable object by setting a present value for the optional weights attribute.
        Parameters:
        value - The value for weights
        Returns:
        A modified copy of this object
      • withWeights

        public final ImmutableFullService withWeights​(java.util.Optional<? extends ServiceWeights> optional)
        Copy the current immutable object by setting an optional value for the weights attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for weights
        Returns:
        A modified copy of this object
      • withEnableTagOverride

        public final ImmutableFullService withEnableTagOverride​(boolean value)
        Copy the current immutable object by setting a present value for the optional enableTagOverride attribute.
        Parameters:
        value - The value for enableTagOverride
        Returns:
        A modified copy of this object
      • withEnableTagOverride

        public final ImmutableFullService withEnableTagOverride​(java.util.Optional<java.lang.Boolean> optional)
        Copy the current immutable object by setting an optional value for the enableTagOverride attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for enableTagOverride
        Returns:
        A modified copy of this object
      • withContentHash

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

        public final ImmutableFullService withProxy​(ServiceProxy value)
        Copy the current immutable object by setting a present value for the optional proxy attribute.
        Parameters:
        value - The value for proxy
        Returns:
        A modified copy of this object
      • withProxy

        public final ImmutableFullService withProxy​(java.util.Optional<? extends ServiceProxy> optional)
        Copy the current immutable object by setting an optional value for the proxy attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for proxy
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableFullService 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: kind, id, service, tags, meta, port, address, weights, enableTagOverride, contentHash, proxy.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableFullService copyOf​(FullService instance)
        Creates an immutable copy of a FullService 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 FullService instance
      • builder

        public static ImmutableFullService.Builder builder()
        Creates a builder for ImmutableFullService.
         ImmutableFullService.builder()
            .kind(String) // optional kind
            .id(String) // required id
            .service(String) // required service
            .addTags|addAllTags(String) // tags elements
            .putMeta|putAllMeta(String => String) // meta mappings
            .port(int) // required port
            .address(String) // required address
            .weights(com.orbitz.consul.model.catalog.ServiceWeights) // optional weights
            .enableTagOverride(Boolean) // optional enableTagOverride
            .contentHash(String) // required contentHash
            .proxy(com.orbitz.consul.model.agent.ServiceProxy) // optional proxy
            .build();
         
        Returns:
        A new ImmutableFullService builder