Skip to content
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLArgument.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,23 @@ public GraphQLArgument withNewChildren(SchemaElementChildrenContainer newChildre
.replaceDirectives(newChildren.getChildren(CHILD_DIRECTIVES)));
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


/**
* This helps you transform the current GraphQLArgument into another one by starting a builder with all
* the current values and allows you to transform it how you want.
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLDirective.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,23 @@ public GraphQLDirective withNewChildren(SchemaElementChildrenContainer newChildr
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newDirective() {
return new Builder();
}
Expand Down
18 changes: 17 additions & 1 deletion src/main/java/graphql/schema/GraphQLEnumType.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class GraphQLEnumType implements GraphQLNamedInputType, GraphQLNamedOutpu
public static final String CHILD_DIRECTIVES = "directives";



/**
* @param name the name
* @param description the description
Expand Down Expand Up @@ -236,6 +235,23 @@ public GraphQLEnumType withNewChildren(SchemaElementChildrenContainer newChildre
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newEnum() {
return new Builder();
}
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLEnumValueDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ public GraphQLEnumValueDefinition withNewChildren(SchemaElementChildrenContainer
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newEnumValueDefinition() {
return new Builder();
}
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLFieldDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,23 @@ public GraphQLSchemaElement withNewChildren(SchemaElementChildrenContainer newCh
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newFieldDefinition(GraphQLFieldDefinition existing) {
return new Builder(existing);
}
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLInputObjectField.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,23 @@ public GraphQLInputObjectField withNewChildren(SchemaElementChildrenContainer ne
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


@Override
public String toString() {
return "GraphQLInputObjectField{" +
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLInputObjectType.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,23 @@ public GraphQLInputObjectType withNewChildren(SchemaElementChildrenContainer new
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


@Override
public String toString() {
return "GraphQLInputObjectType{" +
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/graphql/schema/GraphQLInterfaceType.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,22 @@ void replaceInterfaces(List<GraphQLNamedOutputType> interfaces) {
this.replacedInterfaces = sortTypes(interfaceComparator, interfaces);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newInterface() {
return new Builder();
Expand Down
34 changes: 25 additions & 9 deletions src/main/java/graphql/schema/GraphQLList.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,30 @@ public GraphQLType getWrappedType() {
return replacedWrappedType != null ? replacedWrappedType : originalWrappedType;
}

public GraphQLType getOriginalWrappedType() {
return originalWrappedType;
}

void replaceType(GraphQLType type) {
this.replacedWrappedType = type;
}

@Override
public boolean equals(Object o) {

public boolean isEqualTo(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

GraphQLList that = (GraphQLList) o;
GraphQLType wrappedType = getWrappedType();

if (wrappedType instanceof GraphQLNonNull) {
return ((GraphQLNonNull) wrappedType).isEqualTo(that.getWrappedType());
}
return Objects.equals(wrappedType, that.getWrappedType());
}

@Override
public int hashCode() {
return getWrappedType() != null ? getWrappedType().hashCode() : 0;
}

@Override
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) {
return visitor.visitGraphQLList(this, context);
Expand Down Expand Up @@ -102,4 +102,20 @@ public String toString() {
return GraphQLTypeUtil.simplePrint(this);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}

}
34 changes: 25 additions & 9 deletions src/main/java/graphql/schema/GraphQLNonNull.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* See http://graphql.org/learn/schema/#lists-and-non-null for more details on the concept
*/
@PublicApi

public class GraphQLNonNull implements GraphQLType, GraphQLInputType, GraphQLOutputType, GraphQLModifiedType {

/**
Expand All @@ -27,6 +26,7 @@ public class GraphQLNonNull implements GraphQLType, GraphQLInputType, GraphQLOut
* {@code .type(nonNull(GraphQLString)) }
*
* @param wrappedType the type to wrap as being non null
*
* @return a GraphQLNonNull of that wrapped type
*/
public static GraphQLNonNull nonNull(GraphQLType wrappedType) {
Expand Down Expand Up @@ -55,31 +55,30 @@ public GraphQLType getWrappedType() {
return replacedWrappedType != null ? replacedWrappedType : originalWrappedType;
}

public GraphQLType getOriginalWrappedType() {
return originalWrappedType;
}

void replaceType(GraphQLType type) {
assertNonNullWrapping(type);
this.replacedWrappedType = type;
}

@Override
public boolean equals(Object o) {
public boolean isEqualTo(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

GraphQLNonNull that = (GraphQLNonNull) o;
GraphQLType wrappedType = getWrappedType();

if (wrappedType instanceof GraphQLList) {
return ((GraphQLList) wrappedType).isEqualTo(that.getWrappedType());
}
return Objects.equals(wrappedType, that.getWrappedType());
}

@Override
public int hashCode() {
return getWrappedType() != null ? getWrappedType().hashCode() : 0;
}

@Override
public String toString() {
Expand Down Expand Up @@ -107,4 +106,21 @@ public SchemaElementChildrenContainer getChildrenWithTypeReferences() {
public GraphQLSchemaElement withNewChildren(SchemaElementChildrenContainer newChildren) {
return nonNull(newChildren.getChildOrNull(CHILD_WRAPPED_TYPE));
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}

}
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLObjectType.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ public GraphQLSchemaElement withNewChildren(SchemaElementChildrenContainer newCh
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newObject() {
return new Builder();
}
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/graphql/schema/GraphQLScalarType.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,23 @@ public GraphQLScalarType withNewChildren(SchemaElementChildrenContainer newChild
);
}

/**
* {@inheritDoc}
*/
@Override
public final boolean equals(Object o) {
return super.equals(o);
}

/**
* {@inheritDoc}
*/
@Override
public final int hashCode() {
return super.hashCode();
}


public static Builder newScalar() {
return new Builder();
}
Expand Down
Loading