
com.github.sbt.jni.javah.search.ClassPath Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bleep-plugin-jni_3 Show documentation
Show all versions of bleep-plugin-jni_3 Show documentation
A bleeping fast scala build tool!
package com.github.sbt.jni.javah.search;
import com.github.sbt.jni.javah.ClassName;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static com.github.sbt.jni.javah.util.Utils.*;
public class ClassPath implements SearchPath {
private final Path path;
private final List roots;
public ClassPath(Path path) {
Objects.requireNonNull(path);
this.path = path.toAbsolutePath();
Path root = classPathRoot(path);
roots = root == null ? Collections.emptyList() : SearchPath.multiReleaseRoots(root);
}
@Override
public Path search(ClassName name) {
Objects.requireNonNull(name);
return SearchPath.searchFromRoots(roots, name);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ClassPath classPath = (ClassPath) o;
return Objects.equals(path, classPath.path);
}
@Override
public int hashCode() {
return path.hashCode();
}
@Override
public String toString() {
return "ClassPath[" + path + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy