
javarepl.completion.ResolvedClass Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javarepl Show documentation
Show all versions of javarepl Show documentation
Java REPL is a simple Read-Eval-Print-Loop for Java language.
package javarepl.completion;
public final class ResolvedClass {
private final ResolvedPackage resolvedPackage;
private final String className;
public ResolvedClass(ResolvedPackage resolvedPackage, String className) {
this.resolvedPackage = resolvedPackage;
this.className = className;
}
public ResolvedPackage resolvedPackage() {
return resolvedPackage;
}
public String className() {
return className;
}
public String canonicalClassName() {
return (resolvedPackage.packageName().isEmpty() ? "" : resolvedPackage.packageName() + ".") + className;
}
@Override
public String toString() {
return resolvedPackage.packageName() + "." + className + " in " + resolvedPackage.file();
}
@Override
public int hashCode() {
return toString().hashCode();
}
@Override
public boolean equals(Object other) {
return other instanceof CompletionResult &&
other.getClass().equals(getClass()) &&
other.toString().equals(toString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy