org.aksw.commons.util.reflect
Class Caster

java.lang.Object
  extended by org.aksw.commons.util.reflect.Caster

public class Caster
extends Object

Utility class for common casts. TODO Make this more configurable.

Author:
Claus Stadler

Date: 9/17/11 Time: 5:31 PM


Constructor Summary
Caster()
           
 
Method Summary
static void main(String[] args)
           
static Boolean toBoolean(String a)
           
static Double toDouble(Float a)
           
static Double toDouble(Integer a)
           
static Double toDouble(Long a)
           
static Double toDouble(String a)
           
static Float toFloat(Double a)
           
static Float toFloat(Integer a)
           
static Float toFloat(Long a)
           
static Float toFloat(String s)
           
static Integer toInteger(Double a)
           
static Integer toInteger(Float a)
           
static Integer toInteger(Long a)
           
static Integer toInteger(String a)
           
static Long toLong(Double a)
           
static Long toLong(Float a)
           
static Long toLong(Integer a)
           
static Long toLong(String a)
           
static String toString(Object o)
           
static Object tryCast(Object value, Class<?> targetClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Caster

public Caster()
Method Detail

tryCast

public static Object tryCast(Object value,
                             Class<?> targetClass)

main

public static void main(String[] args)

toString

public static String toString(Object o)

toBoolean

public static Boolean toBoolean(String a)

toInteger

public static Integer toInteger(Long a)

toInteger

public static Integer toInteger(Float a)

toInteger

public static Integer toInteger(Double a)

toInteger

public static Integer toInteger(String a)

toLong

public static Long toLong(Integer a)

toLong

public static Long toLong(Float a)

toLong

public static Long toLong(Double a)

toLong

public static Long toLong(String a)

toFloat

public static Float toFloat(Long a)

toFloat

public static Float toFloat(Integer a)

toFloat

public static Float toFloat(Double a)

toFloat

public static Float toFloat(String s)

toDouble

public static Double toDouble(Integer a)

toDouble

public static Double toDouble(Long a)

toDouble

public static Double toDouble(Float a)

toDouble

public static Double toDouble(String a)


Copyright © 2012. All Rights Reserved.