Skip to content

Commit

Permalink
Revise getElementTypeDescriptor javadoc (no IllegalStateException)
Browse files Browse the repository at this point in the history
Closes gh-23996
  • Loading branch information
jhoeller committed Nov 14, 2019
1 parent 96a1a0d commit 85471d0
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -36,7 +36,8 @@
import org.springframework.util.ObjectUtils;

/**
* Context about a type to convert from or to.
* Contextual descriptor about a type to convert from or to.
* Capable of representing arrays and generic collection types.
*
* @author Keith Donald
* @author Andy Clement
Expand All @@ -45,6 +46,8 @@
* @author Sam Brannen
* @author Stephane Nicoll
* @since 3.0
* @see ConversionService#canConvert(TypeDescriptor, TypeDescriptor)
* @see ConversionService#convert(Object, TypeDescriptor, TypeDescriptor)
*/
@SuppressWarnings("serial")
public class TypeDescriptor implements Serializable {
Expand Down Expand Up @@ -322,9 +325,9 @@ public boolean isArray() {
* If this type is a {@code Stream}, returns the stream's component type.
* If this type is a {@link Collection} and it is parameterized, returns the Collection's element type.
* If the Collection is not parameterized, returns {@code null} indicating the element type is not declared.
* @return the array component type or Collection element type, or {@code null} if this type is a
* Collection but its element type is not parameterized
* @throws IllegalStateException if this type is not a {@code java.util.Collection} or array type
* @return the array component type or Collection element type, or {@code null} if this type is not
* an array type or a {@code java.util.Collection} or if its element type is not parameterized
* @see #elementTypeDescriptor(Object)
*/
@Nullable
public TypeDescriptor getElementTypeDescriptor() {
Expand All @@ -351,8 +354,7 @@ public TypeDescriptor getElementTypeDescriptor() {
* TypeDescriptor that is returned.
* @param element the collection or array element
* @return a element type descriptor, narrowed to the type of the provided element
* @throws IllegalStateException if this type is not a {@code java.util.Collection}
* or array type
* @see #getElementTypeDescriptor()
* @see #narrow(Object)
*/
@Nullable
Expand Down

0 comments on commit 85471d0

Please sign in to comment.