Class ImmutablePutOptions

  • All Implemented Interfaces:
    ParamAdder

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutablePutOptions
    extends PutOptions
    Immutable implementation of PutOptions.

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

    • Field Summary

    • Method Summary

      Modifier and Type Method Description
      static ImmutablePutOptions.Builder builder()
      Creates a builder for ImmutablePutOptions.
      static ImmutablePutOptions copyOf​(PutOptions instance)
      Creates an immutable copy of a PutOptions value.
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutablePutOptions that have equal attribute values.
      java.util.Optional<java.lang.String> getAcquire()  
      java.util.Optional<java.lang.Long> getCas()  
      java.util.Optional<java.lang.String> getDc()  
      java.util.Optional<java.lang.String> getRelease()  
      java.util.Optional<java.lang.String> getToken()  
      int hashCode()
      Computes a hash code from attributes: toHeaders, cas, acquire, release, dc, token.
      com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> toHeaders()  
      java.lang.String toString()
      Prints the immutable value PutOptions with attribute values.
      ImmutablePutOptions withAcquire​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional acquire attribute.
      ImmutablePutOptions withAcquire​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the acquire attribute.
      ImmutablePutOptions withCas​(long value)
      Copy the current immutable object by setting a present value for the optional cas attribute.
      ImmutablePutOptions withCas​(java.util.Optional<java.lang.Long> optional)
      Copy the current immutable object by setting an optional value for the cas attribute.
      ImmutablePutOptions withDc​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional dc attribute.
      ImmutablePutOptions withDc​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the dc attribute.
      ImmutablePutOptions withRelease​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional release attribute.
      ImmutablePutOptions withRelease​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the release attribute.
      ImmutablePutOptions withToHeaders​(java.util.Map<java.lang.String,​? extends java.lang.String> entries)
      Copy the current immutable object by replacing the toHeaders map with the specified map.
      ImmutablePutOptions withToken​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional token attribute.
      ImmutablePutOptions withToken​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the token attribute.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • toHeaders

        public com.google.common.collect.ImmutableMap<java.lang.String,​java.lang.String> toHeaders()
        Returns:
        The value of the toHeaders attribute
      • getCas

        public java.util.Optional<java.lang.Long> getCas()
        Specified by:
        getCas in class PutOptions
        Returns:
        The value of the cas attribute
      • getAcquire

        public java.util.Optional<java.lang.String> getAcquire()
        Specified by:
        getAcquire in class PutOptions
        Returns:
        The value of the acquire attribute
      • getRelease

        public java.util.Optional<java.lang.String> getRelease()
        Specified by:
        getRelease in class PutOptions
        Returns:
        The value of the release attribute
      • getDc

        public java.util.Optional<java.lang.String> getDc()
        Specified by:
        getDc in class PutOptions
        Returns:
        The value of the dc attribute
      • getToken

        public java.util.Optional<java.lang.String> getToken()
        Specified by:
        getToken in class PutOptions
        Returns:
        The value of the token attribute
      • withToHeaders

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

        public final ImmutablePutOptions withCas​(long value)
        Copy the current immutable object by setting a present value for the optional cas attribute.
        Parameters:
        value - The value for cas
        Returns:
        A modified copy of this object
      • withCas

        public final ImmutablePutOptions withCas​(java.util.Optional<java.lang.Long> optional)
        Copy the current immutable object by setting an optional value for the cas 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 cas
        Returns:
        A modified copy of this object
      • withAcquire

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

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

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

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

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

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

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

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

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutablePutOptions 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: toHeaders, cas, acquire, release, dc, token.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutablePutOptions.Builder builder()
        Creates a builder for ImmutablePutOptions.
         ImmutablePutOptions.builder()
            .putToHeaders|putAllToHeaders(String => String) // toHeaders mappings
            .cas(Long) // optional cas
            .acquire(String) // optional acquire
            .release(String) // optional release
            .dc(String) // optional dc
            .token(String) // optional token
            .build();
         
        Returns:
        A new ImmutablePutOptions builder