Package uk.gov.gchq.gaffer.commonutil
Class CloseableUtil
- java.lang.Object
-
- uk.gov.gchq.gaffer.commonutil.CloseableUtil
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
close(AutoCloseable closeable)
Close anAutoCloseable
object.static void
close(AutoCloseable... closeable)
Close a group ofAutoCloseable
objects.static void
close(Object obj)
Close an object.static void
close(Object... objs)
Close a group of objects.
-
-
-
Method Detail
-
close
public static void close(Object... objs)
Close a group of objects. If an object implementsAutoCloseable
then the object will be closed. Any exceptions that are thrown are caught and ignored.- Parameters:
objs
- the objects to attempt to close
-
close
public static void close(Object obj)
Close an object. If the object implementsAutoCloseable
then the object will be closed. Any exceptions that are thrown are caught and ignored.- Parameters:
obj
- the object to attempt to close
-
close
public static void close(AutoCloseable... closeable)
Close a group ofAutoCloseable
objects. Any exceptions that are thrown are caught and ignored.- Parameters:
closeable
- the objects to close
-
close
public static void close(AutoCloseable closeable)
Close anAutoCloseable
object. Any exceptions that are thrown are caught and ignored.- Parameters:
closeable
- the object to close
-
-