@Test(expected = IllegalArgumentException.class) public void testIllegalVersion() throws Exception { ClassFileVersion.ofMinorMajor(ClassFileVersion.BASE_VERSION); }
public static ClassFileVersion ofMinorMajor(int versionNumber) { ClassFileVersion classFileVersion = new ClassFileVersion(versionNumber); if (classFileVersion.getMajorVersion() <= BASE_VERSION) { throw new IllegalArgumentException("Class version " + versionNumber + " is not valid"); } return classFileVersion; }
ClassFileVersion implements Comparable<ClassFileVersion> { public static ClassFileVersion ofMinorMajor(int versionNumber) { ClassFileVersion classFileVersion = new ClassFileVersion(versionNumber); if (classFileVersion.getMajorVersion() <= BASE_VERSION) { throw new IllegalArgumentException("Class version " + versionNumber + " is not valid"); } return classFileVersion; } }
ClassFileVersion implements Comparable<ClassFileVersion> { public static ClassFileVersion ofMinorMajor(int versionNumber) { ClassFileVersion classFileVersion = new ClassFileVersion(versionNumber); if (classFileVersion.getMajorVersion() <= BASE_VERSION) { throw new IllegalArgumentException("Class version " + versionNumber + " is not valid"); } return classFileVersion; } protected  ClassFileVersion(int versionNumber); }
ClassFileVersion implements Comparable<ClassFileVersion> { public static ClassFileVersion ofMinorMajor(int versionNumber) { ClassFileVersion classFileVersion = new ClassFileVersion(versionNumber); if (classFileVersion.getMajorVersion() <= BASE_VERSION) { throw new IllegalArgumentException("Class version " + versionNumber + " is not valid"); } return classFileVersion; } protected  ClassFileVersion(int versionNumber); static ClassFileVersion ofMinorMajor(int versionNumber); static ClassFileVersion ofJavaVersionString(String javaVersionString); static ClassFileVersion ofJavaVersion(int javaVersion); @CachedReturnPlugin.Enhance static ClassFileVersion ofThisVm(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception should not be rethrown but trigger a fallback") static ClassFileVersion ofThisVm(ClassFileVersion fallback); static ClassFileVersion of(Class<?> type); static ClassFileVersion of(Class<?> type, ClassFileLocator classFileLocator); static ClassFileVersion of(TypeDescription typeDescription, ClassFileLocator classFileLocator); static ClassFileVersion ofClassFile(byte[] binaryRepresentation); int getMinorMajorVersion(); short getMajorVersion(); short getMinorVersion(); int getJavaVersion(); boolean isAtLeast(ClassFileVersion classFileVersion); boolean isGreaterThan(ClassFileVersion classFileVersion); boolean isAtMost(ClassFileVersion classFileVersion); boolean isLessThan(ClassFileVersion classFileVersion); ClassFileVersion asPreviewVersion(); boolean isPreviewVersion(); int compareTo(ClassFileVersion other); @Override String toString(); }
ClassFileVersion implements Comparable<ClassFileVersion> { public static ClassFileVersion ofMinorMajor(int versionNumber) { ClassFileVersion classFileVersion = new ClassFileVersion(versionNumber); if (classFileVersion.getMajorVersion() <= BASE_VERSION) { throw new IllegalArgumentException("Class version " + versionNumber + " is not valid"); } return classFileVersion; } protected  ClassFileVersion(int versionNumber); static ClassFileVersion ofMinorMajor(int versionNumber); static ClassFileVersion ofJavaVersionString(String javaVersionString); static ClassFileVersion ofJavaVersion(int javaVersion); @CachedReturnPlugin.Enhance static ClassFileVersion ofThisVm(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Exception should not be rethrown but trigger a fallback") static ClassFileVersion ofThisVm(ClassFileVersion fallback); static ClassFileVersion of(Class<?> type); static ClassFileVersion of(Class<?> type, ClassFileLocator classFileLocator); static ClassFileVersion of(TypeDescription typeDescription, ClassFileLocator classFileLocator); static ClassFileVersion ofClassFile(byte[] binaryRepresentation); int getMinorMajorVersion(); short getMajorVersion(); short getMinorVersion(); int getJavaVersion(); boolean isAtLeast(ClassFileVersion classFileVersion); boolean isGreaterThan(ClassFileVersion classFileVersion); boolean isAtMost(ClassFileVersion classFileVersion); boolean isLessThan(ClassFileVersion classFileVersion); ClassFileVersion asPreviewVersion(); boolean isPreviewVersion(); int compareTo(ClassFileVersion other); @Override String toString(); static final ClassFileVersion JAVA_V1; static final ClassFileVersion JAVA_V2; static final ClassFileVersion JAVA_V3; static final ClassFileVersion JAVA_V4; static final ClassFileVersion JAVA_V5; static final ClassFileVersion JAVA_V6; static final ClassFileVersion JAVA_V7; static final ClassFileVersion JAVA_V8; static final ClassFileVersion JAVA_V9; static final ClassFileVersion JAVA_V10; static final ClassFileVersion JAVA_V11; static final ClassFileVersion JAVA_V12; static final ClassFileVersion JAVA_V13; static final ClassFileVersion JAVA_V14; static final ClassFileVersion JAVA_V15; static final ClassFileVersion JAVA_V16; }