public enum SourceLevel extends java.lang.Enum<SourceLevel> implements Feature<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.javaUtilObjects().isPresent() is far more readable than
sourceVersion.compareTo(SourceLevel.RELEASE_7) >= 0.
| Modifier and Type | Field and Description |
|---|---|
static FeatureType<SourceLevel> |
SOURCE_LEVEL
Constant to pass to
SourceBuilder.feature(FeatureType) to get the current
SourceLevel. |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.base.Optional<QualifiedName> |
baseStream() |
static Excerpt |
diamondOperator(java.lang.Object type) |
boolean |
hasLambdas() |
com.google.common.base.Optional<QualifiedName> |
javaUtilObjects() |
com.google.common.base.Optional<QualifiedName> |
safeVarargs() |
com.google.common.base.Optional<QualifiedName> |
spliterator() |
com.google.common.base.Optional<QualifiedName> |
stream() |
java.lang.String |
toString() |
static SourceLevel |
valueOf(java.lang.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 final SourceLevel JAVA_8
public static final FeatureType<SourceLevel> SOURCE_LEVEL
SourceBuilder.feature(FeatureType) to get the current
SourceLevel.public static SourceLevel[] values()
for (SourceLevel c : SourceLevel.values()) System.out.println(c);
public static SourceLevel valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static Excerpt diamondOperator(java.lang.Object type)
public com.google.common.base.Optional<QualifiedName> safeVarargs()
public com.google.common.base.Optional<QualifiedName> javaUtilObjects()
public boolean hasLambdas()
public com.google.common.base.Optional<QualifiedName> baseStream()
public com.google.common.base.Optional<QualifiedName> stream()
public com.google.common.base.Optional<QualifiedName> spliterator()
public java.lang.String toString()
toString in class java.lang.Enum<SourceLevel>