Class ImmutableRegistration


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

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

    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in class Registration
        Returns:
        The value of the name attribute
      • getId

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

        public java.util.Optional<java.lang.String> getAddress()
        Specified by:
        getAddress in class Registration
        Returns:
        The value of the address attribute
      • getPort

        public java.util.Optional<java.lang.Integer> getPort()
        Specified by:
        getPort in class Registration
        Returns:
        The value of the port attribute
      • getTags

        public com.google.common.collect.ImmutableList<java.lang.String> getTags()
        Specified by:
        getTags in class Registration
        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 Registration
        Returns:
        The value of the meta attribute
      • getEnableTagOverride

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

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

        public final ImmutableRegistration 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
      • withAddress

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

        public final ImmutableRegistration withAddress​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the address 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 address
        Returns:
        A modified copy of this object
      • withPort

        public final ImmutableRegistration withPort​(int value)
        Copy the current immutable object by setting a present value for the optional port attribute.
        Parameters:
        value - The value for port
        Returns:
        A modified copy of this object
      • withPort

        public final ImmutableRegistration withPort​(java.util.Optional<java.lang.Integer> optional)
        Copy the current immutable object by setting an optional value for the port 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 port
        Returns:
        A modified copy of this object
      • withCheck

        public final ImmutableRegistration withCheck​(Registration.RegCheck value)
        Copy the current immutable object by setting a present value for the optional check attribute.
        Parameters:
        value - The value for check
        Returns:
        A modified copy of this object
      • withCheck

        public final ImmutableRegistration withCheck​(java.util.Optional<? extends Registration.RegCheck> optional)
        Copy the current immutable object by setting an optional value for the check 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 check
        Returns:
        A modified copy of this object
      • withChecks

        public final ImmutableRegistration withChecks​(Registration.RegCheck... elements)
        Copy the current immutable object with elements that replace the content of checks.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withChecks

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

        public final ImmutableRegistration 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 ImmutableRegistration 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 ImmutableRegistration 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
      • withEnableTagOverride

        public final ImmutableRegistration 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 ImmutableRegistration 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
      • equals

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

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

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

        public static ImmutableRegistration.Builder builder()
        Creates a builder for ImmutableRegistration.
         ImmutableRegistration.builder()
            .name(String) // required name
            .id(String) // required id
            .address(String) // optional address
            .port(Integer) // optional port
            .check(com.orbitz.consul.model.agent.Registration.RegCheck) // optional check
            .addChecks|addAllChecks(com.orbitz.consul.model.agent.Registration.RegCheck) // checks elements
            .addTags|addAllTags(String) // tags elements
            .putMeta|putAllMeta(String => String) // meta mappings
            .enableTagOverride(Boolean) // optional enableTagOverride
            .build();
         
        Returns:
        A new ImmutableRegistration builder