Enum AsmTest.PrecompiledClass

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<AsmTest.PrecompiledClass>
    Enclosing class:
    AsmTest

    public static enum AsmTest.PrecompiledClass
    extends java.lang.Enum<AsmTest.PrecompiledClass>
    A precompiled class, hand-crafted to contain some set of class file structures. These classes are not compiled as part of the build. Instead, they have been compiled beforehand, with the appropriate JDKs (including some now very hard to download and install).
    • Field Detail

      • name

        private final java.lang.String name
      • bytes

        private byte[] bytes
    • Constructor Detail

      • PrecompiledClass

        private PrecompiledClass​(java.lang.String name)
    • Method Detail

      • values

        public static AsmTest.PrecompiledClass[] 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 (AsmTest.PrecompiledClass c : AsmTest.PrecompiledClass.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AsmTest.PrecompiledClass 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
      • getName

        public java.lang.String getName()
        Returns the fully qualified name of this class.
        Returns:
        the fully qualified name of this class.
      • getInternalName

        public java.lang.String getInternalName()
        Returns the internal name of this class.
        Returns:
        the internal name of this class.
      • isMoreRecentThan

        public boolean isMoreRecentThan​(AsmTest.Api api)
        Returns true if this class was compiled with a JDK which is more recent than the given ASM API. For instance, returns true for a class compiled with the JDK 1.8 if the ASM API version is ASM4.
        Parameters:
        api - an ASM API version.
        Returns:
        whether this class was compiled with a JDK which is more recent than api.
      • isMoreRecentThanCurrentJdk

        public boolean isMoreRecentThanCurrentJdk()
        Returns true if this class was compiled with a JDK which is more recent than the JDK used to run the tests.
        Returns:
        true if this class was compiled with the JDK9 and the current JDK version is strictly less than 9.
      • getBytes

        public byte[] getBytes()
        Returns the content of this class.
        Returns:
        the content of this class.