Skip to content

Commit

Permalink
Override equals method in HL7Path to address issue raised by SonarCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
basiliskus committed Dec 23, 2024
1 parent b845dcd commit 12ee956
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
package gov.hhs.cdc.trustedintermediary.rse2e.hl7;

import java.util.Arrays;
import java.util.Objects;

/** The HL7Path class represents a path to a specific field in an HL7 message. */
public record HL7Path(String segmentName, int[] indices) {}
public record HL7Path(String segmentName, int[] indices) {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
HL7Path hl7Path = (HL7Path) o;
return (Objects.equals(segmentName, hl7Path.segmentName))
&& Arrays.equals(indices, hl7Path.indices);
}
}

0 comments on commit 12ee956

Please sign in to comment.