Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static ImageReference |
forJarFile(File jarFile)
Create a new
ImageReference instance deduced from a source JAR file that
follows common Java naming conventions. |
String |
getDigest()
Return the digest from the reference or
null . |
String |
getDomain()
Return the domain for this image name.
|
String |
getName()
Return the name of this image.
|
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. |
ImageReference |
inTaglessForm()
Return an
ImageReference without the tag. |
static ImageReference |
of(ImageName name)
Create a new
ImageReference from the given ImageName . |
static ImageReference |
of(ImageName name,
String tag)
Create a new
ImageReference from the given ImageName and tag. |
static ImageReference |
of(ImageName name,
String tag,
String digest)
Create a new
ImageReference from the given ImageName , tag and
digest. |
static ImageReference |
of(String value)
Create a new
ImageReference from the given value. |
static ImageReference |
random(String prefix)
Generate an image name with a random suffix.
|
static ImageReference |
random(String prefix,
int randomLength)
Generate an image name with a random suffix.
|
String |
toLegacyString() |
String |
toString() |
ImageReference |
withDigest(String digest)
Create a new
ImageReference with an updated digest. |
public String getDomain()
ImageName.getDomain()
public String getName()
ImageName.getName()
public String getTag()
null
.public String getDigest()
null
.public String toLegacyString()
public ImageReference withDigest(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.IllegalStateException
- if the image reference contains a digestpublic ImageReference inTaglessForm()
ImageReference
without the tag.public 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(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(String prefix)
prefix
- the name prefixpublic static ImageReference random(String prefix, int randomLength)
prefix
- the name prefixrandomLength
- the number of chars in the random part of the namepublic static ImageReference of(String value)
ImageReference
from the given value. The following value forms
can be used:
name
(maps to docker.io/library/name
)domain/name
domain:port/name
domain:port/name:tag
domain:port/name@digest
value
- the value to parseImageName
instancepublic static ImageReference of(ImageName name)
ImageReference
from the given ImageName
.name
- the image namepublic static ImageReference of(ImageName name, String tag)
ImageReference
from the given ImageName
and tag.name
- the image nametag
- the referenced tagpublic static ImageReference of(ImageName name, String tag, String digest)
ImageReference
from the given ImageName
, tag and
digest.name
- the image nametag
- the referenced tagdigest
- the referenced digest