blob: 0b13defc43b90453d0a4c81b832c7902e80cfe04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
package org.onap.sdc.dcae.catalog.commons;
import java.util.Map;
import java.lang.reflect.ParameterizedType;
import org.json.JSONObject;
import org.onap.sdc.dcae.catalog.commons.ProxyBuilder;
public class Proxies {
private Proxies() {
}
private static ProxyBuilder builder = new ProxyBuilder();
public static <T> T build(Map theData, Class<T> theType) {
return builder.build(new JSONObject(theData), theType);
}
public static <T> T build(JSONObject theData, Class<T> theType) {
return builder.build(theData, theType);
}
public static <T> Class<T> typeArgument(Class theType) {
return (Class<T>)
((ParameterizedType)theType.getGenericSuperclass()).
getActualTypeArguments()[0];
}
}
|