mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 16:39:22 +08:00
Make two methods on Types public.
To facilitate custom JsonAdapter.Factory implementations.
This commit is contained in:
@@ -93,7 +93,7 @@ public final class Types {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Class<?> getRawType(Type type) {
|
public static Class<?> getRawType(Type type) {
|
||||||
if (type instanceof Class<?>) {
|
if (type instanceof Class<?>) {
|
||||||
// type is a normal class.
|
// type is a normal class.
|
||||||
return (Class<?>) type;
|
return (Class<?>) type;
|
||||||
@@ -260,7 +260,7 @@ public final class Types {
|
|||||||
* Returns the element type of this collection type.
|
* Returns the element type of this collection type.
|
||||||
* @throws IllegalArgumentException if this type is not a collection.
|
* @throws IllegalArgumentException if this type is not a collection.
|
||||||
*/
|
*/
|
||||||
static Type collectionElementType(Type context, Class<?> contextRawType) {
|
public static Type collectionElementType(Type context, Class<?> contextRawType) {
|
||||||
Type collectionType = getSupertype(context, contextRawType, Collection.class);
|
Type collectionType = getSupertype(context, contextRawType, Collection.class);
|
||||||
|
|
||||||
if (collectionType instanceof WildcardType) {
|
if (collectionType instanceof WildcardType) {
|
||||||
|
Reference in New Issue
Block a user