Package org.projectnessie.services.hash
Class HashValidator
- java.lang.Object
-
- org.projectnessie.services.hash.HashValidator
-
public final class HashValidator extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static HashValidatorDEFAULT
-
Constructor Summary
Constructors Constructor Description HashValidator()HashValidator(java.lang.String hashDescription)HashValidator(java.lang.String refDescription, java.lang.String hashDescription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashValidatorhashMustBeUnambiguous()Validates that a hash is unambiguous.HashValidatorrefMustBeBranch()Validates that a named ref is a branch.HashValidatorrefMustBeBranchOrTag()Validates that a named ref is a branch or a tag.voidvalidate(org.projectnessie.versioned.NamedRef namedRef, org.projectnessie.services.hash.ParsedHash parsed)Validates the provided ref and hash.
-
-
-
Field Detail
-
DEFAULT
public static final HashValidator DEFAULT
-
-
Method Detail
-
validate
public void validate(org.projectnessie.versioned.NamedRef namedRef, @Nullable @Nullable org.projectnessie.services.hash.ParsedHash parsed)Validates the provided ref and hash.- Parameters:
namedRef- the namedRef, required.parsed- the parsed hash, ornullif no hash was provided.
-
refMustBeBranch
@CanIgnoreReturnValue public HashValidator refMustBeBranch()
Validates that a named ref is a branch.
-
refMustBeBranchOrTag
@CanIgnoreReturnValue public HashValidator refMustBeBranchOrTag()
Validates that a named ref is a branch or a tag.
-
hashMustBeUnambiguous
@CanIgnoreReturnValue public HashValidator hashMustBeUnambiguous()
Validates that a hash is unambiguous. A hash is unambiguous if it is present and starts with an absolute part, because it will always resolve to the same hash, even if it also has relative parts.
-
-