public final class VolumeName extends Object
Modifier and Type | Method and Description |
---|---|
static <S> VolumeName |
basedOn(S source,
Function<S,String> nameExtractor,
String prefix,
String suffix,
int digestLength)
Factory method to create a new
VolumeName based on an object. |
static <S> VolumeName |
basedOn(S source,
String prefix,
String suffix,
int digestLength)
Factory method to create a new
VolumeName based on an object. |
boolean |
equals(Object obj) |
int |
hashCode() |
static VolumeName |
of(String value)
Factory method to create a
VolumeName with a specific value. |
static VolumeName |
random(String prefix)
Factory method to create a new
VolumeName with a random name. |
static VolumeName |
random(String prefix,
int randomLength)
Factory method to create a new
VolumeName with a random name. |
String |
toString() |
public static VolumeName random(String prefix)
VolumeName
with a random name.prefix
- the prefix to use with the random namepublic static VolumeName random(String prefix, int randomLength)
VolumeName
with a random name.prefix
- the prefix to use with the random namerandomLength
- the number of chars in the random part of the namepublic static <S> VolumeName basedOn(S source, String prefix, String suffix, int digestLength)
VolumeName
based on an object. The resulting
name will be based off a SHA-256 digest of the given object's toString()
method.S
- the source object typesource
- 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 namepublic static <S> VolumeName basedOn(S source, Function<S,String> nameExtractor, String prefix, String suffix, int digestLength)
VolumeName
based on an object. The resulting
name will be based off a SHA-256 digest of the given object's name.S
- the source object typesource
- 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 namepublic static VolumeName of(String value)
VolumeName
with a specific value.value
- the volume reference valueVolumeName
instance