Class VolumeName
java.lang.Object
org.springframework.boot.buildpack.platform.docker.type.VolumeName
A Docker volume name.
- Since:
- 2.3.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> VolumeName
Factory method to create a newVolumeName
based on an object.static <S> VolumeName
Factory method to create a newVolumeName
based on an object.boolean
int
hashCode()
static VolumeName
Factory method to create aVolumeName
with a specific value.static VolumeName
Factory method to create a newVolumeName
with a random name.static VolumeName
Factory method to create a newVolumeName
with a random name.toString()
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
random
Factory method to create a newVolumeName
with a random name.- Parameters:
prefix
- the prefix to use with the random name- Returns:
- a randomly named volume
-
random
Factory method to create a newVolumeName
with a random name.- Parameters:
prefix
- the prefix to use with the random namerandomLength
- the number of chars in the random part of the name- Returns:
- a randomly volume reference
-
basedOn
Factory method to create a newVolumeName
based on an object. The resulting name will be based off a SHA-256 digest of the given object'stoString()
method.- Type Parameters:
S
- the source object type- Parameters:
source
- the source objectprefix
- the prefix to use with the volume namesuffix
- the suffix to use with the volume namedigestLength
- the number of chars in the digest part of the name- Returns:
- a name based off the image reference
-
basedOn
public static <S> VolumeName basedOn(S source, Function<S, String> nameExtractor, String prefix, String suffix, int digestLength) Factory method to create a newVolumeName
based on an object. The resulting name will be based off a SHA-256 digest of the given object's name.- Type Parameters:
S
- the source object type- Parameters:
source
- the source objectnameExtractor
- a method to extract the name of the objectprefix
- the prefix to use with the volume namesuffix
- the suffix to use with the volume namedigestLength
- the number of chars in the digest part of the name- Returns:
- a name based off the image reference
-
of
Factory method to create aVolumeName
with a specific value.- Parameters:
value
- the volume reference value- Returns:
- a new
VolumeName
instance
-