Class Put

  • All Implemented Interfaces:
    Operation

    @Immutable
    public abstract class Put
    extends java.lang.Object
    implements Operation
    Setting a new value. Can optionally declare whether the prior hash must match.
    • Constructor Summary

      Constructors 
      Constructor Description
      Put()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      Operation.OperationType getType()  
      org.projectnessie.model.Content getValue()
      The value to store for this operation.
      protected abstract java.util.function.Supplier<org.projectnessie.model.Content> getValueSupplier()  
      int hashCode()  
      static Put of​(org.projectnessie.model.ContentKey key, org.projectnessie.model.Content value)
      Creates an (eagerly-evaluated) put-operation for the given key and value.
      static Put ofLazy​(org.projectnessie.model.ContentKey key, int payload, org.projectnessie.nessie.relocated.protobuf.ByteString value)
      Creates a lazily-evaluated put-operation for the given key, payload and ByteString value.
      static Put ofLazy​(org.projectnessie.model.ContentKey key, int payload, org.projectnessie.nessie.relocated.protobuf.ByteString value, java.util.function.Supplier<org.projectnessie.nessie.relocated.protobuf.ByteString> globalStateSupplier)
      Creates a lazily-evaluated put-operation for the given key, payload, ByteString value and global state supplier.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Put

        public Put()
    • Method Detail

      • getValue

        @Lazy
        public org.projectnessie.model.Content getValue()
        The value to store for this operation.
        Returns:
        the value
      • getValueSupplier

        protected abstract java.util.function.Supplier<org.projectnessie.model.Content> getValueSupplier()
      • of

        @Nonnull
        @Nonnull
        public static Put of​(@Nonnull @Nonnull
                             org.projectnessie.model.ContentKey key,
                             @Nonnull @Nonnull
                             org.projectnessie.model.Content value)
        Creates an (eagerly-evaluated) put-operation for the given key and value.

        value with a null content ID is required when creating/adding new content.

        value with a non-null content ID is required when updating existing content.

        A content object is considered to be the same using the content-key and the content-id.

        Parameters:
        key - the key impacted by the operation
        value - the new value associated with the key
        Returns:
        a put operation for the key and value
      • ofLazy

        @Nonnull
        @Nonnull
        public static Put ofLazy​(org.projectnessie.model.ContentKey key,
                                 int payload,
                                 org.projectnessie.nessie.relocated.protobuf.ByteString value)
        Creates a lazily-evaluated put-operation for the given key, payload and ByteString value.
      • ofLazy

        @Nonnull
        @Nonnull
        public static Put ofLazy​(org.projectnessie.model.ContentKey key,
                                 int payload,
                                 org.projectnessie.nessie.relocated.protobuf.ByteString value,
                                 java.util.function.Supplier<org.projectnessie.nessie.relocated.protobuf.ByteString> globalStateSupplier)
        Creates a lazily-evaluated put-operation for the given key, payload, ByteString value and global state supplier.
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object