Enum SourceLevel
- java.lang.Object
-
- java.lang.Enum<SourceLevel>
-
- org.inferred.freebuilder.processor.source.feature.SourceLevel
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<SourceLevel>,Feature<SourceLevel>
public enum SourceLevel extends java.lang.Enum<SourceLevel> implements Feature<SourceLevel>
Compliance levels which are idiomatically supported by this processor.SourceVersionis 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 thansourceVersion.compareTo(SourceLevel.RELEASE_7) >= 0.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description JAVA_8
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringhumanReadableFormatstatic FeatureType<SourceLevel>SOURCE_LEVELConstant to pass toSourceBuilder.feature(FeatureType)to get the currentSourceLevel.private intversion
-
Constructor Summary
Constructors Modifier Constructor Description privateSourceLevel(java.lang.String humanReadableFormat, int version)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>javacArguments()java.lang.StringtoString()static SourceLevelvalueOf(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.
-
-
-
Enum Constant Detail
-
JAVA_8
public static final SourceLevel JAVA_8
-
-
Field Detail
-
SOURCE_LEVEL
public static final FeatureType<SourceLevel> SOURCE_LEVEL
Constant to pass toSourceBuilder.feature(FeatureType)to get the currentSourceLevel.
-
humanReadableFormat
private final java.lang.String humanReadableFormat
-
version
private final int version
-
-
Method Detail
-
values
public static SourceLevel[] 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 (SourceLevel c : SourceLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SourceLevel 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 namejava.lang.NullPointerException- if the argument is null
-
javacArguments
public java.util.List<java.lang.String> javacArguments()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Enum<SourceLevel>
-
-