Class HashValidator

java.lang.Object
org.projectnessie.services.hash.HashValidator

public final class HashValidator extends Object
  • Field Details

  • Constructor Details

    • HashValidator

      public HashValidator()
    • HashValidator

      public HashValidator(String hashDescription)
    • HashValidator

      public HashValidator(String refDescription, String hashDescription)
  • Method Details

    • validate

      public void validate(org.projectnessie.versioned.NamedRef namedRef, @Nullable org.projectnessie.services.hash.ParsedHash parsed)
      Validates the provided ref and hash.
      Parameters:
      namedRef - the namedRef, required.
      parsed - the parsed hash, or null if 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.