3535
3636/**
3737 * Encapsulates a Java {@link java.lang.reflect.Type}, providing access to
38- * {@link #getSuperType() supertypes} , {@link #getInterfaces() interfaces} and
38+ * {@link #getSuperType() supertypes}, {@link #getInterfaces() interfaces}, and
3939 * {@link #getGeneric(int...) generic parameters} along with the ability to ultimately
4040 * {@link #resolve() resolve} to a {@link java.lang.Class}.
4141 *
4242 * <p>{@code ResolvableTypes} may be obtained from {@link #forField(Field) fields},
4343 * {@link #forMethodParameter(Method, int) method parameters},
44- * {@link #forMethodReturn(Method) method returns}, {@link #forClass(Class) classes} or
44+ * {@link #forMethodReturn(Method) method returns}, {@link #forClass(Class) classes}, or
4545 * directly from a {@link #forType(Type) java.lang.reflect.Type}. Most methods on this class
4646 * will themselves return {@link ResolvableType}s, allowing easy navigation. For example:
4747 * <pre class="code">
@@ -90,7 +90,7 @@ public final class ResolvableType implements TypeVariableResolver {
9090 private final Type type ;
9191
9292 /**
93- * The {@link TypeVariableResolver} to use or {@code null} if no resolver is availble .
93+ * The {@link TypeVariableResolver} to use or {@code null} if no resolver is available .
9494 */
9595 private final TypeVariableResolver variableResolver ;
9696
@@ -241,10 +241,10 @@ public ResolvableType asMap() {
241241 * Return this type as a {@link ResolvableType} of the specified class. Searches
242242 * {@link #getSuperType() supertype} and {@link #getInterfaces() interface}
243243 * hierarchies to find a match, returning {@link #NONE} if this type does not
244- * implement or extends the specified class.
244+ * implement or extend the specified class.
245245 * @param type the required class type
246- * @return a {@link ResolvableType} representing this object as the specified type or
247- * {@link #NONE}
246+ * @return a {@link ResolvableType} representing this object as the specified
247+ * type or {@link #NONE}
248248 * @see #asCollection()
249249 * @see #asMap()
250250 * @see #getSuperType()
@@ -308,7 +308,7 @@ public boolean hasGenerics() {
308308 }
309309
310310 /**
311- * Returns a {@link ResolvableType} for the specified nesting level. See
311+ * Return a {@link ResolvableType} for the specified nesting level. See
312312 * {@link #getNested(int, Map)} for details.
313313 * @param nestingLevel the nesting level
314314 * @return the {@link ResolvableType} type, or {@code #NONE}
@@ -318,27 +318,27 @@ public ResolvableType getNested(int nestingLevel) {
318318 }
319319
320320 /**
321- * Returns a {@link ResolvableType} for the specified nesting level. The nesting level
321+ * Return a {@link ResolvableType} for the specified nesting level. The nesting level
322322 * refers to the specific generic parameter that should be returned. A nesting level
323- * of 1 indicates this type, 2 indicates the first nested generic, 3 the second and so
323+ * of 1 indicates this type; 2 indicates the first nested generic; 3 the second; and so
324324 * on. For example, given {@code List<Set<Integer>>} level 1 refers to the
325- * {@code List}, level 2 the {@code Set} and level 3 the {@code Integer}.
325+ * {@code List}, level 2 the {@code Set}, and level 3 the {@code Integer}.
326326 *
327327 * <p>The {@code typeIndexesPerLevel} map can be used to reference a specific generic
328- * for the given level. For example, an index of 0 would refer to a {@code Map} key,
329- * where as 1 would refer to the value. If the map does not contain an value for a
328+ * for the given level. For example, an index of 0 would refer to a {@code Map} key;
329+ * whereas, 1 would refer to the value. If the map does not contain a value for a
330330 * specific level the last generic will be used (e.g. a {@code Map} value).
331331 *
332- * <p>Nesting levels may also apply to array types, for example given
333- * {@code String[]}, a nesting level of 2 referes to {@code String}.
332+ * <p>Nesting levels may also apply to array types; for example given
333+ * {@code String[]}, a nesting level of 2 refers to {@code String}.
334334 *
335335 * <p>If a type does not {@link #hasGenerics() contain} generics the
336- * {@link #getSuperType() super-type } hierarchy will be considered.
336+ * {@link #getSuperType() supertype } hierarchy will be considered.
337337 * @param nestingLevel the required nesting level, indexed from 1 for the current
338- * type, 2 for the first nested generic, 3 for the second and so on.
338+ * type, 2 for the first nested generic, 3 for the second and so on
339339 * @param typeIndexesPerLevel a map containing the generic index for a given nesting
340- * level (may be {@code null}).
341- * @return a {@link ResolvableType} for the nested level or {@link #NONE}.
340+ * level (may be {@code null})
341+ * @return a {@link ResolvableType} for the nested level or {@link #NONE}
342342 */
343343 public ResolvableType getNested (int nestingLevel ,
344344 Map <Integer , Integer > typeIndexesPerLevel ) {
@@ -363,16 +363,16 @@ public ResolvableType getNested(int nestingLevel,
363363
364364 /**
365365 * Return a {@link ResolvableType} representing the generic parameter for the given
366- * indexes. Indexes are zero based, for example given the type
366+ * indexes. Indexes are zero based; for example given the type
367367 * {@code Map<Integer, List<String>>}, {@code getGeneric(0)} will access the
368- * {@code Integer}. Nested generics can be accessed by specifying multiple indexes,
368+ * {@code Integer}. Nested generics can be accessed by specifying multiple indexes;
369369 * for example {@code getGeneric(1, 0)} will access the {@code String} from the nested
370370 * {@code List}. For convenience, if no indexes are specified the first generic is
371371 * returned.
372372 *
373373 * <p>If no generic is available at the specified indexes {@link #NONE} is returned.
374- * @param indexes the indexes that refers to the generic parameter (may be omitted to
375- * return the first generic)
374+ * @param indexes the indexes that refer to the generic parameter (may be omitted to
375+ * return the first generic)
376376 * @return a {@link ResolvableType} for the specified generic or {@link #NONE}
377377 * @see #hasGenerics()
378378 * @see #getGenerics()
@@ -396,13 +396,13 @@ public ResolvableType getGeneric(int... indexes) {
396396 }
397397
398398 /**
399- * Return an array of {@link ResolvableType} representing the generics parameters of
399+ * Return an array of {@link ResolvableType}s representing the generic parameters of
400400 * this type. If no generics are available an empty array is returned. If you need to
401401 * access a specific generic consider using the {@link #getGeneric(int...)} method as
402- * it allows access to nested generics, and protects against
403- * {@code IndexOutOfBoundsExceptions}
402+ * it allows access to nested generics and protects against
403+ * {@code IndexOutOfBoundsExceptions}.
404404 * @return an array of {@link ResolvableType}s representing the generic parameters
405- * (never {@code null})
405+ * (never {@code null})
406406 * @see #hasGenerics()
407407 * @see #getGeneric(int...)
408408 * @see #resolveGeneric(int...)
@@ -427,7 +427,7 @@ public ResolvableType[] getGenerics() {
427427 * Convenience method that will {@link #getGenerics() get} and {@link #resolve()
428428 * resolve} generic parameters.
429429 * @return an array of resolved generic parameters (the resulting array will never be
430- * {@code null}, but it may contain {@code null} elements})
430+ * {@code null}, but it may contain {@code null} elements})
431431 * @see #getGenerics()
432432 * @see #resolve()
433433 */
@@ -443,8 +443,8 @@ public Class<?>[] resolveGenerics() {
443443 /**
444444 * Convenience method that will {@link #getGeneric(int...) get} and
445445 * {@link #resolve() resolve} a specific generic parameters.
446- * @param indexes the indexes that refers to the generic parameter (may be omitted to
447- * return the first generic)
446+ * @param indexes the indexes that refer to the generic parameter (may be omitted to
447+ * return the first generic)
448448 * @return a resolved {@link Class} or {@code null}
449449 * @see #getGeneric(int...)
450450 * @see #resolve()
@@ -456,7 +456,7 @@ public Class<?> resolveGeneric(int... indexes) {
456456 /**
457457 * Resolve this type to a {@link java.lang.Class}, returning {@code null} if the type
458458 * cannot be resolved. This method will consider bounds of {@link TypeVariable}s and
459- * {@link WildcardType}s if direct resolution fails, however, bounds of Object.class
459+ * {@link WildcardType}s if direct resolution fails; however, bounds of Object.class
460460 * will be ignored.
461461 * @return the resolved {@link Class} or {@code null}
462462 * @see #resolve(Class)
@@ -470,7 +470,7 @@ public Class<?> resolve() {
470470 /**
471471 * Resolve this type to a {@link java.lang.Class}, returning the specified
472472 * {@code fallback} if the type cannot be resolved. This method will consider bounds
473- * of {@link TypeVariable}s and {@link WildcardType}s if direct resolution fails,
473+ * of {@link TypeVariable}s and {@link WildcardType}s if direct resolution fails;
474474 * however, bounds of Object.class will be ignored.
475475 * @param fallback the fallback class to use if resolution fails (may be {@code null})
476476 * @return the resolved {@link Class} or the {@code fallback}
@@ -623,7 +623,7 @@ public static ResolvableType forClass(Class<?> sourceClass) {
623623 * @param sourceClass the source class (must not be {@code null}
624624 * @param implementationClass the implementation class (must not be {@code null})
625625 * @return a {@link ResolvableType} for the specified class backed by the given
626- * implementation class
626+ * implementation class
627627 * @see #forClass(Class)
628628 */
629629 public static ResolvableType forClass (Class <?> sourceClass , Class <?> implementationClass ) {
@@ -807,7 +807,7 @@ public static ResolvableType forType(Type type) {
807807 * @param type the source type (must not be {@code null})
808808 * @param variableResolver the variable resolver
809809 * @return a {@link ResolvableType} for the specified {@link java.lang.reflect.Type}
810- * and {@link TypeVariableResolver}
810+ * and {@link TypeVariableResolver}
811811 */
812812 public static ResolvableType forType (Type type , TypeVariableResolver variableResolver ) {
813813 ResolvableType key = new ResolvableType (type , variableResolver );
0 commit comments