26 lines
715 B
Java
26 lines
715 B
Java
package com.ubt.jimu.base;
|
|
|
|
import android.content.Context;
|
|
import com.alibaba.android.arouter.facade.service.SerializationService;
|
|
import com.ubt.jimu.utils.GsonUtil;
|
|
import java.lang.reflect.Type;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class JsonServiceImpl implements SerializationService {
|
|
@Override // com.alibaba.android.arouter.facade.template.IProvider
|
|
public void init(Context context) {
|
|
}
|
|
|
|
public <T> T json2Object(String str, Class<T> cls) {
|
|
return (T) GsonUtil.a(str, cls);
|
|
}
|
|
|
|
public String object2Json(Object obj) {
|
|
return GsonUtil.a(obj);
|
|
}
|
|
|
|
public <T> T parseObject(String str, Type type) {
|
|
return (T) GsonUtil.a(str, type.getClass());
|
|
}
|
|
}
|