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
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
948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

669 Diff Diff GeorgeS picture GeorgeS Sun 13 May, 2012 23:29:27 +0000
585 Diff Diff GeorgeS picture GeorgeS Fri 18 Nov, 2011 17:55:26 +0000
582 GeorgeS picture GeorgeS Mon 14 Nov, 2011 19:55:23 +0000

Single Dir Based MultiModule