public enum SourceLevel extends Enum<SourceLevel>
SourceVersion is problematic to use, as the constants themselves will be missing
on compilers that do not support them (e.g. "RELEASE_8" is not available on javac v6 or v7).
Additionally, sourceLevel.supportsDiamondOperator() is far more readable than
sourceVersion.compareTo(SourceLevel.RELEASE_7) >= 0.
| Modifier and Type | Method and Description |
|---|---|
static SourceLevel |
from(SourceVersion sourceVersion) |
com.google.common.base.Optional<QualifiedName> |
javaUtilObjects() |
boolean |
supportsDiamondOperator() |
static SourceLevel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SourceLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SourceLevel JAVA_6
public static final SourceLevel JAVA_7
public static SourceLevel[] values()
for (SourceLevel c : SourceLevel.values()) System.out.println(c);
public static SourceLevel valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static SourceLevel from(SourceVersion sourceVersion)
public com.google.common.base.Optional<QualifiedName> javaUtilObjects()
public boolean supportsDiamondOperator()
Copyright © 2016 Google, Inc.. All rights reserved.