generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override equals method in HL7Path to address issue raised by SonarCloud
- Loading branch information
1 parent
b845dcd
commit 12ee956
Showing
1 changed file
with
13 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 13 additions & 1 deletion
14
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/hl7/HL7Path.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |