/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.util.RandomUtil
 */
package com.l7tech.server.upgrade;

import com.l7tech.objectmodel.Goid;
import com.l7tech.util.RandomUtil;
import java.util.HashMap;

public final class DerbyFunctions {
    private static final HashMap<String, String> a = new HashMap();

    public static byte[] toGoid(Long l2, Long l3) {
        return l2 != null && l3 != null ? new Goid(l2.longValue(), l3.longValue()).getBytes() : null;
    }

    public static String goidToString(byte[] byArray) {
        return byArray != null ? new Goid(byArray).toHexString() : null;
    }

    public static String ifNull(String string, String string2) {
        return string != null ? string : string2;
    }

    public static long randomLong() {
        return RandomUtil.nextLong();
    }

    public static long randomLongNotReserved() {
        long l2;
        while ((l2 = RandomUtil.nextLong()) >= 0L && l2 < 65536L) {
        }
        return l2;
    }

    public static void setVariable(String string, String string2) {
        a.put(string, string2);
    }

    public static String getVariable(String string) {
        return a.get(string);
    }
}

