All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oneops.infoblox.model.AutoValueMoshi_JsonAdapterFactory Maven / Gradle / Ivy

package com.oneops.infoblox.model;

import com.oneops.infoblox.model.a.ARec;
import com.oneops.infoblox.model.aaaa.AAAA;
import com.oneops.infoblox.model.cname.CNAME;
import com.oneops.infoblox.model.host.Host;
import com.oneops.infoblox.model.host.HostIPv4Req;
import com.oneops.infoblox.model.host.HostReq;
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 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(CNAME.class)) {
      return CNAME.jsonAdapter(moshi);
    } else if (type.equals(HostReq.class)) {
      return HostReq.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);
    } else if (type.equals(HostIPv4Req.class)) {
      return HostIPv4Req.jsonAdapter(moshi);
    } else if (type.equals(ARec.class)) {
      return ARec.jsonAdapter(moshi);
    } else if (type.equals(AAAA.class)) {
      return AAAA.jsonAdapter(moshi);
    }
    return null;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy