Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.litesoft.sandbox.anywhere.util;

public class UtilsCommon
{
    public static <T> T deNull( T pValueToCheck, T pDefaultValue )
    {
        return (pValueToCheck != null) ? pValueToCheck : pDefaultValue;
    }

    public static String noEmpty( String pValue )
    {
        if ( pValue != null )
        {
            if ( (pValue = pValue.trim()).length() == 0 )
            {
                pValue = null;
            }
        }
        return pValue;
    }

    public static String assertNotEmpty( String pWhat, String pValue )
    {
        if ( null == (pValue = noEmpty( pValue )) )
        {
            throw new IllegalArgumentException( pWhat + " not allowed to be null or Empty!" );
        }
        return pValue;
    }
}

Commits for litesoft/trunk/GWT_Sandbox/MultiModule/anywhere/src/org/litesoft/sandbox/anywhere/util/UtilsCommon.java

Diff revisions: vs.
Revision Author Commited Message
540 GeorgeS picture GeorgeS Mon 03 Oct, 2011 04:22:28 +0000