Fixed utility classes having constructors.

This commit is contained in:
sk89q
2014-04-04 14:35:12 -07:00
parent 2b0ee84952
commit 478ce3f627
14 changed files with 67 additions and 41 deletions

View File

@ -18,7 +18,10 @@
package com.sk89q.util;
public class ArrayUtil {
public final class ArrayUtil {
private ArrayUtil() {
}
public static String[] removePortionOfArray(String[] array, int from, int to, String replace) {
String[] newArray = new String[from + array.length - to - (replace == null ? 1 : 0)];

View File

@ -24,7 +24,11 @@ import java.lang.reflect.Field;
/**
* @author zml2008
*/
public class ReflectionUtil {
public final class ReflectionUtil {
private ReflectionUtil() {
}
@SuppressWarnings("unchecked")
public static <T> T getField(Object from, String name) {
Class<?> checkClass = from.getClass();
@ -39,4 +43,5 @@ public class ReflectionUtil {
} while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null));
return null;
}
}

View File

@ -26,7 +26,11 @@ import java.util.Map;
*
* @author sk89q
*/
public class StringUtil {
public final class StringUtil {
private StringUtil() {
}
/**
* Trim a string if it is longer than a certain length.
*