Skip to content
Merged
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 @@ -376,6 +376,25 @@ public String[] option(Iterable<? extends Path> paths) {
return format(moduleName, paths);
}

/**
* {@return a hash code value based on the raw type and module name}.
*/
@Override
public int hashCode() {
return rawType().hashCode() + 17 * moduleName.hashCode();
}

/**
* {@return whether the given object represents the same type of path as this object}.
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof Modular m) {
return rawType() == m.rawType() && moduleName.equals(m.moduleName);
}
return false;
}

/**
* Returns the programmatic name of this path type, including the module to patch.
* For example, if this type was created by {@code JavaPathType.patchModule("foo.bar")},
Expand Down
Loading