Enum SourceLevel

java.lang.Object
java.lang.Enum<SourceLevel>
org.inferred.freebuilder.processor.source.feature.SourceLevel
All Implemented Interfaces:
Serializable, Comparable<SourceLevel>, java.lang.constant.Constable, Feature<SourceLevel>

public enum SourceLevel extends Enum<SourceLevel> implements Feature<SourceLevel>
Compliance levels which are idiomatically supported by this processor.

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.

  • Enum Constant Details

  • Field Details

  • Constructor Details

    • SourceLevel

      private SourceLevel(String humanReadableFormat, int version)
  • Method Details

    • values

      public static SourceLevel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SourceLevel valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • javacArguments

      public List<String> javacArguments()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SourceLevel>