Interface RestAPIVersion<T extends RestAPIVersion<T>>

All Superinterfaces:
Comparable<T>
All Known Implementing Classes:
RuntimeRestAPIVersion

public interface RestAPIVersion<T extends RestAPIVersion<T>> extends Comparable<T>
Interface for all versions of the REST API.
  • Method Details

    • getURLVersionPrefix

      String getURLVersionPrefix()
      Returns the URL version prefix (e.g. "v1") for this version.
      Returns:
      URL version prefix
    • isDefaultVersion

      boolean isDefaultVersion()
      Returns whether this version is the default REST API version.
      Returns:
      whether this version is the default
    • isStableVersion

      boolean isStableVersion()
      Returns whether this version is considered stable.
      Returns:
      whether this version is stable
    • getLatestVersion

      static <E extends RestAPIVersion<E>> E getLatestVersion(Collection<E> versions)
      Accept versions and one of them as a comparator, and get the latest one.
      Returns:
      latest version that implement RestAPIVersion interface>