diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/Synthetic.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/Synthetic.java index 771bbff0f..fc7a7a071 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/Synthetic.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/Synthetic.java @@ -55,6 +55,25 @@ protected Node createNode() { throw new CodegenException("attempted to serialize runtime only trait"); } + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } else if (!(other instanceof Synthetic)) { + return false; + } else { + Synthetic b = (Synthetic) other; + return toShapeId().equals(b.toShapeId()) && archetype.equals(b.getArchetype()); + } + } + + @Override + public int hashCode() { + return toShapeId().hashCode() * 17 + Node.objectNode() + .withOptionalMember(ARCHETYPE, archetype.map(ShapeId::toString).map(Node::from)) + .hashCode(); + } + @Override public SmithyBuilder toBuilder() { Builder builder = builder();