public class Util
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
LOGGING |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
closeSilently(java.sql.Connection c) |
static void |
closeSilently(java.io.InputStream in) |
static void |
closeSilently(java.io.OutputStream out) |
static void |
closeSilently(java.io.Reader in) |
static java.lang.String |
commonPrefix(java.lang.String s1,
java.lang.String s2) |
static int |
compare(int x,
int y)
return sign of x - y
|
static int |
compare(long x,
long y)
return sign of x - y
|
static <T> java.util.Set<T> |
emptyOrNonnullSingleton(T t) |
static <E> E |
first(java.lang.Iterable<E> i) |
static java.lang.String |
getFileExtension(java.io.File f) |
static java.io.Reader |
getFileReader(java.io.File filename) |
static java.io.Reader |
getFileReader(java.lang.String filename) |
static java.io.Writer |
getFileWriter(java.lang.String filename) |
static java.io.Reader |
getReader(java.io.InputStream in) |
static java.io.Writer |
getWriter(java.io.OutputStream out) |
static java.lang.String |
getXMLType(java.io.InputStream in) |
static <K,V> java.util.Map<K,V> |
immutableMap(java.util.Map<K,V> map) |
static java.io.IOException |
makeIOException(java.lang.String msg,
java.lang.Throwable cause) |
static <T extends java.lang.Comparable<? super T>> |
nullSafeCompareTo(T o1,
T o2) |
static <T> boolean |
nullSafeEquals(T o1,
T o2) |
static int |
nullSafeHashcode(java.lang.Object o) |
static java.lang.String |
repeat(java.lang.String s,
int number) |
static void |
runLogAtShutdown(java.lang.Runnable r) |
static java.lang.Iterable<java.lang.Integer> |
setBitIteratable(java.util.BitSet b) |
static java.util.Iterator<java.lang.Integer> |
setBitIterator(java.util.BitSet b) |
static void |
throwIOException(java.lang.String msg,
java.lang.Throwable cause) |
public static int compare(int x, int y)
x
- y
- public static int compare(long x, long y)
x
- y
- public static java.lang.Iterable<java.lang.Integer> setBitIteratable(java.util.BitSet b)
public static java.util.Iterator<java.lang.Integer> setBitIterator(java.util.BitSet b)
public static java.lang.String repeat(java.lang.String s, int number)
public static void runLogAtShutdown(java.lang.Runnable r)
public static <T> java.util.Set<T> emptyOrNonnullSingleton(T t)
public static <K,V> java.util.Map<K,V> immutableMap(java.util.Map<K,V> map)
public static int nullSafeHashcode(@CheckForNull java.lang.Object o)
public static <T> boolean nullSafeEquals(@CheckForNull T o1, @CheckForNull T o2)
public static <T extends java.lang.Comparable<? super T>> int nullSafeCompareTo(@CheckForNull T o1, @CheckForNull T o2)
public static java.io.Reader getReader(@WillCloseWhenClosed java.io.InputStream in) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.io.Reader getFileReader(java.lang.String filename) throws java.io.UnsupportedEncodingException, java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.FileNotFoundException
public static java.io.Reader getFileReader(java.io.File filename) throws java.io.UnsupportedEncodingException, java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.FileNotFoundException
public static java.io.Writer getWriter(@WillCloseWhenClosed java.io.OutputStream out) throws java.io.UnsupportedEncodingException, java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.FileNotFoundException
public static java.io.Writer getFileWriter(java.lang.String filename) throws java.io.UnsupportedEncodingException, java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.FileNotFoundException
public static void closeSilently(@WillClose java.sql.Connection c)
public static void closeSilently(@WillClose java.io.InputStream in)
public static void closeSilently(@WillClose java.io.Reader in)
public static void closeSilently(@WillClose java.io.OutputStream out)
public static java.lang.String getXMLType(@WillNotClose java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.io.IOException makeIOException(java.lang.String msg, java.lang.Throwable cause)
public static java.lang.String getFileExtension(java.io.File f)
public static void throwIOException(java.lang.String msg, java.lang.Throwable cause) throws java.io.IOException
java.io.IOException
public static <E> E first(java.lang.Iterable<E> i)
i
- the Iterable whose first element is to be retrievedpublic static java.lang.String commonPrefix(java.lang.String s1, java.lang.String s2)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.