org.crsh.util
Class Safe
java.lang.Object
org.crsh.util.Safe
-
public class Safe
- extends Object
-
Constructor Summary |
Safe()
|
Method Summary |
static boolean |
close(Closeable closeable)
Close the closeable and catch any exception thrown. |
static boolean |
close(Connection connection)
Close the connection and catch any exception thrown. |
static boolean |
close(Context context)
Close the context and catch any exception thrown. |
static boolean |
close(ResultSet rs)
Close the result set and catch any exception thrown. |
static boolean |
close(Socket socket)
Close the socket and catch any exception thrown. |
static boolean |
close(Statement statement)
Close the statement and catch any exception thrown. |
static boolean |
equals(Object o1, Object o2)
|
static boolean |
flush(Flushable flushable)
Flush the flushable and catch any exception thrown. |
static boolean |
notEquals(Object o1, Object o2)
|
static
<T extends Throwable>
void |
|
rethrow(Class<T> throwableClass, Throwable cause)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Safe
public Safe()
close
public static boolean close(Socket socket)
-
Close the socket and catch any exception thrown.
-
- Parameters:
socket
- the socket to close
- Returns:
- true when the close operation returned
close
public static boolean close(Closeable closeable)
-
Close the closeable and catch any exception thrown.
-
- Parameters:
closeable
- the closeable to close
- Returns:
- true when the close operation returned
close
public static boolean close(Connection connection)
-
Close the connection and catch any exception thrown.
-
- Parameters:
connection
- the socket to close
- Returns:
- true when the connection operation returned
close
public static boolean close(Statement statement)
-
Close the statement and catch any exception thrown.
-
- Parameters:
statement
- the statement to close
- Returns:
- true when the close operation returned
close
public static boolean close(ResultSet rs)
-
Close the result set and catch any exception thrown.
-
- Parameters:
rs
- the result set to close
- Returns:
- true when the close operation returned
close
public static boolean close(Context context)
-
Close the context and catch any exception thrown.
-
- Parameters:
context
- the context to close
- Returns:
- true when the close operation returned
rethrow
public static <T extends Throwable> void rethrow(Class<T> throwableClass,
Throwable cause)
throws T extends Throwable
-
- Throws:
T extends Throwable
equals
public static boolean equals(Object o1,
Object o2)
-
notEquals
public static boolean notEquals(Object o1,
Object o2)
-
flush
public static boolean flush(Flushable flushable)
-
Flush the flushable and catch any exception thrown.
-
- Parameters:
flushable
- the flushable to flush
- Returns:
- true when the flush operation returned
Copyright © 2014 eXo Platform SAS. All Rights Reserved.