de.esprit.common.util

## Class NullSafe

- java.lang.Object
- - de.esprit.common.util.NullSafe

-     public final class NullSafe
      extends java.lang.Object

  This class provides support for null-save actions, such as closing streams, connections etc.
  Author:
    Rainer Buesch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `cancel(AsyncTask cancellable)`
    `static void` | `close(java.lang.AutoCloseable c)` Null-safe close of a Closeable object
    `static void` | `close(java.io.Closeable c)` Null-safe close of a Closeable object
    `static void` | `close(java.sql.Connection dbConn)` Null-safe close of a connection
    `static void` | `close(java.sql.ResultSet rs)` Null-safe close of a result set
    `static void` | `close(java.sql.ResultSet rs, java.sql.Statement stmt)` Null-safe close of both a result set and a statement
    `static void` | `close(java.util.Scanner scanner)` Null-safe close of a Scanner
    `static void` | `close(java.net.ServerSocket socket)` Null-safe close of a socket
    `static void` | `close(java.net.Socket socket)` Null-safe close of a socket
    `static void` | `close(java.sql.Statement stmt)` Null-safe close of a statement
    `static void` | `close(java.util.zip.ZipFile zipFile)` Null-safe close of a zip-file
    `static int` | `sizeOf(byte[] array)` Null-safe return of the array size.
    `static int` | `sizeOf(java.util.Collection list)` Null-safe return of the list size.
    `static int` | `sizeOf(double[] array)` Null-safe return of the array size.
    `static int` | `sizeOf(int[] array)` Null-safe return of the array size.
    `static int` | `sizeOf(java.util.Map map)` Null-safe return of the map size.
    `static int` | `sizeOf(java.lang.Object[] array)` Null-safe return of the array size.
    `static int` | `sizeOf(java.lang.String s)` Null-safe return of the string size.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### cancel

          public static void cancel(AsyncTask cancellable)

    - #### close

          public static void close(java.io.Closeable c)

      Null-safe close of a Closeable object

    - #### close

          public static void close(java.lang.AutoCloseable c)

      Null-safe close of a Closeable object

    - #### close

          public static void close(java.util.zip.ZipFile zipFile)

      Null-safe close of a zip-file

    - #### close

          public static void close(java.net.ServerSocket socket)

      Null-safe close of a socket

    - #### close

          public static void close(java.net.Socket socket)

      Null-safe close of a socket

    - #### close

          public static void close(java.util.Scanner scanner)

      Null-safe close of a Scanner

    - #### close

          public static void close(java.sql.Connection dbConn)

      Null-safe close of a connection

    - #### close

          public static void close(java.sql.ResultSet rs,
                   java.sql.Statement stmt)

      Null-safe close of both a result set and a statement

    - #### close

          public static void close(java.sql.Statement stmt)

      Null-safe close of a statement

    - #### close

          public static void close(java.sql.ResultSet rs)

      Null-safe close of a result set

    - #### sizeOf

          public static int sizeOf(byte[] array)

      Null-safe return of the array size.

    - #### sizeOf

          public static int sizeOf(int[] array)

      Null-safe return of the array size.

    - #### sizeOf

          public static int sizeOf(double[] array)

      Null-safe return of the array size.

    - #### sizeOf

          public static int sizeOf(java.lang.Object[] array)

      Null-safe return of the array size.

    - #### sizeOf

          public static int sizeOf(java.util.Collection list)

      Null-safe return of the list size.

    - #### sizeOf

          public static int sizeOf(java.util.Map map)

      Null-safe return of the map size.

    - #### sizeOf

          public static int sizeOf(java.lang.String s)

      Null-safe return of the string size.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.