Enum JavaSEPlatform

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<JavaSEPlatform>

    public enum JavaSEPlatform
    extends java.lang.Enum<JavaSEPlatform>
    implements java.lang.Comparable<JavaSEPlatform>
    Java SE platforms supported by EclipseLink.
    Author:
    Tomas Kraus, Peter Benedikovic
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JavaSEPlatform.Version  
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      v1_1
      Java SE 1.1.
      v1_2
      Java SE 1.2.
      v1_3
      Java SE 1.3.
      v1_4
      Java SE 1.4.
      v1_5
      Java SE 1.5.
      v1_6
      Java SE 1.6.
      v1_7
      Java SE 1.7.
      v1_8
      Java SE 1.8.
      v10_0
      Java SE 10.
      v11_0
      Java SE 11.
      v12_0
      Java SE 12.
      v13_0
      Java SE 13.
      v14_0
      Java SE 14.
      v9_0
      Java SE 9.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean atLeast​(JavaSEPlatform platform)
      Check whether current Java SE is at least (greater or equal) provided platform.
      JavaSEPlatform.Version[] getAdditionalVersions()
      Get additional version numbers.
      int getMajor()
      Get major version number.
      int getMinor()
      Get minor version number.
      boolean gte​(JavaSEPlatform platform)
      Check if this platform is equal or greater to specified platform.
      static boolean is​(JavaSEPlatform platform)
      Check whether current Java SE is exactly matching provided platform.
      boolean isSupported()
      Check whether this platform is supported platform.
      java.lang.String toString()
      Return Java SE platform version as human readable String.
      static JavaSEPlatform toValue​(int major, int minor)
      Returns a JavaSEPlatform matching provided major and minor version numbers.
      static JavaSEPlatform toValue​(java.lang.String platformName)
      Returns a JavaSEPlatform with a value represented by the specified String.
      static JavaSEPlatform valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static JavaSEPlatform[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      java.lang.String versionString()
      Return computer readable String containing version numbers in <major> '.' <minor> format.
      static java.lang.String versionString​(int major, int minor)
      Generate String containing minor and major version numbers in <major> '.' <minor> format.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Field Detail

      • LENGTH

        public static final int LENGTH
        GlassFish Java SE platform enumeration length.
      • MIN_SUPPORTED

        public static final JavaSEPlatform MIN_SUPPORTED
        Lowest supported Java SE platform. Currently it's Java SE 1.8.
      • CURRENT

        public static final JavaSEPlatform CURRENT
        Current Java SE platform.
    • Method Detail

      • values

        public static JavaSEPlatform[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (JavaSEPlatform c : JavaSEPlatform.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JavaSEPlatform valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • is

        public static boolean is​(JavaSEPlatform platform)
        Check whether current Java SE is exactly matching provided platform.
        Parameters:
        platform - Java SE platform to compare with.
      • atLeast

        public static boolean atLeast​(JavaSEPlatform platform)
        Check whether current Java SE is at least (greater or equal) provided platform.
        Parameters:
        platform - Java SE platform to compare with.
      • toValue

        public static JavaSEPlatform toValue​(java.lang.String platformName)
        Returns a JavaSEPlatform with a value represented by the specified String. The JavaSEPlatform returned represents existing value only if specified String matches any String returned by versionString() method. Otherwise null value is returned.
        Parameters:
        platformName - Value containing JavaSEPlatform versionString representation.
        Returns:
        JavaSEPlatform value represented by String or null if value was not recognized.
      • toValue

        public static JavaSEPlatform toValue​(int major,
                                             int minor)
        Returns a JavaSEPlatform matching provided major and minor version numbers.
        Parameters:
        major - Major version number.
        minor - Minor version number.
        Returns:
        JavaSEPlatform value matching provided major and minor version numbers. JavaSEPlatform.DEFAULT value is returned for unknown Java SE version numbers.
      • versionString

        public static final java.lang.String versionString​(int major,
                                                           int minor)
        Generate String containing minor and major version numbers in <major> '.' <minor> format.
        Parameters:
        major - Major version number.
        minor - Minor version number.
        Returns:
        Generated String
      • getMajor

        public final int getMajor()
        Get major version number.
        Returns:
        Major version number.
      • getMinor

        public final int getMinor()
        Get minor version number.
        Returns:
        Minor version number.
      • getAdditionalVersions

        public final JavaSEPlatform.Version[] getAdditionalVersions()
        Get additional version numbers.
        Returns:
        an array of additional version numbers if exist or null if no additional version numbers are defined.
      • gte

        public boolean gte​(JavaSEPlatform platform)
        Check if this platform is equal or greater to specified platform.
        Parameters:
        platform - Platform to compare with.
        Returns:
        Value of true if this platform is equal or greater to specified platform or false otherwise.
      • isSupported

        public boolean isSupported()
        Check whether this platform is supported platform.
        Returns:
        Value of true when this platform is supported platform or false otherwise.
      • versionString

        public java.lang.String versionString()
        Return computer readable String containing version numbers in <major> '.' <minor> format.
        Returns:
        computer readable String containing version numbers
      • toString

        public java.lang.String toString()
        Return Java SE platform version as human readable String.
        Overrides:
        toString in class java.lang.Enum<JavaSEPlatform>
        Returns:
        Java SE platform version as human readable String.