Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Objects;

public class URLResourceReference implements ResourceReference {
private final URL url;
Expand Down Expand Up @@ -59,6 +60,25 @@ public ResourceType getResourceType() {
return ResourceType.URL;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}

if (o == null || getClass() != o.getClass()) {
return false;
}

final URLResourceReference that = (URLResourceReference) o;
return Objects.equals(url, that.url);
}

@Override
public int hashCode() {
return Objects.hash(url);
}

@Override
public String toString() {
return "URLResourceReference[url=" + url + "]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.InputStream;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Objects;

public class Utf8TextResource implements ResourceReference {
private final String text;
Expand Down Expand Up @@ -61,6 +62,25 @@ public ResourceType getResourceType() {
return ResourceType.TEXT;
}

@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}

if (o == null || getClass() != o.getClass()) {
return false;
}

final Utf8TextResource that = (Utf8TextResource) o;
return Objects.equals(text, that.text);
}

@Override
public int hashCode() {
return Objects.hash(text);
}

@Override
public String toString() {
return "Utf8TextResource[text=" + text.length() + " characters]";
Expand Down
Loading