public ImageReference withQualifier(String newQualifier) {
    if (isValidDigest(newQualifier)) {
      return ImageReference.of(registry, repository, tag, newQualifier);
    }
    return ImageReference.of(registry, repository, newQualifier, digest);
  }
Gets an {@link ImageReference} with the same registry and repository, but a different tag or
digest.

@param newQualifier the new tag or digest
@return an {@link ImageReference} with the same registry/repository and the new tag or digest
jib-core/src/main/java/com/google/cloud/tools/jib/api/ImageReference.java