All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.coinbub.daemon.proxy.converters.HexConverter Maven / Gradle / Ivy

The newest version!
package tech.coinbub.daemon.proxy.converters;

import tech.coinbub.daemon.proxy.Converter;

public class HexConverter implements Converter {

    @Override
    public Object marshal(final Object from) {
        if (from instanceof Integer) {
            return "0x" + Integer.toHexString((Integer) from);
        }
        if (from instanceof Long) {
            return "0x" + Long.toHexString((Long) from);
        }
        return null;
    }

    @Override
    public Object unmarshal(final Object from) {
        return Long.decode(from.toString());
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy