Class CommitBuilder
java.lang.Object
org.projectnessie.versioned.tests.CommitBuilder
Helper to generate commits against a store.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(org.projectnessie.versioned.Operation operation) Adds an operation to the current commit.Adds a delete operation to the current commit.delete(org.projectnessie.model.ContentKey key) Adds a delete operation to the current commit.Uses the latest remote hash as a reference to base the commit on.fromReference(org.projectnessie.versioned.Hash reference) Sets a reference to base the commit on.Adds a put operation to the current commit.put(org.projectnessie.model.ContentKey key, org.projectnessie.model.Content value) Adds a put operation to the current commit.org.projectnessie.versioned.HashtoBranch(org.projectnessie.versioned.BranchName branchName) Pushes the commit to the branch.Adds an unchanged operation to the current commit.unchanged(org.projectnessie.model.ContentKey key) Adds an unchanged operation to the current commit.withMetadata(org.projectnessie.model.CommitMeta metadata) Sets metadata for the current commit.
-
Constructor Details
-
CommitBuilder
public CommitBuilder(org.projectnessie.versioned.VersionStore store)
-
-
Method Details
-
put
Adds a put operation to the current commit.- Parameters:
key- key's name to addvalue- 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 addvalue- the value associated with the key- Returns:
- the builder instance
-
delete
Adds a delete operation to the current commit.- Parameters:
key- key's name to delete- Returns:
- the builder instance
-
delete
Adds a delete operation to the current commit.- Parameters:
key- key to delete- Returns:
- the builder instance
-
unchanged
Adds an unchanged operation to the current commit.- Parameters:
key- key's name for the operation- Returns:
- the builder instance
-
unchanged
Adds an unchanged operation to the current commit.- Parameters:
key- key for the operation- Returns:
- the builder instance
-
add
Adds an operation to the current commit.- Parameters:
operation- operation to commit- Returns:
- the builder instance
-
withMetadata
Sets metadata for the current commit.- Parameters:
metadata- metadata to associate with the commit- Returns:
- the builder instance
-
fromReference
Sets a reference to base the commit on.- Parameters:
reference- the reference's hash- Returns:
- the builder instance
-
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.ReferenceNotFoundExceptionorg.projectnessie.versioned.ReferenceConflictException
-