Class ContentfulUserAgentHeaderInterceptor.Section.Version

    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int patch)
        Create a release version, omitting stability
        Parameters:
        major - How many breaking changes did this version release?
        minor - How many additional backwards compatible changes were added?
        patch - How many bugs were fixed in the release?
        See Also:
        parse(String)
      • Version

        public Version​(int major,
                       int minor,
                       int patch,
                       java.lang.String stability)
        Create a version including a stability.
        Parameters:
        major - How many breaking changes did this version release?
        minor - How many additional backwards compatible changes were added?
        patch - How many bugs were fixed in the release?
        stability - Is this a stable version(null) or is this not (dev, BETA, …)?
        See Also:
        parse(String)
    • Method Detail

      • parse

        public static ContentfulUserAgentHeaderInterceptor.Section.Version parse​(java.lang.String version)
        Convert a version into a Semver and Contentful conform version number.

        A valid version string would be one similar to

        • 0.9.7
        • 1.0.0
        • 1.3.4
        • 0.2.6-beta
        • 0.2.6-beta1
        • 1.0.3-RC43
        Parameters:
        version - with 3 numbers for major, minor, patch and stability (dev, BETA3, etc)
        Returns:
        a version of (1, 2, 3, dev), or null if a parsing error occurred.
        See Also:
        Semver.org
      • getMajor

        public int getMajor()
        Returns:
        major version part.
      • getMinor

        public int getMinor()
        Returns:
        minor version part.
      • getPatch

        public int getPatch()
        Returns:
        patch part.
      • getStability

        public java.lang.String getStability()
        Returns:
        stability or null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        version into a human and machine readable String.