Class Put

java.lang.Object
org.projectnessie.versioned.Put
All Implemented Interfaces:
Operation

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

    Nested classes/interfaces inherited from interface org.projectnessie.versioned.Operation

    Operation.OperationType
  • Constructor Summary

    Constructors
    Constructor
    Description
    Put()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
     
    org.projectnessie.model.Content
    The value to store for this operation.
    protected abstract Supplier<org.projectnessie.model.Content>
     
    int
     
    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, 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.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.projectnessie.versioned.Operation

    getKey, shouldMatchHash
  • Constructor Details

    • Put

      public Put()
  • Method Details

    • getValue

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

      public Operation.OperationType getType()
      Specified by:
      getType in interface Operation
    • getValueSupplier

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

      @Nonnull public static Put of(@Nonnull org.projectnessie.model.ContentKey key, @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 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 public static Put ofLazy(org.projectnessie.model.ContentKey key, int payload, org.projectnessie.nessie.relocated.protobuf.ByteString value, 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 Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object