Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -226,8 +226,8 @@ public abstract class BridgeMethodResolver {
|
||||
if (bridgeMethod == bridgedMethod) {
|
||||
return true;
|
||||
}
|
||||
return (Arrays.equals(bridgeMethod.getParameterTypes(), bridgedMethod.getParameterTypes()) &&
|
||||
bridgeMethod.getReturnType().equals(bridgedMethod.getReturnType()));
|
||||
return (bridgeMethod.getReturnType().equals(bridgedMethod.getReturnType()) &&
|
||||
Arrays.equals(bridgeMethod.getParameterTypes(), bridgedMethod.getParameterTypes()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -559,8 +559,8 @@ public class ResolvableType implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link ResolvableType} for the specified nesting level. See
|
||||
* {@link #getNested(int, Map)} for details.
|
||||
* Return a {@link ResolvableType} for the specified nesting level.
|
||||
* See {@link #getNested(int, Map)} for details.
|
||||
* @param nestingLevel the nesting level
|
||||
* @return the {@link ResolvableType} type, or {@code #NONE}
|
||||
*/
|
||||
@@ -569,11 +569,11 @@ public class ResolvableType implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link ResolvableType} for the specified nesting level. The nesting level
|
||||
* refers to the specific generic parameter that should be returned. A nesting level
|
||||
* of 1 indicates this type; 2 indicates the first nested generic; 3 the second; and so
|
||||
* on. For example, given {@code List<Set<Integer>>} level 1 refers to the
|
||||
* {@code List}, level 2 the {@code Set}, and level 3 the {@code Integer}.
|
||||
* Return a {@link ResolvableType} for the specified nesting level.
|
||||
* <p>The nesting level refers to the specific generic parameter that should be returned.
|
||||
* A nesting level of 1 indicates this type; 2 indicates the first nested generic;
|
||||
* 3 the second; and so on. For example, given {@code List<Set<Integer>>} level 1 refers
|
||||
* to the {@code List}, level 2 the {@code Set}, and level 3 the {@code Integer}.
|
||||
* <p>The {@code typeIndexesPerLevel} map can be used to reference a specific generic
|
||||
* for the given level. For example, an index of 0 would refer to a {@code Map} key;
|
||||
* whereas, 1 would refer to the value. If the map does not contain a value for a
|
||||
@@ -582,11 +582,11 @@ public class ResolvableType implements Serializable {
|
||||
* {@code String[]}, a nesting level of 2 refers to {@code String}.
|
||||
* <p>If a type does not {@link #hasGenerics() contain} generics the
|
||||
* {@link #getSuperType() supertype} hierarchy will be considered.
|
||||
* @param nestingLevel the required nesting level, indexed from 1 for the current
|
||||
* type, 2 for the first nested generic, 3 for the second and so on
|
||||
* @param typeIndexesPerLevel a map containing the generic index for a given nesting
|
||||
* level (may be {@code null})
|
||||
* @return a {@link ResolvableType} for the nested level or {@link #NONE}
|
||||
* @param nestingLevel the required nesting level, indexed from 1 for the
|
||||
* current type, 2 for the first nested generic, 3 for the second and so on
|
||||
* @param typeIndexesPerLevel a map containing the generic index for a given
|
||||
* nesting level (may be {@code null})
|
||||
* @return a {@link ResolvableType} for the nested level, or {@link #NONE}
|
||||
*/
|
||||
public ResolvableType getNested(int nestingLevel, Map<Integer, Integer> typeIndexesPerLevel) {
|
||||
ResolvableType result = this;
|
||||
@@ -608,17 +608,17 @@ public class ResolvableType implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link ResolvableType} representing the generic parameter for the given
|
||||
* indexes. Indexes are zero based; for example given the type
|
||||
* Return a {@link ResolvableType} representing the generic parameter for the
|
||||
* given indexes. Indexes are zero based; for example given the type
|
||||
* {@code Map<Integer, List<String>>}, {@code getGeneric(0)} will access the
|
||||
* {@code Integer}. Nested generics can be accessed by specifying multiple indexes;
|
||||
* for example {@code getGeneric(1, 0)} will access the {@code String} from the nested
|
||||
* {@code List}. For convenience, if no indexes are specified the first generic is
|
||||
* returned.
|
||||
* for example {@code getGeneric(1, 0)} will access the {@code String} from the
|
||||
* nested {@code List}. For convenience, if no indexes are specified the first
|
||||
* generic is returned.
|
||||
* <p>If no generic is available at the specified indexes {@link #NONE} is returned.
|
||||
* @param indexes the indexes that refer to the generic parameter (may be omitted to
|
||||
* return the first generic)
|
||||
* @return a {@link ResolvableType} for the specified generic or {@link #NONE}
|
||||
* @param indexes the indexes that refer to the generic parameter
|
||||
* (may be omitted to return the first generic)
|
||||
* @return a {@link ResolvableType} for the specified generic, or {@link #NONE}
|
||||
* @see #hasGenerics()
|
||||
* @see #getGenerics()
|
||||
* @see #resolveGeneric(int...)
|
||||
@@ -693,9 +693,8 @@ public class ResolvableType implements Serializable {
|
||||
* Convenience method that will {@link #getGenerics() get} and {@link #resolve()
|
||||
* resolve} generic parameters, using the specified {@code fallback} if any type
|
||||
* cannot be resolved.
|
||||
* @param fallback the fallback class to use if resolution fails (may be {@code null})
|
||||
* @return an array of resolved generic parameters (the resulting array will never be
|
||||
* {@code null}, but it may contain {@code null} elements})
|
||||
* @param fallback the fallback class to use if resolution fails
|
||||
* @return an array of resolved generic parameters
|
||||
* @see #getGenerics()
|
||||
* @see #resolve()
|
||||
*/
|
||||
@@ -740,7 +739,7 @@ public class ResolvableType implements Serializable {
|
||||
* {@code fallback} if the type cannot be resolved. This method will consider bounds
|
||||
* of {@link TypeVariable}s and {@link WildcardType}s if direct resolution fails;
|
||||
* however, bounds of {@code Object.class} will be ignored.
|
||||
* @param fallback the fallback class to use if resolution fails (may be {@code null})
|
||||
* @param fallback the fallback class to use if resolution fails
|
||||
* @return the resolved {@link Class} or the {@code fallback}
|
||||
* @see #resolve()
|
||||
* @see #resolveGeneric(int...)
|
||||
@@ -935,8 +934,8 @@ public class ResolvableType implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link ResolvableType} for the specified {@link Class}, doing
|
||||
* assignability checks against the raw class only (analogous to
|
||||
* Return a {@link ResolvableType} for the specified {@link Class},
|
||||
* doing assignability checks against the raw class only (analogous to
|
||||
* {@link Class#isAssignableFrom}, which this serves as a wrapper for.
|
||||
* For example: {@code ResolvableType.forRawClass(List.class)}.
|
||||
* @param clazz the class to introspect ({@code null} is semantically
|
||||
@@ -1286,7 +1285,7 @@ public class ResolvableType implements Serializable {
|
||||
/**
|
||||
* Return a {@link ResolvableType} for the specified {@link Type}.
|
||||
* Note: The resulting {@link ResolvableType} may not be {@link Serializable}.
|
||||
* @param type the source type or {@code null}
|
||||
* @param type the source type (potentially {@code null})
|
||||
* @return a {@link ResolvableType} for the specified {@link Type}
|
||||
* @see #forType(Type, ResolvableType)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user