public enum SourceLevel extends 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.supportsDiamondOperator() 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> |
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 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(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 com.google.common.base.Optional<QualifiedName> javaUtilObjects()
public boolean supportsDiamondOperator()
Copyright © 2016 Google, Inc.. All rights reserved.