mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
flesh out some classpath classes
This commit is contained in:
@ -3,6 +3,10 @@ package java.util;
|
||||
public class Arrays {
|
||||
private Arrays() { }
|
||||
|
||||
private static boolean equal(Object a, Object b) {
|
||||
return (a == null && b == null) || (a != null && a.equals(b));
|
||||
}
|
||||
|
||||
public static <T> List<T> asList(final T ... array) {
|
||||
return new List<T>() {
|
||||
public int size() {
|
||||
@ -13,6 +17,15 @@ public class Arrays {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean contains(T element) {
|
||||
for (int i = 0; i < array.length; ++i) {
|
||||
if (equal(element, array[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public T get(int index) {
|
||||
return array[index];
|
||||
}
|
||||
|
Reference in New Issue
Block a user