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.GetTableQuery 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 GetTableQuery implements Query, GetTableQuery.Variables> {
public static final String OPERATION_ID = "736589bed71167a51e076e6e1b67cbe953d361b8f8103e5e592c3d24a6e5b1f3";
public static final String QUERY_DOCUMENT = QueryDocumentMinifier.minify(
"query GetTable($keyspaceName: String!, $tableName: String!) {\n"
+ " keyspace(name: $keyspaceName) {\n"
+ " __typename\n"
+ " name\n"
+ " table(name: $tableName) {\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 "GetTable";
}
};
private final GetTableQuery.Variables variables;
public GetTableQuery(@NotNull String keyspaceName, @NotNull String tableName) {
Utils.checkNotNull(keyspaceName, "keyspaceName == null");
Utils.checkNotNull(tableName, "tableName == null");
variables = new GetTableQuery.Variables(keyspaceName, tableName);
}
@Override
public String operationId() {
return OPERATION_ID;
}
@Override
public String queryDocument() {
return QUERY_DOCUMENT;
}
@Override
public Optional wrapData(GetTableQuery.Data data) {
return Optional.ofNullable(data);
}
@Override
public GetTableQuery.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 keyspaceName;
private @NotNull String tableName;
Builder() {
}
public Builder keyspaceName(@NotNull String keyspaceName) {
this.keyspaceName = keyspaceName;
return this;
}
public Builder tableName(@NotNull String tableName) {
this.tableName = tableName;
return this;
}
public GetTableQuery build() {
Utils.checkNotNull(keyspaceName, "keyspaceName == null");
Utils.checkNotNull(tableName, "tableName == null");
return new GetTableQuery(keyspaceName, tableName);
}
}
public static final class Variables extends Operation.Variables {
private final @NotNull String keyspaceName;
private final @NotNull String tableName;
private final transient Map valueMap = new LinkedHashMap<>();
Variables(@NotNull String keyspaceName, @NotNull String tableName) {
this.keyspaceName = keyspaceName;
this.tableName = tableName;
this.valueMap.put("keyspaceName", keyspaceName);
this.valueMap.put("tableName", tableName);
}
public @NotNull String keyspaceName() {
return keyspaceName;
}
public @NotNull String tableName() {
return tableName;
}
@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("keyspaceName", keyspaceName);
writer.writeString("tableName", tableName);
}
};
}
}
/**
* 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", "keyspaceName")
.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.forObject("table", "table", new UnmodifiableMapBuilder(1)
.put("name", new UnmodifiableMapBuilder(2)
.put("kind", "Variable")
.put("variableName", "tableName")
.build())
.build(), true, Collections.emptyList())
};
final @NotNull String __typename;
final @NotNull String name;
final Optional table;
private transient volatile String $toString;
private transient volatile int $hashCode;
private transient volatile boolean $hashCodeMemoized;
public Keyspace(@NotNull String __typename, @NotNull String name, @Nullable Table table) {
this.__typename = Utils.checkNotNull(__typename, "__typename == null");
this.name = Utils.checkNotNull(name, "name == null");
this.table = Optional.ofNullable(table);
}
public @NotNull String get__typename() {
return this.__typename;
}
public @NotNull String getName() {
return this.name;
}
public Optional getTable() {
return this.table;
}
@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.writeObject($responseFields[2], table.isPresent() ? table.get().marshaller() : null);
}
};
}
@Override
public String toString() {
if ($toString == null) {
$toString = "Keyspace{"
+ "__typename=" + __typename + ", "
+ "name=" + name + ", "
+ "table=" + table
+ "}";
}
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.table.equals(that.table);
}
return false;
}
@Override
public int hashCode() {
if (!$hashCodeMemoized) {
int h = 1;
h *= 1000003;
h ^= __typename.hashCode();
h *= 1000003;
h ^= name.hashCode();
h *= 1000003;
h ^= table.hashCode();
$hashCode = h;
$hashCodeMemoized = true;
}
return $hashCode;
}
public Builder toBuilder() {
Builder builder = new Builder();
builder.__typename = __typename;
builder.name = name;
builder.table = table.isPresent() ? table.get() : null;
return builder;
}
public static Builder builder() {
return new Builder();
}
public static final class Mapper implements ResponseFieldMapper {
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 Table table = reader.readObject($responseFields[2], new ResponseReader.ObjectReader() {
@Override
public Table read(ResponseReader reader) {
return tableFieldMapper.map(reader);
}
});
return new Keyspace(__typename, name, table);
}
}
public static final class Builder {
private @NotNull String __typename;
private @NotNull String name;
private @Nullable Table table;
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 table(@Nullable Table table) {
this.table = table;
return this;
}
public Builder table(@NotNull Mutator mutator) {
Utils.checkNotNull(mutator, "mutator == null");
Table.Builder builder = this.table != null ? this.table.toBuilder() : Table.builder();
mutator.accept(builder);
this.table = builder.build();
return this;
}
public Keyspace build() {
Utils.checkNotNull(__typename, "__typename == null");
Utils.checkNotNull(name, "name == null");
return new Keyspace(__typename, name, table);
}
}
}
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);
}
}
}
}