You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Returns true if an object of this type can be assigned to a reference of the given type.
283
-
* @param typeDescriptor the descriptor for the target type
282
+
* Returns true if an object of this type descriptor can be assigned to the location described by the given type descriptor.
283
+
* For example, valueOf(String.class).isAssignableTo(valueOf(CharSequence.class)) returns true because a String value can be assigned to a CharSequence variable.
284
+
* On the other hand, valueOf(Number.class).isAssignableTo(valueOf(Integer.class)) returns false because, while all Integers are Numbers, not all Numbers are Integers.
285
+
* <p>
286
+
* For arrays, collections, and maps, element and key/value types are checked if declared.
287
+
* For example, a List<String> field value is assignable to a Collection<CharSequence> field, but List<Number> is not assignable to List<Integer>.
284
288
* @return true if this type is assignable to the type represented by the provided type descriptor.
0 commit comments