Class ImmutableOperation


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

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

    • Method Summary

      Modifier and Type Method Description
      static ImmutableOperation.Builder builder()
      Creates a builder for ImmutableOperation.
      static ImmutableOperation copyOf​(Operation instance)
      Creates an immutable copy of a Operation value.
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutableOperation that have equal attribute values.
      java.util.Optional<java.lang.Long> flags()  
      int hashCode()
      Computes a hash code from attributes: verb, key, value, flags, index, session.
      java.util.Optional<java.math.BigInteger> index()  
      java.util.Optional<java.lang.String> key()  
      java.util.Optional<java.lang.String> session()  
      java.lang.String toString()
      Prints the immutable value Operation with attribute values.
      java.util.Optional<java.lang.String> value()  
      java.lang.String verb()  
      ImmutableOperation withFlags​(long value)
      Copy the current immutable object by setting a present value for the optional flags attribute.
      ImmutableOperation withFlags​(java.util.Optional<java.lang.Long> optional)
      Copy the current immutable object by setting an optional value for the flags attribute.
      ImmutableOperation withIndex​(java.math.BigInteger value)
      Copy the current immutable object by setting a present value for the optional index attribute.
      ImmutableOperation withIndex​(java.util.Optional<? extends java.math.BigInteger> optional)
      Copy the current immutable object by setting an optional value for the index attribute.
      ImmutableOperation withKey​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional key attribute.
      ImmutableOperation withKey​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the key attribute.
      ImmutableOperation withSession​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional session attribute.
      ImmutableOperation withSession​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the session attribute.
      ImmutableOperation withValue​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional value attribute.
      ImmutableOperation withValue​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the value attribute.
      ImmutableOperation withVerb​(java.lang.String value)
      Copy the current immutable object by setting a value for the verb attribute.
      • Methods inherited from class java.lang.Object

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

      • verb

        public java.lang.String verb()
        Specified by:
        verb in class Operation
        Returns:
        The value of the verb attribute
      • key

        public java.util.Optional<java.lang.String> key()
        Specified by:
        key in class Operation
        Returns:
        The value of the key attribute
      • value

        public java.util.Optional<java.lang.String> value()
        Specified by:
        value in class Operation
        Returns:
        The value of the value attribute
      • flags

        public java.util.Optional<java.lang.Long> flags()
        Specified by:
        flags in class Operation
        Returns:
        The value of the flags attribute
      • index

        public java.util.Optional<java.math.BigInteger> index()
        Specified by:
        index in class Operation
        Returns:
        The value of the index attribute
      • session

        public java.util.Optional<java.lang.String> session()
        Specified by:
        session in class Operation
        Returns:
        The value of the session attribute
      • withVerb

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

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

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

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

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

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

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

        public final ImmutableOperation withIndex​(java.math.BigInteger value)
        Copy the current immutable object by setting a present value for the optional index attribute.
        Parameters:
        value - The value for index
        Returns:
        A modified copy of this object
      • withIndex

        public final ImmutableOperation withIndex​(java.util.Optional<? extends java.math.BigInteger> optional)
        Copy the current immutable object by setting an optional value for the index 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 index
        Returns:
        A modified copy of this object
      • withSession

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

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

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableOperation 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: verb, key, value, flags, index, session.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableOperation.Builder builder()
        Creates a builder for ImmutableOperation.
         ImmutableOperation.builder()
            .verb(String) // required verb
            .key(String) // optional key
            .value(String) // optional value
            .flags(Long) // optional flags
            .index(java.math.BigInteger) // optional index
            .session(String) // optional session
            .build();
         
        Returns:
        A new ImmutableOperation builder