public final class ImageReference
extends java.lang.Object
"imagename[:tag|@digest]".ImageName| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static ImageReference |
forJarFile(java.io.File jarFile)
Create a new
ImageReference instance deduced from a source JAR file that
follows common Java naming conventions. |
java.lang.String |
getDigest()
Return the digest from the reference or
null. |
java.lang.String |
getDomain()
Return the domain for this image name.
|
java.lang.String |
getName()
Return the name of this image.
|
java.lang.String |
getTag()
Return the tag from the reference or
null. |
int |
hashCode() |
ImageReference |
inTaggedForm()
Return an
ImageReference in the form "imagename:tag". |
ImageReference |
inTaggedOrDigestForm()
Return an
ImageReference containing either a tag or a digest. |
static ImageReference |
of(ImageName name)
Create a new
ImageReference from the given ImageName. |
static ImageReference |
of(ImageName name,
java.lang.String tag)
Create a new
ImageReference from the given ImageName and tag. |
static ImageReference |
of(ImageName name,
java.lang.String tag,
java.lang.String digest)
Create a new
ImageReference from the given ImageName, tag and
digest. |
static ImageReference |
of(java.lang.String value)
Create a new
ImageReference from the given value. |
static ImageReference |
random(java.lang.String prefix)
Generate an image name with a random suffix.
|
static ImageReference |
random(java.lang.String prefix,
int randomLength)
Generate an image name with a random suffix.
|
java.lang.String |
toLegacyString() |
java.lang.String |
toString() |
ImageReference |
withDigest(java.lang.String digest)
Create a new
ImageReference with an updated digest. |
public java.lang.String getDomain()
ImageName.getDomain()public java.lang.String getName()
ImageName.getName()public java.lang.String getTag()
null.public java.lang.String getDigest()
null.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toLegacyString()
public ImageReference withDigest(java.lang.String digest)
ImageReference with an updated digest.digest - the new digestpublic ImageReference inTaggedForm()
ImageReference in the form "imagename:tag". If the tag
has not been defined then latest is used.java.lang.IllegalStateException - if the image reference contains a digestpublic ImageReference inTaggedOrDigestForm()
ImageReference containing either a tag or a digest. If neither
the digest nor the tag has been defined then tag latest is used.public static ImageReference forJarFile(java.io.File jarFile)
ImageReference instance deduced from a source JAR file that
follows common Java naming conventions.jarFile - the source jar fileImageName for the jar file.public static ImageReference random(java.lang.String prefix)
prefix - the name prefixpublic static ImageReference random(java.lang.String prefix, int randomLength)
prefix - the name prefixrandomLength - the number of chars in the random part of the namepublic static ImageReference of(java.lang.String value)
ImageReference from the given value. The following value forms
can be used:
name (maps to docker.io/library/name)domain/namedomain:port/namedomain:port/name:tagdomain:port/name@digestvalue - the value to parseImageName instancepublic static ImageReference of(ImageName name)
ImageReference from the given ImageName.name - the image namepublic static ImageReference of(ImageName name, java.lang.String tag)
ImageReference from the given ImageName and tag.name - the image nametag - the referenced tagpublic static ImageReference of(ImageName name, java.lang.String tag, java.lang.String digest)
ImageReference from the given ImageName, tag and
digest.name - the image nametag - the referenced tagdigest - the referenced digest