Package com.google.cloud.tools.jib.api
Class DescriptorDigest
- java.lang.Object
-
- com.google.cloud.tools.jib.api.DescriptorDigest
-
public class DescriptorDigest extends java.lang.Object
Represents a SHA-256 content descriptor digest as defined by the Registry HTTP API v2 reference.
-
-
Field Summary
Fields Modifier and Type Field Description static int
HASH_LENGTH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Two digest objects are equal if their digest strings are equal.static DescriptorDigest
fromDigest(java.lang.String digest)
Creates a new instance from a valid digest string.static DescriptorDigest
fromHash(java.lang.String hash)
Creates a new instance from a valid hash string.java.lang.String
getHash()
int
hashCode()
Pass-through hash code of the digest string.java.lang.String
toString()
-
-
-
Field Detail
-
HASH_LENGTH
public static final int HASH_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
fromHash
public static DescriptorDigest fromHash(java.lang.String hash) throws java.security.DigestException
Creates a new instance from a valid hash string.- Parameters:
hash
- the hash to generate theDescriptorDigest
from- Returns:
- a new
DescriptorDigest
created from the hash - Throws:
java.security.DigestException
- if the hash is invalid
-
fromDigest
public static DescriptorDigest fromDigest(java.lang.String digest) throws java.security.DigestException
Creates a new instance from a valid digest string.- Parameters:
digest
- the digest to generate theDescriptorDigest
from- Returns:
- a new
DescriptorDigest
created from the digest - Throws:
java.security.DigestException
- if the digest is invalid
-
getHash
public java.lang.String getHash()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
Pass-through hash code of the digest string.- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Two digest objects are equal if their digest strings are equal.- Overrides:
equals
in classjava.lang.Object
-
-