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 voidclose(AutoCloseable closeable)Close anAutoCloseableobject.static voidclose(AutoCloseable... closeable)Close a group ofAutoCloseableobjects.static voidclose(Object obj)Close an object.static voidclose(Object... objs)Close a group of objects.
-
-
-
Method Detail
-
close
public static void close(Object... objs)
Close a group of objects. If an object implementsAutoCloseablethen 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 implementsAutoCloseablethen 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 ofAutoCloseableobjects. Any exceptions that are thrown are caught and ignored.- Parameters:
closeable- the objects to close
-
close
public static void close(AutoCloseable closeable)
Close anAutoCloseableobject. Any exceptions that are thrown are caught and ignored.- Parameters:
closeable- the object to close
-
-