java.lang.Object
cn.taketoday.buildpack.platform.docker.type.VolumeName

public final class VolumeName extends Object
A Docker volume name.
从以下版本开始:
4.0
作者:
Phillip Webb, Harry Yang
  • 字段详细资料

    • value

      private final String value
  • 构造器详细资料

    • VolumeName

      private VolumeName(String value)
  • 方法详细资料

    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • random

      public static VolumeName random(String prefix)
      Factory method to create a new VolumeName with a random name.
      参数:
      prefix - the prefix to use with the random name
      返回:
      a randomly named volume
    • random

      public static VolumeName random(String prefix, int randomLength)
      Factory method to create a new VolumeName with a random name.
      参数:
      prefix - the prefix to use with the random name
      randomLength - the number of chars in the random part of the name
      返回:
      a randomly named volume reference
    • basedOn

      public static <S> VolumeName basedOn(S source, String prefix, String suffix, int digestLength)
      Factory method to create a new 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 type
      参数:
      source - the source object
      prefix - the prefix to use with the volume name
      suffix - the suffix to use with the volume name
      digestLength - the number of chars in the digest part of the name
      返回:
      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 new 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 type
      参数:
      source - the source object
      nameExtractor - a method to extract the name of the object
      prefix - the prefix to use with the volume name
      suffix - the suffix to use with the volume name
      digestLength - the number of chars in the digest part of the name
      返回:
      a name based off the image reference
    • getDigest

      private static String getDigest(String name, int length)
    • asHexString

      private static String asHexString(byte[] digest, int digestLength)
    • of

      public static VolumeName of(String value)
      Factory method to create a VolumeName with a specific value.
      参数:
      value - the volume reference value
      返回:
      a new VolumeName instance