public final class VolumeName
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <S> VolumeName |
basedOn(S source,
java.util.function.Function<S,java.lang.String> nameExtractor,
java.lang.String prefix,
java.lang.String suffix,
int digestLength)
Factory method to create a new
VolumeName based on an object. |
static <S> VolumeName |
basedOn(S source,
java.lang.String prefix,
java.lang.String suffix,
int digestLength)
Factory method to create a new
VolumeName based on an object. |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
static VolumeName |
of(java.lang.String value)
Factory method to create a
VolumeName with a specific value. |
static VolumeName |
random(java.lang.String prefix)
Factory method to create a new
VolumeName with a random name. |
static VolumeName |
random(java.lang.String prefix,
int randomLength)
Factory method to create a new
VolumeName with a random name. |
java.lang.String |
toString() |
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 static VolumeName random(java.lang.String prefix)
VolumeName with a random name.prefix - the prefix to use with the random namepublic static VolumeName random(java.lang.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, java.lang.String prefix, java.lang.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, java.util.function.Function<S,java.lang.String> nameExtractor, java.lang.String prefix, java.lang.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(java.lang.String value)
VolumeName with a specific value.value - the volume reference valueVolumeName instance