Class CommitBuilder

java.lang.Object
org.projectnessie.versioned.tests.CommitBuilder

public class CommitBuilder extends Object
Helper to generate commits against a store.
  • Constructor Details

    • CommitBuilder

      public CommitBuilder(org.projectnessie.versioned.VersionStore store)
  • Method Details

    • put

      public CommitBuilder put(String key, org.projectnessie.model.Content value)
      Adds a put operation to the current commit.
      Parameters:
      key - key's name to add
      value - the value associated with the key
      Returns:
      the builder instance
    • put

      public CommitBuilder put(org.projectnessie.model.ContentKey key, org.projectnessie.model.Content value)
      Adds a put operation to the current commit.
      Parameters:
      key - key to add
      value - the value associated with the key
      Returns:
      the builder instance
    • delete

      public CommitBuilder delete(String key)
      Adds a delete operation to the current commit.
      Parameters:
      key - key's name to delete
      Returns:
      the builder instance
    • delete

      public CommitBuilder delete(org.projectnessie.model.ContentKey key)
      Adds a delete operation to the current commit.
      Parameters:
      key - key to delete
      Returns:
      the builder instance
    • unchanged

      public CommitBuilder unchanged(String key)
      Adds an unchanged operation to the current commit.
      Parameters:
      key - key's name for the operation
      Returns:
      the builder instance
    • unchanged

      public CommitBuilder unchanged(org.projectnessie.model.ContentKey key)
      Adds an unchanged operation to the current commit.
      Parameters:
      key - key for the operation
      Returns:
      the builder instance
    • add

      public CommitBuilder add(org.projectnessie.versioned.Operation operation)
      Adds an operation to the current commit.
      Parameters:
      operation - operation to commit
      Returns:
      the builder instance
    • withMetadata

      public CommitBuilder withMetadata(org.projectnessie.model.CommitMeta metadata)
      Sets metadata for the current commit.
      Parameters:
      metadata - metadata to associate with the commit
      Returns:
      the builder instance
    • fromReference

      public CommitBuilder fromReference(org.projectnessie.versioned.Hash reference)
      Sets a reference to base the commit on.
      Parameters:
      reference - the reference's hash
      Returns:
      the builder instance
    • fromLatest

      public CommitBuilder fromLatest()
      Uses the latest remote hash as a reference to base the commit on.
      Returns:
      the builder instance
    • toBranch

      public org.projectnessie.versioned.Hash toBranch(org.projectnessie.versioned.BranchName branchName) throws org.projectnessie.versioned.ReferenceNotFoundException, org.projectnessie.versioned.ReferenceConflictException
      Pushes the commit to the branch.
      Parameters:
      branchName - the branch
      Returns:
      the hash associated with the commit
      Throws:
      org.projectnessie.versioned.ReferenceNotFoundException
      org.projectnessie.versioned.ReferenceConflictException