类 ApiVersion

java.lang.Object
cn.taketoday.buildpack.platform.build.ApiVersion

final class ApiVersion extends Object
API Version number comprised of a major and minor value.
从以下版本开始:
4.0
作者:
Phillip Webb, Scott Frederick, Harry Yang
  • 字段详细资料

    • PATTERN

      private static final Pattern PATTERN
    • major

      private final int major
    • minor

      private final int minor
  • 构造器详细资料

    • ApiVersion

      private ApiVersion(int major, int minor)
  • 方法详细资料

    • getMajor

      int getMajor()
      Return the major version number.
      返回:
      the major version
    • getMinor

      int getMinor()
      Return the minor version number.
      返回:
      the minor version
    • assertSupports

      void assertSupports(ApiVersion other)
      Assert that this API version supports the specified version.
      参数:
      other - the version to check against
      另请参阅:
    • supports

      boolean supports(ApiVersion other)
      Returns if this API version supports the given version. A 0.x matches only the same version number. A 1.x or higher release matches when the versions have the same major version and a minor that is equal or greater.
      参数:
      other - the version to check against
      返回:
      if the specified API version is supported
      另请参阅:
    • supportsAny

      boolean supportsAny(ApiVersion... others)
      Returns if this API version supports any of the given versions.
      参数:
      others - the versions to check against
      返回:
      if any of the specified API versions are supported
      另请参阅:
    • equals

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

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

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

      static ApiVersion parse(String value)
      Factory method to parse a string into an ApiVersion instance.
      参数:
      value - the value to parse.
      返回:
      the corresponding ApiVersion
      抛出:
      IllegalArgumentException - if the value could not be parsed
    • of

      static ApiVersion of(int major, int minor)