![JAR search and dependency download from the Maven repository](/logo.png)
com.oneops.infoblox.model.AutoValueMoshi_JsonAdapterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infoblox-java Show documentation
Show all versions of infoblox-java Show documentation
A pure java API for Infoblox DNS appliance.
package com.oneops.infoblox.model;
import com.oneops.infoblox.model.host.Host;
import com.oneops.infoblox.model.host.Ipv4Addrs;
import com.oneops.infoblox.model.zone.ZoneAuth;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import java.lang.Override;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Set;
public final class AutoValueMoshi_JsonAdapterFactory extends JsonAdapterFactory {
@Override
public JsonAdapter> create(Type type, Set extends Annotation> annotations, Moshi moshi) {
if (!annotations.isEmpty()) return null;
if (type instanceof ParameterizedType) {
Type rawType = ((ParameterizedType) type).getRawType();
if (rawType.equals(Result.class)) {
return Result.jsonAdapter(moshi, ((ParameterizedType) type).getActualTypeArguments());
}
return null;
}
if (type.equals(Ipv4Addrs.class)) {
return Ipv4Addrs.jsonAdapter(moshi);
} else if (type.equals(Ref.class)) {
return Ref.jsonAdapter(moshi);
} else if (type.equals(Host.class)) {
return Host.jsonAdapter(moshi);
} else if (type.equals(Error.class)) {
return Error.jsonAdapter(moshi);
} else if (type.equals(ZoneAuth.class)) {
return ZoneAuth.jsonAdapter(moshi);
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy