Class CommitBuilder
- java.lang.Object
-
- org.projectnessie.versioned.tests.CommitBuilder
-
public class CommitBuilder extends java.lang.ObjectHelper to generate commits against a store.
-
-
Constructor Summary
Constructors Constructor Description CommitBuilder(org.projectnessie.versioned.VersionStore store)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommitBuilderadd(org.projectnessie.versioned.Operation operation)Adds an operation to the current commit.CommitBuilderdelete(java.lang.String key)Adds a delete operation to the current commit.CommitBuilderdelete(org.projectnessie.versioned.Key key)Adds a delete operation to the current commit.CommitBuilderfromLatest()Uses the latest remote hash as a reference to base the commit on.CommitBuilderfromReference(org.projectnessie.versioned.Hash reference)Sets a reference to base the commit on.CommitBuilderput(java.lang.String key, org.projectnessie.model.Content value)Adds a put operation to the current commit.CommitBuilderput(java.lang.String key, org.projectnessie.model.Content value, org.projectnessie.model.Content expected)CommitBuilderput(org.projectnessie.versioned.Key key, org.projectnessie.model.Content value)Adds a put operation to the current commit.CommitBuilderput(org.projectnessie.versioned.Key key, org.projectnessie.model.Content value, org.projectnessie.model.Content expected)org.projectnessie.versioned.HashtoBranch(org.projectnessie.versioned.BranchName branchName)Pushes the commit to the branch.CommitBuilderunchanged(java.lang.String key)Adds an unchanged operation to the current commit.CommitBuilderunchanged(org.projectnessie.versioned.Key key)Adds an unchanged operation to the current commit.CommitBuilderwithMetadata(org.projectnessie.model.CommitMeta metadata)Sets metadata for the current commit.
-
-
-
Method Detail
-
put
public CommitBuilder put(java.lang.String key, org.projectnessie.model.Content value)
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(java.lang.String key, org.projectnessie.model.Content value, org.projectnessie.model.Content expected)
-
put
public CommitBuilder put(org.projectnessie.versioned.Key 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
-
put
public CommitBuilder put(org.projectnessie.versioned.Key key, org.projectnessie.model.Content value, org.projectnessie.model.Content expected)
-
delete
public CommitBuilder delete(java.lang.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.versioned.Key key)
Adds a delete operation to the current commit.- Parameters:
key- key to delete- Returns:
- the builder instance
-
unchanged
public CommitBuilder unchanged(java.lang.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.versioned.Key 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.ReferenceConflictExceptionPushes the commit to the branch.- Parameters:
branchName- the branch- Returns:
- the hash associated with the commit
- Throws:
org.projectnessie.versioned.ReferenceNotFoundExceptionorg.projectnessie.versioned.ReferenceConflictException
-
-