Package org.apache.cayenne.util

# Class ConversionUtil

java.lang.Object
org.apache.cayenne.util.ConversionUtil

public final class ConversionUtil extends Object
A collection of static conversion utility methods.

Since:
  1.1

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static BigDecimal`
  `toBigDecimal(Object object)`
  `static boolean`
  `toBoolean(Object object)`
  `static Comparable`
  `toComparable(Object object)`
  Attempts to convert an object to Comparable instance.
  `static double`
  `toDouble(Object object, double defaultValue)`
  `static int`
  `toInt(Object object, int defaultValue)`
  `static long`
  `toLong(Object object, long defaultValue)`
  `static String`
  `toString(Object object)`
  Attempts to convert an object to Comparable instance.
  `static Object`
  `toUpperCase(Object object)`
  Attempts to convert an object to an uppercase string.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### toInt

    public static int toInt(Object object, int defaultValue)

  - ### toLong

    public static long toLong(Object object, long defaultValue)
    Since:
      3.1

  - ### toDouble

    public static double toDouble(Object object, double defaultValue)
    Since:
      4.0

  - ### toBoolean

    public static boolean toBoolean(Object object)

  - ### toBigDecimal

    public static BigDecimal toBigDecimal(Object object)

  - ### toComparable

    public static Comparable toComparable(Object object)
    Attempts to convert an object to Comparable instance.

  - ### toString

    public static String toString(Object object)
    Attempts to convert an object to Comparable instance.

  - ### toUpperCase

    public static Object toUpperCase(Object object)
    Attempts to convert an object to an uppercase string.