40
40
import static java .util .Objects .requireNonNull ;
41
41
42
42
/**
43
- * This is the common base class of all Java language enumeration types .
43
+ * This is the common base class of all Java language enumeration classes .
44
44
*
45
45
* More information about enums, including descriptions of the
46
46
* implicitly declared methods synthesized by the compiler, can be
47
47
* found in section {@jls 8.9} of <cite>The Java Language
48
48
* Specification</cite>.
49
49
*
50
- * Enumeration types are all serializable and receive special handling
50
+ * Enumeration classes are all serializable and receive special handling
51
51
* by the serialization mechanism. The serialized representation used
52
52
* for enum constants cannot be customized. Declarations of methods
53
53
* and fields that would otherwise interact with serialization are
59
59
* {@linkplain java.util.EnumSet set} and {@linkplain
60
60
* java.util.EnumMap map} implementations are available.
61
61
*
62
- * @param <E> The enum type subclass
62
+ * @param <E> The type of the enum subclass
63
63
* @serial exclude
64
64
* @author Josh Bloch
65
65
* @author Neal Gafter
71
71
* @since 1.5
72
72
*/
73
73
@ SuppressWarnings ("serial" ) // No serialVersionUID needed due to
74
- // special-casing of enum types .
74
+ // special-casing of enum classes .
75
75
public abstract class Enum <E extends Enum <E >>
76
76
implements Constable , Comparable <E >, Serializable {
77
77
/**
@@ -126,7 +126,7 @@ public final int ordinal() {
126
126
/**
127
127
* Sole constructor. Programmers cannot invoke this constructor.
128
128
* It is for use by code emitted by the compiler in response to
129
- * enum type declarations.
129
+ * enum class declarations.
130
130
*
131
131
* @param name - The name of this enum constant, which is the identifier
132
132
* used to declare it.
@@ -142,7 +142,7 @@ protected Enum(String name, int ordinal) {
142
142
/**
143
143
* Returns the name of this enum constant, as contained in the
144
144
* declaration. This method may be overridden, though it typically
145
- * isn't necessary or desirable. An enum type should override this
145
+ * isn't necessary or desirable. An enum class should override this
146
146
* method when a more "programmer-friendly" string form exists.
147
147
*
148
148
* @return the name of this enum constant
@@ -236,41 +236,41 @@ public final Optional<EnumDesc<E>> describeConstable() {
236
236
}
237
237
238
238
/**
239
- * Returns the enum constant of the specified enum type with the
239
+ * Returns the enum constant of the specified enum class with the
240
240
* specified name. The name must match exactly an identifier used
241
- * to declare an enum constant in this type . (Extraneous whitespace
241
+ * to declare an enum constant in this class . (Extraneous whitespace
242
242
* characters are not permitted.)
243
243
*
244
- * <p>Note that for a particular enum type {@code T}, the
244
+ * <p>Note that for a particular enum class {@code T}, the
245
245
* implicitly declared {@code public static T valueOf(String)}
246
246
* method on that enum may be used instead of this method to map
247
247
* from a name to the corresponding enum constant. All the
248
- * constants of an enum type can be obtained by calling the
248
+ * constants of an enum class can be obtained by calling the
249
249
* implicit {@code public static T[] values()} method of that
250
- * type .
250
+ * class .
251
251
*
252
- * @param <T> The enum type whose constant is to be returned
253
- * @param enumType the {@code Class} object of the enum type from which
252
+ * @param <T> The enum class whose constant is to be returned
253
+ * @param enumClass the {@code Class} object of the enum class from which
254
254
* to return a constant
255
255
* @param name the name of the constant to return
256
- * @return the enum constant of the specified enum type with the
256
+ * @return the enum constant of the specified enum class with the
257
257
* specified name
258
- * @throws IllegalArgumentException if the specified enum type has
258
+ * @throws IllegalArgumentException if the specified enum class has
259
259
* no constant with the specified name, or the specified
260
- * class object does not represent an enum type
261
- * @throws NullPointerException if {@code enumType } or {@code name}
260
+ * class object does not represent an enum class
261
+ * @throws NullPointerException if {@code enumClass } or {@code name}
262
262
* is null
263
263
* @since 1.5
264
264
*/
265
- public static <T extends Enum <T >> T valueOf (Class <T > enumType ,
265
+ public static <T extends Enum <T >> T valueOf (Class <T > enumClass ,
266
266
String name ) {
267
- T result = enumType .enumConstantDirectory ().get (name );
267
+ T result = enumClass .enumConstantDirectory ().get (name );
268
268
if (result != null )
269
269
return result ;
270
270
if (name == null )
271
271
throw new NullPointerException ("Name is null" );
272
272
throw new IllegalArgumentException (
273
- "No enum constant " + enumType .getCanonicalName () + "." + name );
273
+ "No enum constant " + enumClass .getCanonicalName () + "." + name );
274
274
}
275
275
276
276
/**
@@ -307,13 +307,13 @@ public static final class EnumDesc<E extends Enum<E>>
307
307
/**
308
308
* Constructs a nominal descriptor for the specified {@code enum} class and name.
309
309
*
310
- * @param constantType a {@link ClassDesc} describing the {@code enum} class
310
+ * @param constantClass a {@link ClassDesc} describing the {@code enum} class
311
311
* @param constantName the unqualified name of the enum constant
312
312
* @throws NullPointerException if any argument is null
313
313
* @jvms 4.2.2 Unqualified Names
314
314
*/
315
- private EnumDesc (ClassDesc constantType , String constantName ) {
316
- super (ConstantDescs .BSM_ENUM_CONSTANT , requireNonNull (constantName ), requireNonNull (constantType ));
315
+ private EnumDesc (ClassDesc constantClass , String constantName ) {
316
+ super (ConstantDescs .BSM_ENUM_CONSTANT , requireNonNull (constantName ), requireNonNull (constantClass ));
317
317
}
318
318
319
319
/**
0 commit comments