File tree Expand file tree Collapse file tree
src/main/java/org/apache/nifi/components/resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import java .io .IOException ;
2222import java .io .InputStream ;
2323import java .net .URL ;
24+ import java .util .Objects ;
2425
2526public class URLResourceReference implements ResourceReference {
2627 private final URL url ;
@@ -59,6 +60,25 @@ public ResourceType getResourceType() {
5960 return ResourceType .URL ;
6061 }
6162
63+ @ Override
64+ public boolean equals (final Object o ) {
65+ if (this == o ) {
66+ return true ;
67+ }
68+
69+ if (o == null || getClass () != o .getClass ()) {
70+ return false ;
71+ }
72+
73+ final URLResourceReference that = (URLResourceReference ) o ;
74+ return Objects .equals (url , that .url );
75+ }
76+
77+ @ Override
78+ public int hashCode () {
79+ return Objects .hash (url );
80+ }
81+
6282 @ Override
6383 public String toString () {
6484 return "URLResourceReference[url=" + url + "]" ;
Original file line number Diff line number Diff line change 2323import java .io .InputStream ;
2424import java .net .URL ;
2525import java .nio .charset .StandardCharsets ;
26+ import java .util .Objects ;
2627
2728public class Utf8TextResource implements ResourceReference {
2829 private final String text ;
@@ -61,6 +62,25 @@ public ResourceType getResourceType() {
6162 return ResourceType .TEXT ;
6263 }
6364
65+ @ Override
66+ public boolean equals (final Object o ) {
67+ if (this == o ) {
68+ return true ;
69+ }
70+
71+ if (o == null || getClass () != o .getClass ()) {
72+ return false ;
73+ }
74+
75+ final Utf8TextResource that = (Utf8TextResource ) o ;
76+ return Objects .equals (text , that .text );
77+ }
78+
79+ @ Override
80+ public int hashCode () {
81+ return Objects .hash (text );
82+ }
83+
6484 @ Override
6585 public String toString () {
6686 return "Utf8TextResource[text=" + text .length () + " characters]" ;
You can’t perform that action at this time.
0 commit comments