Created
March 20, 2017 04:21
-
-
Save act262/5ee2c4e06a7649cf0ec7130feb70ec6b to your computer and use it in GitHub Desktop.
Gson Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TypeFactory { | |
public static Type $List(Type type) { | |
return $Gson$Types.newParameterizedTypeWithOwner(null, List.class, type); | |
} | |
public static Type $Set(Type type) { | |
return $Gson$Types.newParameterizedTypeWithOwner(null, Set.class, type); | |
} | |
public static Type $HashMap(Type type, Type type2) { | |
return $Gson$Types.newParameterizedTypeWithOwner(null, HashMap.class, type, type2); | |
} | |
public static Type $Map(Type type, Type type2) { | |
return $Gson$Types.newParameterizedTypeWithOwner(null, Map.class, type, type2); | |
} | |
public static Type $Parameterized(Type ownerType, Type rawType, Type... typeArguments) { | |
return $Gson$Types.newParameterizedTypeWithOwner(ownerType, rawType, typeArguments); | |
} | |
public static Type $Array(Type type) { | |
return $Gson$Types.arrayOf(type); | |
} | |
public static Type $SubtypeOf(Type type) { | |
return $Gson$Types.subtypeOf(type); | |
} | |
public static Type $SupertypeOf(Type type) { | |
return $Gson$Types.supertypeOf(type); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment