Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.example.graphql.client.schema.GetKeyspaceQuery Maven / Gradle / Ivy
// AUTO-GENERATED FILE. DO NOT MODIFY.
//
// This class was automatically generated by Apollo GraphQL plugin from the GraphQL queries it found.
// It should not be modified by hand.
//
package com.example.graphql.client.schema;
import com.apollographql.apollo.api.Operation;
import com.apollographql.apollo.api.OperationName;
import com.apollographql.apollo.api.Query;
import com.apollographql.apollo.api.Response;
import com.apollographql.apollo.api.ResponseField;
import com.apollographql.apollo.api.ScalarTypeAdapters;
import com.apollographql.apollo.api.internal.InputFieldMarshaller;
import com.apollographql.apollo.api.internal.InputFieldWriter;
import com.apollographql.apollo.api.internal.Mutator;
import com.apollographql.apollo.api.internal.OperationRequestBodyComposer;
import com.apollographql.apollo.api.internal.QueryDocumentMinifier;
import com.apollographql.apollo.api.internal.ResponseFieldMapper;
import com.apollographql.apollo.api.internal.ResponseFieldMarshaller;
import com.apollographql.apollo.api.internal.ResponseReader;
import com.apollographql.apollo.api.internal.ResponseWriter;
import com.apollographql.apollo.api.internal.SimpleOperationResponseParser;
import com.apollographql.apollo.api.internal.UnmodifiableMapBuilder;
import com.apollographql.apollo.api.internal.Utils;
import com.example.graphql.client.schema.type.BasicType;
import com.example.graphql.client.schema.type.ColumnKind;
import java.io.IOException;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import okio.Buffer;
import okio.BufferedSource;
import okio.ByteString;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public final class GetKeyspaceQuery implements Query, GetKeyspaceQuery.Variables> {
public static final String OPERATION_ID = "a4656c93592a70acb9a874946853df894005aeeceadcd40689d359d23a492f4b";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"query GetKeyspace($name: String!) {\n"
+ " keyspace(name: $name) {\n"
+ " __typename\n"
+ " name\n"
+ " dcs {\n"
+ " __typename\n"
+ " name\n"
+ " replicas\n"
+ " }\n"
+ " tables {\n"
+ " __typename\n"
+ " name\n"
+ " columns {\n"
+ " __typename\n"
+ " name\n"
+ " kind\n"
+ " type {\n"
+ " __typename\n"
+ " basic\n"
+ " info {\n"
+ " __typename\n"
+ " name\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ "}"
);
public static final OperationName OPERATION_NAME = new OperationName() {
@Override
public String name() {
return "GetKeyspace";
}
};
private final GetKeyspaceQuery.Variables variables;
public GetKeyspaceQuery(@NotNull String name) {
Utils.checkNotNull(name, "name == null");
variables = new GetKeyspaceQuery.Variables(name);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public Optional wrapData(GetKeyspaceQuery.Data data) {
return Optional.ofNullable(data);
}
@Override
public GetKeyspaceQuery.Variables variables() {
return variables;
}
@Override
public ResponseFieldMapper responseFieldMapper() {
return new Data.Mapper();
}
public static Builder builder() {
return new Builder();
}
@Override
public OperationName name() {
return OPERATION_NAME;
}
@Override
@NotNull
public Response> parse(@NotNull final BufferedSource source,
@NotNull final ScalarTypeAdapters scalarTypeAdapters) throws IOException {
return SimpleOperationResponseParser.parse(source, this, scalarTypeAdapters);
}
@Override
@NotNull
public Response> parse(@NotNull final ByteString byteString,
@NotNull final ScalarTypeAdapters scalarTypeAdapters) throws IOException {
return parse(new Buffer().write(byteString), scalarTypeAdapters);
}
@Override
@NotNull
public Response> parse(@NotNull final BufferedSource source)
throws IOException {
return parse(source, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public Response> parse(@NotNull final ByteString byteString)
throws IOException {
return parse(byteString, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public ByteString composeRequestBody(@NotNull final ScalarTypeAdapters scalarTypeAdapters) {
return OperationRequestBodyComposer.compose(this, false, true, scalarTypeAdapters);
}
@NotNull
@Override
public ByteString composeRequestBody() {
return OperationRequestBodyComposer.compose(this, false, true, ScalarTypeAdapters.DEFAULT);
}
@Override
@NotNull
public ByteString composeRequestBody(final boolean autoPersistQueries,
final boolean withQueryDocument, @NotNull final ScalarTypeAdapters scalarTypeAdapters) {
return OperationRequestBodyComposer.compose(this, autoPersistQueries, withQueryDocument, scalarTypeAdapters);
}
public static final class Builder {
private @NotNull String name;
Builder() {
}
public Builder name(@NotNull String name) {
this.name = name;
return this;
}
public GetKeyspaceQuery build() {
Utils.checkNotNull(name, "name == null");
return new GetKeyspaceQuery(name);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull String name;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull String name) {
this.name = name;
this.valueMap.put("name", name);
}
public @NotNull String name() {
return name;
}
@Override
public Map valueMap() {
return Collections.unmodifiableMap(valueMap);
}
@Override
public InputFieldMarshaller marshaller() {
return new InputFieldMarshaller() {
@Override
public void marshal(InputFieldWriter writer) throws IOException {
writer.writeString("name", name);
}
};
}
}
/**
* Data from the response after executing this GraphQL operation
*/
public static class Data implements Operation.Data {
static final ResponseField[] $responseFields = {
ResponseField.forObject("keyspace", "keyspace", new UnmodifiableMapBuilder(1)
.put("name", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "name")
.build())
.build(), true, Collections.emptyList())
};
final Optional keyspace;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Data(@Nullable Keyspace keyspace) {
this.keyspace = Optional.ofNullable(keyspace);
}
public Optional getKeyspace() {
return this.keyspace;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeObject($responseFields[0], keyspace.isPresent() ? keyspace.get().marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Data{"
+ "keyspace=" + keyspace
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Data) {
Data that = (Data) o;
return this.keyspace.equals(that.keyspace);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= keyspace.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.keyspace = keyspace.isPresent() ? keyspace.get() : null;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
final Keyspace.Mapper keyspaceFieldMapper = new Keyspace.Mapper();
@Override
public Data map(ResponseReader reader) {
final Keyspace keyspace = reader.readObject($responseFields[0], new ResponseReader.ObjectReader() {
@Override
public Keyspace read(ResponseReader reader) {
return keyspaceFieldMapper.map(reader);
}
});
return new Data(keyspace);
}
}
public static final class Builder {
private @Nullable Keyspace keyspace;
Builder() {
}
public Builder keyspace(@Nullable Keyspace keyspace) {
this.keyspace = keyspace;
return this;
}
public Builder keyspace(@NotNull Mutator mutator) {
Utils.checkNotNull(mutator, "mutator == null");
Keyspace.Builder builder = this.keyspace != null ? this.keyspace.toBuilder() : Keyspace.builder();
mutator.accept(builder);
this.keyspace = builder.build();
return this;
}
public Data build() {
return new Data(keyspace);
}
}
}
public static class Keyspace {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("name", "name", null, false, Collections.emptyList()),
ResponseField.forList("dcs", "dcs", null, true, Collections.emptyList()),
ResponseField.forList("tables", "tables", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String name;
final Optional> dcs;
final Optional> tables;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Keyspace(@NotNull String __typename, @NotNull String name, @Nullable List dcs,
@Nullable List tables) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.name = Utils.checkNotNull(name, "name == null");
this.dcs = Optional.ofNullable(dcs);
this.tables = Optional.ofNullable(tables);
}
public @NotNull String get__typename() {
return this.__typename;
}
public @NotNull String getName() {
return this.name;
}
public Optional> getDcs() {
return this.dcs;
}
public Optional> getTables() {
return this.tables;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], name);
writer.writeList($responseFields[2], dcs.isPresent() ? dcs.get() : null, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeObject(((Dc) item).marshaller());
}
}
});
writer.writeList($responseFields[3], tables.isPresent() ? tables.get() : null, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeObject(((Table) item).marshaller());
}
}
});
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Keyspace{"
+ "__typename=" + __typename + ", "
+ "name=" + name + ", "
+ "dcs=" + dcs + ", "
+ "tables=" + tables
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Keyspace) {
Keyspace that = (Keyspace) o;
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name)
&& this.dcs.equals(that.dcs)
&& this.tables.equals(that.tables);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= name.hashCode();
h *= 1000003;
h ^= dcs.hashCode();
h *= 1000003;
h ^= tables.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.name = name;
builder.dcs = dcs.isPresent() ? dcs.get() : null;
builder.tables = tables.isPresent() ? tables.get() : null;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
final Dc.Mapper dcFieldMapper = new Dc.Mapper();
final Table.Mapper tableFieldMapper = new Table.Mapper();
@Override
public Keyspace map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String name = reader.readString($responseFields[1]);
final List dcs = reader.readList($responseFields[2], new ResponseReader.ListReader() {
@Override
public Dc read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readObject(new ResponseReader.ObjectReader() {
@Override
public Dc read(ResponseReader reader) {
return dcFieldMapper.map(reader);
}
});
}
});
final List tables = reader.readList($responseFields[3], new ResponseReader.ListReader() {
@Override
public Table read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readObject(new ResponseReader.ObjectReader() {
@Override
public Table read(ResponseReader reader) {
return tableFieldMapper.map(reader);
}
});
}
});
return new Keyspace(__typename, name, dcs, tables);
}
}
public static final class Builder {
private @NotNull String __typename;
private @NotNull String name;
private @Nullable List dcs;
private @Nullable List tables;
Builder() {
}
public Builder __typename(@NotNull String __typename) {
this.__typename = __typename;
return this;
}
public Builder name(@NotNull String name) {
this.name = name;
return this;
}
public Builder dcs(@Nullable List dcs) {
this.dcs = dcs;
return this;
}
public Builder tables(@Nullable List tables) {
this.tables = tables;
return this;
}
public Builder dcs(@NotNull Mutator> mutator) {
Utils.checkNotNull(mutator, "mutator == null");
List builders = new ArrayList<>();
if (this.dcs != null) {
for (Dc item : this.dcs) {
builders.add(item != null ? item.toBuilder() : null);
}
}
mutator.accept(builders);
List dcs = new ArrayList<>();
for (Dc.Builder item : builders) {
dcs.add(item != null ? item.build() : null);
}
this.dcs = dcs;
return this;
}
public Builder tables(@NotNull Mutator> mutator) {
Utils.checkNotNull(mutator, "mutator == null");
List builders = new ArrayList<>();
if (this.tables != null) {
for (Table item : this.tables) {
builders.add(item != null ? item.toBuilder() : null);
}
}
mutator.accept(builders);
List tables = new ArrayList<>();
for (Table.Builder item : builders) {
tables.add(item != null ? item.build() : null);
}
this.tables = tables;
return this;
}
public Keyspace build() {
Utils.checkNotNull(__typename, "__typename == null");
Utils.checkNotNull(name, "name == null");
return new Keyspace(__typename, name, dcs, tables);
}
}
}
public static class Dc {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("name", "name", null, false, Collections.emptyList()),
ResponseField.forInt("replicas", "replicas", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String name;
final int replicas;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Dc(@NotNull String __typename, @NotNull String name, int replicas) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.name = Utils.checkNotNull(name, "name == null");
this.replicas = replicas;
}
public @NotNull String get__typename() {
return this.__typename;
}
public @NotNull String getName() {
return this.name;
}
public int getReplicas() {
return this.replicas;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], name);
writer.writeInt($responseFields[2], replicas);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Dc{"
+ "__typename=" + __typename + ", "
+ "name=" + name + ", "
+ "replicas=" + replicas
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Dc) {
Dc that = (Dc) o;
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name)
&& this.replicas == that.replicas;
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= name.hashCode();
h *= 1000003;
h ^= replicas;
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.name = name;
builder.replicas = replicas;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public Dc map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String name = reader.readString($responseFields[1]);
final int replicas = reader.readInt($responseFields[2]);
return new Dc(__typename, name, replicas);
}
}
public static final class Builder {
private @NotNull String __typename;
private @NotNull String name;
private int replicas;
Builder() {
}
public Builder __typename(@NotNull String __typename) {
this.__typename = __typename;
return this;
}
public Builder name(@NotNull String name) {
this.name = name;
return this;
}
public Builder replicas(int replicas) {
this.replicas = replicas;
return this;
}
public Dc build() {
Utils.checkNotNull(__typename, "__typename == null");
Utils.checkNotNull(name, "name == null");
return new Dc(__typename, name, replicas);
}
}
}
public static class Table {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("name", "name", null, false, Collections.emptyList()),
ResponseField.forList("columns", "columns", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String name;
final Optional> columns;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Table(@NotNull String __typename, @NotNull String name, @Nullable List columns) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.name = Utils.checkNotNull(name, "name == null");
this.columns = Optional.ofNullable(columns);
}
public @NotNull String get__typename() {
return this.__typename;
}
public @NotNull String getName() {
return this.name;
}
public Optional> getColumns() {
return this.columns;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], name);
writer.writeList($responseFields[2], columns.isPresent() ? columns.get() : null, new ResponseWriter.ListWriter() {
@Override
public void write(List items, ResponseWriter.ListItemWriter listItemWriter) {
for (Object item : items) {
listItemWriter.writeObject(((Column) item).marshaller());
}
}
});
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Table{"
+ "__typename=" + __typename + ", "
+ "name=" + name + ", "
+ "columns=" + columns
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Table) {
Table that = (Table) o;
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name)
&& this.columns.equals(that.columns);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= name.hashCode();
h *= 1000003;
h ^= columns.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.name = name;
builder.columns = columns.isPresent() ? columns.get() : null;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
final Column.Mapper columnFieldMapper = new Column.Mapper();
@Override
public Table map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String name = reader.readString($responseFields[1]);
final List columns = reader.readList($responseFields[2], new ResponseReader.ListReader() {
@Override
public Column read(ResponseReader.ListItemReader listItemReader) {
return listItemReader.readObject(new ResponseReader.ObjectReader() {
@Override
public Column read(ResponseReader reader) {
return columnFieldMapper.map(reader);
}
});
}
});
return new Table(__typename, name, columns);
}
}
public static final class Builder {
private @NotNull String __typename;
private @NotNull String name;
private @Nullable List columns;
Builder() {
}
public Builder __typename(@NotNull String __typename) {
this.__typename = __typename;
return this;
}
public Builder name(@NotNull String name) {
this.name = name;
return this;
}
public Builder columns(@Nullable List columns) {
this.columns = columns;
return this;
}
public Builder columns(@NotNull Mutator> mutator) {
Utils.checkNotNull(mutator, "mutator == null");
List builders = new ArrayList<>();
if (this.columns != null) {
for (Column item : this.columns) {
builders.add(item != null ? item.toBuilder() : null);
}
}
mutator.accept(builders);
List columns = new ArrayList<>();
for (Column.Builder item : builders) {
columns.add(item != null ? item.build() : null);
}
this.columns = columns;
return this;
}
public Table build() {
Utils.checkNotNull(__typename, "__typename == null");
Utils.checkNotNull(name, "name == null");
return new Table(__typename, name, columns);
}
}
}
public static class Column {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("name", "name", null, false, Collections.emptyList()),
ResponseField.forString("kind", "kind", null, false, Collections.emptyList()),
ResponseField.forObject("type", "type", null, false, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String name;
final @NotNull ColumnKind kind;
final @NotNull Type type;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Column(@NotNull String __typename, @NotNull String name, @NotNull ColumnKind kind,
@NotNull Type type) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.name = Utils.checkNotNull(name, "name == null");
this.kind = Utils.checkNotNull(kind, "kind == null");
this.type = Utils.checkNotNull(type, "type == null");
}
public @NotNull String get__typename() {
return this.__typename;
}
public @NotNull String getName() {
return this.name;
}
public @NotNull ColumnKind getKind() {
return this.kind;
}
public @NotNull Type getType() {
return this.type;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], name);
writer.writeString($responseFields[2], kind.rawValue());
writer.writeObject($responseFields[3], type.marshaller());
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Column{"
+ "__typename=" + __typename + ", "
+ "name=" + name + ", "
+ "kind=" + kind + ", "
+ "type=" + type
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Column) {
Column that = (Column) o;
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name)
&& this.kind.equals(that.kind)
&& this.type.equals(that.type);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= name.hashCode();
h *= 1000003;
h ^= kind.hashCode();
h *= 1000003;
h ^= type.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.name = name;
builder.kind = kind;
builder.type = type;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
final Type.Mapper typeFieldMapper = new Type.Mapper();
@Override
public Column map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String name = reader.readString($responseFields[1]);
final String kindStr = reader.readString($responseFields[2]);
final ColumnKind kind;
if (kindStr != null) {
kind = ColumnKind.safeValueOf(kindStr);
} else {
kind = null;
}
final Type type = reader.readObject($responseFields[3], new ResponseReader.ObjectReader() {
@Override
public Type read(ResponseReader reader) {
return typeFieldMapper.map(reader);
}
});
return new Column(__typename, name, kind, type);
}
}
public static final class Builder {
private @NotNull String __typename;
private @NotNull String name;
private @NotNull ColumnKind kind;
private @NotNull Type type;
Builder() {
}
public Builder __typename(@NotNull String __typename) {
this.__typename = __typename;
return this;
}
public Builder name(@NotNull String name) {
this.name = name;
return this;
}
public Builder kind(@NotNull ColumnKind kind) {
this.kind = kind;
return this;
}
public Builder type(@NotNull Type type) {
this.type = type;
return this;
}
public Builder type(@NotNull Mutator mutator) {
Utils.checkNotNull(mutator, "mutator == null");
Type.Builder builder = this.type != null ? this.type.toBuilder() : Type.builder();
mutator.accept(builder);
this.type = builder.build();
return this;
}
public Column build() {
Utils.checkNotNull(__typename, "__typename == null");
Utils.checkNotNull(name, "name == null");
Utils.checkNotNull(kind, "kind == null");
Utils.checkNotNull(type, "type == null");
return new Column(__typename, name, kind, type);
}
}
}
public static class Type {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("basic", "basic", null, false, Collections.emptyList()),
ResponseField.forObject("info", "info", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull BasicType basic;
final Optional info;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Type(@NotNull String __typename, @NotNull BasicType basic, @Nullable Info info) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.basic = Utils.checkNotNull(basic, "basic == null");
this.info = Optional.ofNullable(info);
}
public @NotNull String get__typename() {
return this.__typename;
}
public @NotNull BasicType getBasic() {
return this.basic;
}
public Optional getInfo() {
return this.info;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], basic.rawValue());
writer.writeObject($responseFields[2], info.isPresent() ? info.get().marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Type{"
+ "__typename=" + __typename + ", "
+ "basic=" + basic + ", "
+ "info=" + info
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Type) {
Type that = (Type) o;
return this.__typename.equals(that.__typename)
&& this.basic.equals(that.basic)
&& this.info.equals(that.info);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= basic.hashCode();
h *= 1000003;
h ^= info.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.basic = basic;
builder.info = info.isPresent() ? info.get() : null;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
final Info.Mapper infoFieldMapper = new Info.Mapper();
@Override
public Type map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String basicStr = reader.readString($responseFields[1]);
final BasicType basic;
if (basicStr != null) {
basic = BasicType.safeValueOf(basicStr);
} else {
basic = null;
}
final Info info = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
@Override
public Info read(ResponseReader reader) {
return infoFieldMapper.map(reader);
}
});
return new Type(__typename, basic, info);
}
}
public static final class Builder {
private @NotNull String __typename;
private @NotNull BasicType basic;
private @Nullable Info info;
Builder() {
}
public Builder __typename(@NotNull String __typename) {
this.__typename = __typename;
return this;
}
public Builder basic(@NotNull BasicType basic) {
this.basic = basic;
return this;
}
public Builder info(@Nullable Info info) {
this.info = info;
return this;
}
public Builder info(@NotNull Mutator mutator) {
Utils.checkNotNull(mutator, "mutator == null");
Info.Builder builder = this.info != null ? this.info.toBuilder() : Info.builder();
mutator.accept(builder);
this.info = builder.build();
return this;
}
public Type build() {
Utils.checkNotNull(__typename, "__typename == null");
Utils.checkNotNull(basic, "basic == null");
return new Type(__typename, basic, info);
}
}
}
public static class Info {
static final ResponseField[] $responseFields = {
ResponseField.forString("__typename", "__typename", null, false, Collections.emptyList()),
ResponseField.forString("name", "name", null, true, Collections.emptyList())
};
final @NotNull String __typename;
final Optional name;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Info(@NotNull String __typename, @Nullable String name) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.name = Optional.ofNullable(name);
}
public @NotNull String get__typename() {
return this.__typename;
}
public Optional getName() {
return this.name;
}
@SuppressWarnings({"rawtypes", "unchecked"})
public ResponseFieldMarshaller marshaller() {
return new ResponseFieldMarshaller() {
@Override
public void marshal(ResponseWriter writer) {
writer.writeString($responseFields[0], __typename);
writer.writeString($responseFields[1], name.isPresent() ? name.get() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Info{"
+ "__typename=" + __typename + ", "
+ "name=" + name
+ "}";
}
return $toString;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Info) {
Info that = (Info) o;
return this.__typename.equals(that.__typename)
&& this.name.equals(that.name);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= name.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.name = name.isPresent() ? name.get() : null;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
@Override
public Info map(ResponseReader reader) {
final String __typename = reader.readString($responseFields[0]);
final String name = reader.readString($responseFields[1]);
return new Info(__typename, name);
}
}
public static final class Builder {
private @NotNull String __typename;
private @Nullable String name;
Builder() {
}
public Builder __typename(@NotNull String __typename) {
this.__typename = __typename;
return this;
}
public Builder name(@Nullable String name) {
this.name = name;
return this;
}
public Info build() {
Utils.checkNotNull(__typename, "__typename == null");
return new Info(__typename, name);
}
}
}
}