![JAR search and dependency download from the Maven repository](/logo.png)
com.oneops.infoblox.model.zone.AutoValue_ZoneAuth 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.zone;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.JsonReader;
import com.squareup.moshi.JsonWriter;
import com.squareup.moshi.Moshi;
import java.io.IOException;
import java.lang.Override;
import java.lang.String;
import java.lang.reflect.Type;
final class AutoValue_ZoneAuth extends $AutoValue_ZoneAuth {
AutoValue_ZoneAuth(String view, String fqdn, String ref) {
super(view, fqdn, ref);
}
public static final class MoshiJsonAdapter extends JsonAdapter {
private static final String[] NAMES = new String[] {"view","fqdn","_ref"};
private static final JsonReader.Options OPTIONS = JsonReader.Options.of(NAMES);
private final JsonAdapter viewAdapter;
private final JsonAdapter fqdnAdapter;
private final JsonAdapter refAdapter;
public MoshiJsonAdapter(Moshi moshi) {
this.viewAdapter = adapter(moshi, String.class);
this.fqdnAdapter = adapter(moshi, String.class);
this.refAdapter = adapter(moshi, String.class);
}
@Override
public ZoneAuth fromJson(JsonReader reader) throws IOException {
reader.beginObject();
String view = null;
String fqdn = null;
String ref = null;
while (reader.hasNext()) {
switch (reader.selectName(OPTIONS)) {
case 0: {
view = this.viewAdapter.fromJson(reader);
break;
}
case 1: {
fqdn = this.fqdnAdapter.fromJson(reader);
break;
}
case 2: {
ref = this.refAdapter.fromJson(reader);
break;
}
case -1: {
// Unknown name, skip it
reader.nextName();
reader.skipValue();
}
}
}
reader.endObject();
return new AutoValue_ZoneAuth(view, fqdn, ref);
}
@Override
public void toJson(JsonWriter writer, ZoneAuth value) throws IOException {
writer.beginObject();
writer.name("view");
this.viewAdapter.toJson(writer, value.view());
writer.name("fqdn");
this.fqdnAdapter.toJson(writer, value.fqdn());
writer.name("_ref");
this.refAdapter.toJson(writer, value.ref());
writer.endObject();
}
private JsonAdapter adapter(Moshi moshi, Type adapterType) {
return moshi.adapter(adapterType);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy