graphql.schema.GraphQLNonNull Maven / Gradle / Ivy
package graphql.schema;
import java.util.Map;
import static graphql.Assert.assertNotNull;
public class GraphQLNonNull implements GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLModifiedType {
private GraphQLType wrappedType;
public GraphQLNonNull(GraphQLType wrappedType) {
assertNotNull(wrappedType, "wrappedType can't be null");
this.wrappedType = wrappedType;
}
public GraphQLType getWrappedType() {
return wrappedType;
}
void replaceTypeReferences(Map typeMap) {
wrappedType = new SchemaUtil().resolveTypeReference(wrappedType, typeMap);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GraphQLNonNull that = (GraphQLNonNull) o;
return !(wrappedType != null ? !wrappedType.equals(that.wrappedType) : that.wrappedType != null);
}
@Override
public int hashCode() {
return wrappedType != null ? wrappedType.hashCode() : 0;
}
@Override
public String toString() {
return "GraphQLNonNull{" +
"wrappedType=" + wrappedType +
'}';
}
@Override
public String getName() {
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy