Enum JPrimitiveType.PrimitiveTypeKind
- java.lang.Object
-
- java.lang.Enum<JPrimitiveType.PrimitiveTypeKind>
-
- net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind
-
- All Implemented Interfaces:
Serializable
,Comparable<JPrimitiveType.PrimitiveTypeKind>
- Enclosing class:
- JPrimitiveType
public static enum JPrimitiveType.PrimitiveTypeKind extends Enum<JPrimitiveType.PrimitiveTypeKind>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @Nullable JPrimitiveType.PrimitiveTypeKind
fromName(String token)
Gets an enum constant from the token used to represent it in source, e.g.String
getSimpleName()
Class<?>
jvmRepr()
String
toString()
static JPrimitiveType.PrimitiveTypeKind
valueOf(String name)
Returns the enum constant of this type with the specified name.static JPrimitiveType.PrimitiveTypeKind[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final JPrimitiveType.PrimitiveTypeKind BOOLEAN
-
CHAR
public static final JPrimitiveType.PrimitiveTypeKind CHAR
-
BYTE
public static final JPrimitiveType.PrimitiveTypeKind BYTE
-
SHORT
public static final JPrimitiveType.PrimitiveTypeKind SHORT
-
INT
public static final JPrimitiveType.PrimitiveTypeKind INT
-
LONG
public static final JPrimitiveType.PrimitiveTypeKind LONG
-
FLOAT
public static final JPrimitiveType.PrimitiveTypeKind FLOAT
-
DOUBLE
public static final JPrimitiveType.PrimitiveTypeKind DOUBLE
-
-
Method Detail
-
values
public static JPrimitiveType.PrimitiveTypeKind[] 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 (JPrimitiveType.PrimitiveTypeKind c : JPrimitiveType.PrimitiveTypeKind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JPrimitiveType.PrimitiveTypeKind 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 nameNullPointerException
- if the argument is null
-
getSimpleName
public String getSimpleName()
-
toString
public String toString()
- Overrides:
toString
in classEnum<JPrimitiveType.PrimitiveTypeKind>
-
jvmRepr
public Class<?> jvmRepr()
-
fromName
public static @Nullable JPrimitiveType.PrimitiveTypeKind fromName(String token)
Gets an enum constant from the token used to represent it in source, e.g. "int" or "double". Note that "void" is not a valid primitive name in this API, and this would return null in this case.- Parameters:
token
- String token- Returns:
- A constant, or null if the string doesn't correspond to a primitive type
-
-