com.ibm.jarm.api.util

Class Util

  • java.lang.Object
    • com.ibm.jarm.api.util.Util


  • public class Util
    extends java.lang.Object
    Static utility methods common to the API and RAL layers.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String ckInvalidStrParam(java.lang.String paramName, java.lang.String param)
      Verifies that the given String parameter is not null, is not an empty String and is not a String containing only spaces.
      static void ckNullObjParam(java.lang.String paramName, java.lang.Object param)
      Verifies that the given object parameter is not null.
      static void ckNullOrInvalidArrayParam(java.lang.String paramName, java.lang.Object[] param)
      Verifies that the given object array parameter is neither null nor empty and contains no null members.
      static void ckNullOrInvalidCollectionParam(java.lang.String paramName, java.util.Collection<? extends java.lang.Object> param)
      Verifies that the given collection parameter is neither null nor empty and contains no null members.
      static void dbgOutput(java.lang.String msgPattern, java.lang.Object... params)
      FOR DEVELOPMENT USE ONLY!
      static java.io.PrintStream getDbgOutputStream()
      FOR DEVELOPMENT USE ONLY!
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ckNullObjParam

        public static void ckNullObjParam(java.lang.String paramName,
                          java.lang.Object param)
        Verifies that the given object parameter is not null.
        Parameters:
        paramName - The String name of the parameter for error reporting purposes.
        param - The parameter in question.
        Throws:
        E_NULL_OR_EMPTY_INPUT_PARAM - if param is null.
      • ckNullOrInvalidArrayParam

        public static void ckNullOrInvalidArrayParam(java.lang.String paramName,
                                     java.lang.Object[] param)
        Verifies that the given object array parameter is neither null nor empty and contains no null members.
        Parameters:
        paramName - The String name of the parameter for error reporting purposes.
        param - The array parameter in question.
        Throws:
        E_NULL_OR_INVALID_ARRAY_PARAM - if param array is null, empty, contains a null member.
      • ckNullOrInvalidCollectionParam

        public static void ckNullOrInvalidCollectionParam(java.lang.String paramName,
                                          java.util.Collection<? extends java.lang.Object> param)
        Verifies that the given collection parameter is neither null nor empty and contains no null members.
        Parameters:
        paramName - The String name of the parameter for error reporting purposes.
        param - The collection parameter in question.
        Throws:
        E_NULL_OR_INVALID_COLLECTION_PARAM - if param collection is null, empty, or contains a null member.
      • ckInvalidStrParam

        public static java.lang.String ckInvalidStrParam(java.lang.String paramName,
                                         java.lang.String param)
        Verifies that the given String parameter is not null, is not an empty String and is not a String containing only spaces.
        Parameters:
        paramName - The String name of the parameter for error reporting purposes.
        param - The String parameter in question.
        Returns:
        A String.Trim() version of param.
        Throws:
        E_NULL_OR_EMPTY_INPUT_PARAM - if param is null, empty, or contains only spaces.
      • dbgOutput

        public static void dbgOutput(java.lang.String msgPattern,
                     java.lang.Object... params)
        FOR DEVELOPMENT USE ONLY!

        Helper method to output a debug message primarily for test failure problems in RTC Build environment.

        Parameters:
        msgPattern - a pattern string for MessageFormat.
        params - optional pattern replacement parameters.
      • getDbgOutputStream

        public static java.io.PrintStream getDbgOutputStream()
        FOR DEVELOPMENT USE ONLY!

        Used to acquire a PrintStream instance for debugging test failures in the RTC build environment. Expects there to be either a "D:/Temp" or "C:/Temp" directory in which a "JARM_DBG" sub-directory can be created (if necessary). Whenever the first request for the PrintStream is made, a "dbgInfo_{TS}.txt" file is created in this directory and a PrintStream returned for it.

        Returns:
        PrintStream instance or null if one cannot be acquired.

© Copyright IBM Corp. 2010, 2014. All Rights Reserved.