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
package org.litesoft.sandbox.multimodule.client.foundation.support;

public class LuckyIdCodec
{
    public static String encode( Long luckyId )
    {
        return (luckyId == null) ? null : Long.toOctalString( luckyId + Integer.MAX_VALUE );
    }

    public static Long decode( String luckyId )
    {
        if ( luckyId != null )
        {
            if ( (luckyId = luckyId.trim()).length() != 0 )
            {
                try
                {
                    return Long.parseLong( luckyId, 8 ) - Integer.MAX_VALUE;
                }
                catch ( NumberFormatException e )
                {
                    // Ignore...
                }
            }
        }
        return null;
    }
}

Commits for litesoft/trunk/GWT_Sandbox/MultiModuleSingleSrc/main/src/org/litesoft/sandbox/multimodule/client/foundation/support/LuckyIdCodec.java

Diff revisions: vs.
Revision Author Commited Message
582 GeorgeS picture GeorgeS Mon 14 Nov, 2011 19:55:23 +0000

Single Dir Based MultiModule