java.lang.Object
org.springframework.boot.buildpack.platform.docker.type.ApiVersion

public final class ApiVersion extends Object
API Version number comprised of a major and minor value.
Since:
3.4.0
Author:
Phillip Webb, Scott Frederick
  • Method Details

    • supports

      public 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.
      Parameters:
      other - the version to check against
      Returns:
      if the specified API version is supported
    • supportsAny

      public boolean supportsAny(ApiVersion... others)
      Returns if this API version supports any of the given versions.
      Parameters:
      others - the versions to check against
      Returns:
      if any of the specified API versions are supported
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • parse

      public static ApiVersion parse(String value)
      Factory method to parse a string into an ApiVersion instance.
      Parameters:
      value - the value to parse.
      Returns:
      the corresponding ApiVersion
      Throws:
      IllegalArgumentException - if the value could not be parsed
    • of

      public static ApiVersion of(int major, int minor)