org.allGraphQLCases.client.pojo.TBar2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-maven-plugin-samples-allGraphQLCases-pojo-client Show documentation
Show all versions of graphql-maven-plugin-samples-allGraphQLCases-pojo-client Show documentation
This module do integration tests for the generatePojo goal, in client mode
The newest version!
/** Generated by the default template from graphql-java-generator */
package org.allGraphQLCases.client.pojo;
import java.util.HashMap;
import java.util.Map;
import com.graphql_java_generator.annotation.GraphQLObjectType;
import com.graphql_java_generator.annotation.GraphQLScalar;
import com.graphql_java_generator.annotation.GraphQLDirective;
/**
*
* @author generated by graphql-java-generator
* @see https://github.com/graphql-java-generator/graphql-java-generator
*/
@GraphQLObjectType("TBar2")
@SuppressWarnings("unused")
public class TBar2
implements IBar2, IBar1{
/**
* This map contains the deserialized values for the alias, as parsed from the json response from the GraphQL
* server. The key is the alias name, the value is the deserialiazed value (taking into account custom scalars,
* lists, ...)
*/
@com.graphql_java_generator.annotation.GraphQLIgnore
Map aliasValues = new HashMap<>();
public TBar2(){
// No action
}
@GraphQLScalar( fieldName = "id", graphQLTypeSimpleName = "ID", javaClass = java.lang.String.class, listDepth = 0)
java.lang.String id;
@GraphQLScalar( fieldName = "__typename", graphQLTypeSimpleName = "String", javaClass = java.lang.String.class, listDepth = 0)
java.lang.String __typename;
@Override
public void setId(java.lang.String id) {
if (id == null || id instanceof java.lang.String) {
this.id = (java.lang.String) id;
} else {
throw new IllegalArgumentException("The given id should be an instance of java.lang.String, but is an instance of "
+ id.getClass().getName());
}
}
@Override
public java.lang.String getId() {
return id;
}
@Override
public void set__typename(java.lang.String __typename) {
if (__typename == null || __typename instanceof java.lang.String) {
this.__typename = (java.lang.String) __typename;
} else {
throw new IllegalArgumentException("The given __typename should be an instance of java.lang.String, but is an instance of "
+ __typename.getClass().getName());
}
}
@Override
public java.lang.String get__typename() {
return __typename;
}
/**
* This method is called during the json deserialization process, by the {@link GraphQLObjectMapper}, each time an
* alias value is read from the json.
*
* @param aliasName
* @param aliasDeserializedValue
*/
public void setAliasValue(String aliasName, Object aliasDeserializedValue) {
aliasValues.put(aliasName, aliasDeserializedValue);
}
/**
* Retrieves the value for the given alias, as it has been received for this object in the GraphQL response.
* This method should not be used for Custom Scalars, as the parser doesn't know if this alias is a custom
* scalar, and which custom scalar to use at deserialization time. In most case, a value will then be provided by
* this method with a basis json deserialization, but this value won't be the proper custom scalar value.
*
* @param alias
* @return
*/
public Object getAliasValue(String alias) {
return aliasValues.get(alias);
}
public String toString() {
return "TBar2 {"
+ "id: " + id
+ ", "
+ "__typename: " + __typename
+ "}";
}
public static Builder builder() {
return new Builder();
}
/**
* The Builder that helps building instance of this POJO. You can get an instance of this class, by calling the
* {@link #builder()}
*/
public static class Builder {
private java.lang.String id;
public Builder withId(java.lang.String id) {
this.id = id;
return this;
}
public TBar2 build() {
TBar2 _object = new TBar2();
_object.setId(id);
_object.set__typename("TBar2");
return _object;
}
}
}