Class VolumeName
java.lang.Object
org.springframework.boot.buildpack.platform.docker.type.VolumeName
A Docker volume name.
- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> VolumeNameFactory method to create a newVolumeNamebased on an object.static <S> VolumeNameFactory method to create a newVolumeNamebased on an object.booleaninthashCode()static VolumeNameFactory method to create aVolumeNamewith a specific value.static VolumeNameFactory method to create a newVolumeNamewith a random name.static VolumeNameFactory method to create a newVolumeNamewith a random name.toString()
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
random
Factory method to create a newVolumeNamewith a random name.- Parameters:
prefix- the prefix to use with the random name- Returns:
- a randomly named volume
-
random
Factory method to create a newVolumeNamewith 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 named volume reference
-
basedOn
Factory method to create a newVolumeNamebased 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 newVolumeNamebased 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 aVolumeNamewith a specific value.- Parameters:
value- the volume reference value- Returns:
- a new
VolumeNameinstance
-