
com.threerings.servlet.util.Converters Maven / Gradle / Ivy
//
// ooo-util - a place for OOO utilities
// Copyright (C) 2011 Three Rings Design, Inc., All Rights Reserved
// http://github.com/threerings/ooo-util/blob/master/LICENSE
package com.threerings.servlet.util;
import com.google.common.base.Function;
public class Converters
{
public static final Function TO_LONG = new Function() {
public Long apply (String from) {
return Long.parseLong(from);
}
};
public static final Function TO_BOOLEAN = new Function() {
public Boolean apply (String from) {
return Boolean.parseBoolean(from);
}
};
public static final Function TO_INT = new Function() {
public Integer apply (String from) {
return Integer.parseInt(from);
}
};
public static final Function TO_BYTE = new Function() {
public Byte apply (String from) {
return Byte.parseByte(from);
}
};
public static final Function TO_FLOAT = new Function() {
public Float apply (String from) {
return Float.parseFloat(from);
}
};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy