Class VersionInfo

java.lang.Object
org.springframework.credhub.support.info.VersionInfo

public class VersionInfo extends Object
Version information about a CredHub server, as reported by the server's /version endpoint. This reflects the server's own release version number, not CredHub's URL-path API versioning (/api/v1/... vs /api/v2/...) — for example, a server whose reported version is 2.6.0 still serves many /api/v1/... endpoints.
Author:
Scott Frederick
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new VersionInfo containing the specified version string.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the value of the version string returned from the CredHub server.
    boolean
    Determine if the CredHub server's reported release version is 1.x.
    boolean
    Determine if the CredHub server's reported release version is 2.x.
    boolean
    Determine if the CredHub server's reported release version is 2.0.x.
    boolean
    Determine if the CredHub server's reported release version is 2.1.x.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VersionInfo

      public VersionInfo(String version)
      Create a new VersionInfo containing the specified version string. Intended for internal use. Clients will get VersionInfo objects populated from CredHub responses.
      Parameters:
      version - a version string
  • Method Details

    • getVersion

      public String getVersion()
      Get the value of the version string returned from the CredHub server.
      Returns:
      the version string
    • isVersion1

      public boolean isVersion1()
      Determine if the CredHub server's reported release version is 1.x.
      Returns:
      true if the server's reported release version starts with 1.; false otherwise
    • isVersion2

      public boolean isVersion2()
      Determine if the CredHub server's reported release version is 2.x.
      Returns:
      true if the server's reported release version starts with 2.; false otherwise
    • isVersion2_0

      public boolean isVersion2_0()
      Determine if the CredHub server's reported release version is 2.0.x.
      Returns:
      true if the server's reported release version starts with 2.0; false otherwise
    • isVersion2_1

      public boolean isVersion2_1()
      Determine if the CredHub server's reported release version is 2.1.x.
      Returns:
      true if the server's reported release version starts with 2.1; false otherwise