Class ImmutableTransactionOptions

  • All Implemented Interfaces:
    ParamAdder

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

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

    • Method Detail

      • getDatacenter

        public java.util.Optional<java.lang.String> getDatacenter()
        Specified by:
        getDatacenter in class TransactionOptions
        Returns:
        The value of the datacenter attribute
      • withDatacenter

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

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

        public final ImmutableTransactionOptions withConsistencyMode​(ConsistencyMode value)
        Copy the current immutable object by setting a value for the consistencyMode attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for consistencyMode
        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 ImmutableTransactionOptions 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: datacenter, consistencyMode.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

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