railo.runtime.util
Interface Cast

All Known Implementing Classes:
CastImpl

public interface Cast

This class can cast object of one type to a other by cold fusion rules


Method Summary
 Object castTo(PageContext pc, short type, Object o)
          cast a value to a value defined by type argument
 Object castTo(PageContext pc, short type, String strType, Object o)
          cast a value to a value defined by type argument
 Object castTo(PageContext pc, String type, Object o)
          cast a value to a value defined by type argument
 Object castTo(PageContext pc, String type, Object o, boolean alsoPattern)
          cast a value to a value defined by type argument
 Object to(String type, Object o, boolean alsoPattern)
          cast to given type
 Array toArray(Object obj)
          cast a Object to a Array Object
 Array toArray(Object obj, Array defaultValue)
          cast a Object to a Array Object
 String toBase64(Object o)
          cast a Object to a Base64 value
 String toBase64(Object o, String defaultValue)
          cast a Object to a Base64 value
 byte[] toBinary(Object obj)
          cast a Object to a Binary
 byte[] toBinary(Object obj, byte[] defaultValue)
          cast a Object to a Binary
 Boolean toBoolean(boolean b)
          cast a boolean value to a Boolean Object(reference type)
 Boolean toBoolean(char c)
          cast a char value to a Boolean Object(reference type)
 Boolean toBoolean(double d)
          cast a double value to a Boolean Object(reference type)
 Boolean toBoolean(Object o)
          cast a Object to a Boolean Object(reference type)
 Boolean toBoolean(Object o, Boolean defaultValue)
          cast a Object to a boolean value (refrence type), Exception Less
 Boolean toBoolean(String str)
          cast a Object to a Boolean Object(reference type)
 Boolean toBoolean(String str, Boolean defaultValue)
          cast a Object to a boolean value (refrence type), Exception Less
 boolean toBooleanValue(boolean b)
          cast a boolean value to a boolean value (do nothing)
 boolean toBooleanValue(char c)
          cast a double value to a boolean value (primitive value type)
 boolean toBooleanValue(double d)
          cast a double value to a boolean value (primitive value type)
 boolean toBooleanValue(Object o)
          cast a Object to a boolean value (primitive value type)
 boolean toBooleanValue(Object o, boolean defaultValue)
          cast a Object to a boolean value (primitive value type), Exception Less
 boolean toBooleanValue(String str)
          cast a String to a boolean value (primitive value type)
 boolean toBooleanValue(String str, boolean defaultValue)
          cast a String to a boolean value (primitive value type), return 1 for true, 0 for false and -1 if can't cast to a boolean type
 Byte toByte(boolean b)
          cast a boolean value to a Byte Object(reference type)
 Byte toByte(char c)
          cast a char value to a Byte Object(reference type)
 Byte toByte(double d)
          cast a double value to a Byte Object(reference type)
 Byte toByte(Object o)
          cast a Object to a Byte Object(reference type)
 Byte toByte(Object o, Byte defaultValue)
          cast a Object to a Byte Object(reference type)
 byte toByteValue(boolean b)
          cast a boolean value to a byte value
 byte toByteValue(char c)
          cast a char value to a byte value (do nothing)
 byte toByteValue(double d)
          cast a double value to a byte value (primitive value type)
 byte toByteValue(Object o)
          cast a Object to a byte value (primitive value type)
 byte toByteValue(Object o, byte defaultValue)
          cast a Object to a byte value (primitive value type)
 Character toCharacter(boolean b)
          cast a boolean value to a Character Object(reference type)
 Character toCharacter(char c)
          cast a char value to a Character Object(reference type)
 Character toCharacter(double d)
          cast a double value to a Character Object(reference type)
 Character toCharacter(Object o)
          cast a Object to a Character Object(reference type)
 Character toCharacter(Object o, Character defaultValue)
          cast a Object to a Character Object(reference type)
 char toCharValue(boolean b)
          cast a boolean value to a char value
 char toCharValue(char c)
          cast a char value to a char value (do nothing)
 char toCharValue(double d)
          cast a double value to a char value (primitive value type)
 char toCharValue(Object o)
          cast a Object to a char value (primitive value type)
 char toCharValue(Object o, char defaultValue)
          cast a Object to a char value (primitive value type)
 Collection toCollection(Object o)
          cast a Object to a Collection
 Collection toCollection(Object o, Collection defaultValue)
          cast a Object to a Collection, if not returns null
 Color toColor(Object o)
          cast to a color object
 DateTime toDate(boolean b, TimeZone tz)
          cast a boolean to a DateTime Object
 DateTime toDate(char c, TimeZone tz)
          cast a char to a DateTime Object
 DateTime toDate(double d, TimeZone tz)
          cast a double to a DateTime Object
 DateTime toDate(Locale locale, String str, TimeZone tz)
          parse a string to a Datetime Object
 DateTime toDate(Locale locale, String str, TimeZone tz, DateTime defaultValue)
          parse a string to a Datetime Object, returns null if can't convert
 DateTime toDate(Object o, boolean alsoNumbers, TimeZone tz, DateTime defaultValue)
          cast a Object to a DateTime Object
 DateTime toDate(Object o, TimeZone tz)
          cast a Object to a DateTime Object
 DateTime toDate(String str, boolean alsoNumbers, TimeZone tz, DateTime defaultValue)
          cast a Object to a DateTime Object
 DateTime toDate(String str, TimeZone tz)
          cast a Object to a DateTime Object
 DateTime toDatetime(Object o, TimeZone tz)
          cast a Object to a DateTime Object (alias for toDateTime)
 DateTime toDateTime(Object o, TimeZone tz)
          cast a Object to a DateTime Object
 String toDecimal(boolean b)
          cast a boolean to a decimal value (String:xx.xx)
 String toDecimal(char c)
          cast a char to a decimal value (String:xx.xx)
 String toDecimal(double d)
          cast a double to a decimal value (String:xx.xx)
 String toDecimal(Object value)
          cast a double to a decimal value (String:xx.xx)
 String toDecimal(Object value, String defaultValue)
          cast a double to a decimal value (String:xx.xx)
 Double toDouble(boolean b)
          cast a boolean value to a Double Object (reference Type)
 Double toDouble(char c)
          cast a char value to a Double Object (reference Type)
 Double toDouble(double d)
          cast a double value to a Double Object (reference Type)
 Double toDouble(Object o)
          cast a Object to a Double Object (reference Type)
 Double toDouble(Object o, Double defaultValue)
          cast a Object to a Double Object (reference Type)
 Double toDouble(String str)
          cast a String to a Double Object (reference Type)
 Double toDouble(String str, Double defaultValue)
          cast a String to a Double Object (reference Type)
 double toDoubleValue(boolean b)
          cast a boolean value to a double value (primitive value type)
 double toDoubleValue(char c)
          cast a char value to a double value (primitive value type)
 double toDoubleValue(double d)
          cast a double value to a double value (do nothing)
 double toDoubleValue(Object o)
          cast a Object to a double value (primitive value Type)
 double toDoubleValue(Object o, double defaultValue)
          cast a Object to a double value (primitive value Type)
 double toDoubleValue(String str)
          cast a Object to a double value (primitive value Type)
 double toDoubleValue(String str, double defaultValue)
          cast a Object to a double value (primitive value Type), if can't return Double.NaN
 File toFile(Object obj)
          convert a object to a File
 File toFile(Object obj, File defaultValue)
          convert a object to a File
 Integer toInteger(boolean b)
          casts a boolean to a Integer
 Integer toInteger(char c)
          casts a char to a Integer
 Integer toInteger(double d)
          casts a double to a Integer
 Integer toInteger(Object o)
          casts a Object to a Integer
 Integer toInteger(Object o, Integer defaultValue)
          casts a Object to a Integer
 int toIntValue(boolean b)
          cast a boolean value to a int value (primitive value type)
 int toIntValue(char c)
          cast a char value to a int value (primitive value type)
 int toIntValue(double d)
          cast a double value to a int value (primitive value type)
 int toIntValue(Object o)
          cast a Object to a int value (primitive value type)
 int toIntValue(Object o, int defaultValue)
          cast a Object to a int value (primitive value type)
 int toIntValue(String str)
          cast a String to a int value (primitive value type)
 int toIntValue(String str, int defaultValue)
          cast a Object to a double value (primitive value Type), if can't return Integer.MIN_VALUE
 Iterator toIterator(Object o)
          cast a Object to a Iterator or get Iterator from Object
 List toList(Object o)
          cast a Object to a Array Object
 List toList(Object o, boolean duplicate)
          cast a Object to a Array Object
 List toList(Object o, boolean duplicate, List defaultValue)
          cast a Object to a Array Object
 List toList(Object o, List defaultValue)
          cast a Object to a Array Object
 Locale toLocale(String strLocale)
          casts a string to a Locale
 Locale toLocale(String strLocale, Locale defaultValue)
          casts a string to a Locale
 Long toLong(boolean b)
          cast a boolean value to a Long Object(reference type)
 Long toLong(char c)
          cast a char value to a Long Object(reference type)
 Long toLong(double d)
          cast a double value to a Long Object(reference type)
 Long toLong(Object o)
          cast a Object to a Long Object(reference type)
 Long toLong(Object o, Long defaultValue)
          cast a Object to a Long Object(reference type)
 long toLongValue(boolean b)
          cast a boolean value to a long value
 long toLongValue(char c)
          cast a char value to a long value (do nothing)
 long toLongValue(double d)
          cast a double value to a long value (primitive value type)
 long toLongValue(Object o)
          cast a Object to a long value (primitive value type)
 long toLongValue(Object o, long defaultValue)
          cast a Object to a long value (primitive value type)
 Map toMap(Object o)
          cast a Object to a Map Object
 Map toMap(Object o, boolean duplicate)
          cast a Object to a Map Object
 Map toMap(Object o, boolean duplicate, Map defaultValue)
          cast a Object to a Map Object
 Map toMap(Object o, Map defaultValue)
          cast a Object to a Map Object
 Node toNode(Object o)
          casts a Object to a XML Node
 Node toNode(Object o, Node defaultValue)
          casts a Object to a XML Node
 NodeList toNodeList(Object o)
          casts a Object to a Node List
 NodeList toNodeList(Object o, NodeList defaultValue)
          casts a Object to a Node List
 Object toNull(Object value)
          casts a Object to null
 Object toNull(Object value, Object defaultValue)
          casts a Object to null
 PageException toPageException(Throwable t)
          cast a Throwable Object to a PageException Object
 Query toQuery(Object o)
          cast a Object to a Query Object
 Query toQuery(Object o, boolean duplicate)
          cast a Object to a Query Object
 Query toQuery(Object o, boolean duplicate, Query defaultValue)
          cast a Object to a Query Object
 Query toQuery(Object o, Query defaultValue)
          cast a Object to a Query Object
 Boolean toRef(boolean b)
          cast a boolean value to his (CFML) reference type Boolean
 Byte toRef(byte b)
          cast a byte value to his (CFML) reference type Boolean
 String toRef(char c)
          cast a char value to his (CFML) reference type String
 Collection toRef(Collection o)
          cast a Collection to a reference type (Object), in that case this method to nothing, because a Collection is already a reference type
 Double toRef(double d)
          cast a double value to his (CFML) reference type Double
 Float toRef(float f)
          cast a float value to his (CFML) reference type Float
 Integer toRef(int i)
          cast a int value to his (CFML) reference type Integer
 Long toRef(long l)
          cast a long value to his (CFML) reference type Long
 Object toRef(Object o)
          cast a Object to a reference type (Object), in that case this method to nothing, because a Object is already a reference type
 Short toRef(short s)
          cast a short value to his (CFML) reference type Integer
 String toRef(String o)
          cast a String to a reference type (Object), in that case this method to nothing, because a String is already a reference type
 Resource toResource(Object obj)
          convert a object to a Resource
 Resource toResource(Object obj, Resource defaultValue)
          convert a object to a Resource
 Serializable toSerializable(Object obj)
          cast Object to a Serializable Object
 Serializable toSerializable(Object object, Serializable defaultValue)
          cast Object to a Serializable Object
 Short toShort(boolean b)
          cast a boolean value to a Short Object(reference type)
 Short toShort(char c)
          cast a char value to a Short Object(reference type)
 Short toShort(double d)
          cast a double value to a Byte Object(reference type)
 Short toShort(Object o)
          cast a Object to a Short Object(reference type)
 Short toShort(Object o, Short defaultValue)
          cast a Object to a Short Object(reference type)
 short toShortValue(boolean b)
          cast a boolean value to a short value
 short toShortValue(char c)
          cast a char value to a short value (do nothing)
 short toShortValue(double d)
          cast a double value to a short value (primitive value type)
 short toShortValue(Object o)
          cast a Object to a short value (primitive value type)
 short toShortValue(Object o, short defaultValue)
          cast a Object to a short value (primitive value type)
 String toString(boolean b)
          cast a boolean value to a String
 String toString(double d)
          cast a double value to a String
 String toString(int i)
          cast a int value to a String
 String toString(long l)
          cast a long value to a String
 String toString(Object o)
          cast a Object to a String
 String toString(Object o, String defaultValue)
          cast a Object to a String dont throw a exception, if can't cast to a string return a empty string
 Struct toStruct(Object o)
          cast a Object to a Struct Object
 Struct toStruct(Object o, Struct defaultValue)
          cast a Object to a Struct Object
 Struct toStruct(Object o, Struct defaultValue, boolean caseSensitive)
           
 TimeSpan toTimespan(Object o)
          cast a Object to a TimeSpan Object (alias for toTimeSpan)
 TimeSpan toTimespan(Object o, TimeSpan defaultValue)
          cast a Object to a TimeSpan Object (alias for toTimeSpan)
 String toTypeName(Object o)
          return the type name of a object (string, boolean, int aso.), type is not same like class name
 Object toUUId(Object o)
          cast a Object to a UUID
 Object toUUId(Object o, Object defaultValue)
          cast a Object to a UUID
 Object toVariableName(Object o)
          cast a Object to a Variable Name
 Object toVariableName(Object obj, Object defaultValue)
          cast a Object to a Variable Name
 Object toVoid(Object o)
          cast a value to void (Empty String)
 Object toVoid(Object o, Object defaultValue)
          cast a value to void (Empty String)
 Node toXML(Object value)
          cast Object to a XML Node
 Node toXML(Object value, Node defaultValue)
          cast Object to a XML Node
 

Method Detail

toBooleanValue

boolean toBooleanValue(boolean b)
cast a boolean value to a boolean value (do nothing)

Parameters:
b - boolean value to cast
Returns:
casted boolean value

toBooleanValue

boolean toBooleanValue(double d)
cast a double value to a boolean value (primitive value type)

Parameters:
d - double value to cast
Returns:
casted boolean value

toBooleanValue

boolean toBooleanValue(char c)
cast a double value to a boolean value (primitive value type)

Parameters:
c - char value to cast
Returns:
casted boolean value

toBooleanValue

boolean toBooleanValue(Object o)
                       throws PageException
cast a Object to a boolean value (primitive value type)

Parameters:
o - Object to cast
Returns:
casted boolean value
Throws:
PageException

toDouble

Double toDouble(Object o)
                throws PageException
cast a Object to a Double Object (reference Type)

Parameters:
o - Object to cast
Returns:
casted Double Object
Throws:
PageException

toDouble

Double toDouble(Object o,
                Double defaultValue)
cast a Object to a Double Object (reference Type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Double Object

toDouble

Double toDouble(String str)
                throws PageException
cast a String to a Double Object (reference Type)

Parameters:
str - String to cast
Returns:
casted Double Object
Throws:
PageException

toDouble

Double toDouble(String str,
                Double defaultValue)
cast a String to a Double Object (reference Type)

Parameters:
str - String to cast
defaultValue -
Returns:
casted Double Object

toDouble

Double toDouble(double d)
cast a double value to a Double Object (reference Type)

Parameters:
d - double value to cast
Returns:
casted Double Object

toDouble

Double toDouble(boolean b)
cast a boolean value to a Double Object (reference Type)

Parameters:
b - boolean value to cast
Returns:
casted Double Object

toDouble

Double toDouble(char c)
cast a char value to a Double Object (reference Type)

Parameters:
c - char value to cast
Returns:
casted Double Object

toDoubleValue

double toDoubleValue(Object o)
                     throws PageException
cast a Object to a double value (primitive value Type)

Parameters:
o - Object to cast
Returns:
casted double value
Throws:
PageException

toDoubleValue

double toDoubleValue(String str)
                     throws PageException
cast a Object to a double value (primitive value Type)

Parameters:
str - String to cast
Returns:
casted double value
Throws:
PageException

toDoubleValue

double toDoubleValue(Object o,
                     double defaultValue)
cast a Object to a double value (primitive value Type)

Parameters:
o - Object to cast
defaultValue - if can't cast return this value
Returns:
casted double value

toDoubleValue

double toDoubleValue(String str,
                     double defaultValue)
cast a Object to a double value (primitive value Type), if can't return Double.NaN

Parameters:
str - String to cast
defaultValue - if can't cast return this value
Returns:
casted double value

toDoubleValue

double toDoubleValue(double d)
cast a double value to a double value (do nothing)

Parameters:
d - double value to cast
Returns:
casted double value

toDoubleValue

double toDoubleValue(boolean b)
cast a boolean value to a double value (primitive value type)

Parameters:
b - boolean value to cast
Returns:
casted double value

toDoubleValue

double toDoubleValue(char c)
cast a char value to a double value (primitive value type)

Parameters:
c - char value to cast
Returns:
casted double value

toIntValue

int toIntValue(Object o)
               throws PageException
cast a Object to a int value (primitive value type)

Parameters:
o - Object to cast
Returns:
casted int value
Throws:
PageException

toIntValue

int toIntValue(Object o,
               int defaultValue)
cast a Object to a int value (primitive value type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted int value

toIntValue

int toIntValue(String str)
               throws PageException
cast a String to a int value (primitive value type)

Parameters:
str - String to cast
Returns:
casted int value
Throws:
PageException

toIntValue

int toIntValue(String str,
               int defaultValue)
cast a Object to a double value (primitive value Type), if can't return Integer.MIN_VALUE

Parameters:
str - String to cast
defaultValue -
Returns:
casted double value

toIntValue

int toIntValue(double d)
cast a double value to a int value (primitive value type)

Parameters:
d - double value to cast
Returns:
casted int value

toIntValue

int toIntValue(boolean b)
cast a boolean value to a int value (primitive value type)

Parameters:
b - boolean value to cast
Returns:
casted int value

toIntValue

int toIntValue(char c)
cast a char value to a int value (primitive value type)

Parameters:
c - char value to cast
Returns:
casted int value

toDecimal

String toDecimal(Object value)
                 throws PageException
cast a double to a decimal value (String:xx.xx)

Parameters:
value - Object to cast
Returns:
casted decimal value
Throws:
PageException

toDecimal

String toDecimal(Object value,
                 String defaultValue)
cast a double to a decimal value (String:xx.xx)

Parameters:
value - Object to cast
defaultValue -
Returns:
casted decimal value

toDecimal

String toDecimal(char c)
cast a char to a decimal value (String:xx.xx)

Parameters:
c - char to cast
Returns:
casted decimal value

toDecimal

String toDecimal(boolean b)
cast a boolean to a decimal value (String:xx.xx)

Parameters:
b - boolean to cast
Returns:
casted decimal value

toDecimal

String toDecimal(double d)
cast a double to a decimal value (String:xx.xx)

Parameters:
d - double to cast
Returns:
casted decimal value

toBoolean

Boolean toBoolean(boolean b)
cast a boolean value to a Boolean Object(reference type)

Parameters:
b - boolean value to cast
Returns:
casted Boolean Object

toBoolean

Boolean toBoolean(char c)
cast a char value to a Boolean Object(reference type)

Parameters:
c - char value to cast
Returns:
casted Boolean Object

toBoolean

Boolean toBoolean(double d)
cast a double value to a Boolean Object(reference type)

Parameters:
d - double value to cast
Returns:
casted Boolean Object

toBoolean

Boolean toBoolean(Object o)
                  throws PageException
cast a Object to a Boolean Object(reference type)

Parameters:
o - Object to cast
Returns:
casted Boolean Object
Throws:
PageException

toBoolean

Boolean toBoolean(String str)
                  throws PageException
cast a Object to a Boolean Object(reference type)

Parameters:
str - String to cast
Returns:
casted Boolean Object
Throws:
PageException

toBooleanValue

boolean toBooleanValue(Object o,
                       boolean defaultValue)
cast a Object to a boolean value (primitive value type), Exception Less

Parameters:
o - Object to cast
defaultValue -
Returns:
casted boolean value

toBoolean

Boolean toBoolean(Object o,
                  Boolean defaultValue)
cast a Object to a boolean value (refrence type), Exception Less

Parameters:
o - Object to cast
defaultValue - default value
Returns:
casted boolean reference

toBoolean

Boolean toBoolean(String str,
                  Boolean defaultValue)
cast a Object to a boolean value (refrence type), Exception Less

Parameters:
str - String to cast
defaultValue - default value
Returns:
casted boolean reference

toCharValue

char toCharValue(boolean b)
cast a boolean value to a char value

Parameters:
b - boolean value to cast
Returns:
casted char value

toCharValue

char toCharValue(double d)
cast a double value to a char value (primitive value type)

Parameters:
d - double value to cast
Returns:
casted char value

toCharValue

char toCharValue(char c)
cast a char value to a char value (do nothing)

Parameters:
c - char value to cast
Returns:
casted char value

toCharValue

char toCharValue(Object o)
                 throws PageException
cast a Object to a char value (primitive value type)

Parameters:
o - Object to cast
Returns:
casted char value
Throws:
PageException

toCharValue

char toCharValue(Object o,
                 char defaultValue)
cast a Object to a char value (primitive value type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted char value

toCharacter

Character toCharacter(boolean b)
cast a boolean value to a Character Object(reference type)

Parameters:
b - boolean value to cast
Returns:
casted Character Object

toCharacter

Character toCharacter(char c)
cast a char value to a Character Object(reference type)

Parameters:
c - char value to cast
Returns:
casted Character Object

toCharacter

Character toCharacter(double d)
cast a double value to a Character Object(reference type)

Parameters:
d - double value to cast
Returns:
casted Character Object

toCharacter

Character toCharacter(Object o,
                      Character defaultValue)
cast a Object to a Character Object(reference type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Character Object

toCharacter

Character toCharacter(Object o)
                      throws PageException
cast a Object to a Character Object(reference type)

Parameters:
o - Object to cast
Returns:
casted Character Object
Throws:
PageException

toByteValue

byte toByteValue(boolean b)
cast a boolean value to a byte value

Parameters:
b - boolean value to cast
Returns:
casted byte value

toByteValue

byte toByteValue(double d)
cast a double value to a byte value (primitive value type)

Parameters:
d - double value to cast
Returns:
casted byte value

toByteValue

byte toByteValue(char c)
cast a char value to a byte value (do nothing)

Parameters:
c - char value to cast
Returns:
casted byte value

toByteValue

byte toByteValue(Object o)
                 throws PageException
cast a Object to a byte value (primitive value type)

Parameters:
o - Object to cast
Returns:
casted byte value
Throws:
PageException

toByteValue

byte toByteValue(Object o,
                 byte defaultValue)
cast a Object to a byte value (primitive value type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted byte value

toByte

Byte toByte(boolean b)
cast a boolean value to a Byte Object(reference type)

Parameters:
b - boolean value to cast
Returns:
casted Byte Object

toByte

Byte toByte(char c)
cast a char value to a Byte Object(reference type)

Parameters:
c - char value to cast
Returns:
casted Byte Object

toByte

Byte toByte(double d)
cast a double value to a Byte Object(reference type)

Parameters:
d - double value to cast
Returns:
casted Byte Object

toByte

Byte toByte(Object o)
            throws PageException
cast a Object to a Byte Object(reference type)

Parameters:
o - Object to cast
Returns:
casted Byte Object
Throws:
PageException

toByte

Byte toByte(Object o,
            Byte defaultValue)
cast a Object to a Byte Object(reference type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Byte Object

toLongValue

long toLongValue(boolean b)
cast a boolean value to a long value

Parameters:
b - boolean value to cast
Returns:
casted long value

toLongValue

long toLongValue(double d)
cast a double value to a long value (primitive value type)

Parameters:
d - double value to cast
Returns:
casted long value

toLongValue

long toLongValue(char c)
cast a char value to a long value (do nothing)

Parameters:
c - char value to cast
Returns:
casted long value

toLongValue

long toLongValue(Object o)
                 throws PageException
cast a Object to a long value (primitive value type)

Parameters:
o - Object to cast
Returns:
casted long value
Throws:
PageException

toLongValue

long toLongValue(Object o,
                 long defaultValue)
cast a Object to a long value (primitive value type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted long value

toLong

Long toLong(boolean b)
cast a boolean value to a Long Object(reference type)

Parameters:
b - boolean value to cast
Returns:
casted Long Object

toLong

Long toLong(char c)
cast a char value to a Long Object(reference type)

Parameters:
c - char value to cast
Returns:
casted Long Object

toLong

Long toLong(double d)
cast a double value to a Long Object(reference type)

Parameters:
d - double value to cast
Returns:
casted Long Object

toLong

Long toLong(Object o)
            throws PageException
cast a Object to a Long Object(reference type)

Parameters:
o - Object to cast
Returns:
casted Long Object
Throws:
PageException

toLong

Long toLong(Object o,
            Long defaultValue)
cast a Object to a Long Object(reference type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Long Object

toShortValue

short toShortValue(boolean b)
cast a boolean value to a short value

Parameters:
b - boolean value to cast
Returns:
casted short value

toShortValue

short toShortValue(double d)
cast a double value to a short value (primitive value type)

Parameters:
d - double value to cast
Returns:
casted short value

toShortValue

short toShortValue(char c)
cast a char value to a short value (do nothing)

Parameters:
c - char value to cast
Returns:
casted short value

toShortValue

short toShortValue(Object o)
                   throws PageException
cast a Object to a short value (primitive value type)

Parameters:
o - Object to cast
Returns:
casted short value
Throws:
PageException

toShortValue

short toShortValue(Object o,
                   short defaultValue)
cast a Object to a short value (primitive value type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted short value

toShort

Short toShort(boolean b)
cast a boolean value to a Short Object(reference type)

Parameters:
b - boolean value to cast
Returns:
casted Short Object

toShort

Short toShort(char c)
cast a char value to a Short Object(reference type)

Parameters:
c - char value to cast
Returns:
casted Short Object

toShort

Short toShort(double d)
cast a double value to a Byte Object(reference type)

Parameters:
d - double value to cast
Returns:
casted Byte Object

toShort

Short toShort(Object o)
              throws PageException
cast a Object to a Short Object(reference type)

Parameters:
o - Object to cast
Returns:
casted Short Object
Throws:
PageException

toShort

Short toShort(Object o,
              Short defaultValue)
cast a Object to a Short Object(reference type)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Short Object

toBooleanValue

boolean toBooleanValue(String str)
                       throws PageException
cast a String to a boolean value (primitive value type)

Parameters:
str - String to cast
Returns:
casted boolean value
Throws:
PageException

toBooleanValue

boolean toBooleanValue(String str,
                       boolean defaultValue)
cast a String to a boolean value (primitive value type), return 1 for true, 0 for false and -1 if can't cast to a boolean type

Parameters:
str - String to cast
defaultValue -
Returns:
casted boolean value

toString

String toString(Object o)
                throws PageException
cast a Object to a String

Parameters:
o - Object to cast
Returns:
casted String
Throws:
PageException

toString

String toString(Object o,
                String defaultValue)
cast a Object to a String dont throw a exception, if can't cast to a string return a empty string

Parameters:
o - Object to cast
defaultValue -
Returns:
casted String

toString

String toString(double d)
cast a double value to a String

Parameters:
d - double value to cast
Returns:
casted String

toString

String toString(long l)
cast a long value to a String

Parameters:
l - long value to cast
Returns:
casted String

toString

String toString(int i)
cast a int value to a String

Parameters:
i - int value to cast
Returns:
casted String

toString

String toString(boolean b)
cast a boolean value to a String

Parameters:
b - boolean value to cast
Returns:
casted String

toList

List toList(Object o)
            throws PageException
cast a Object to a Array Object

Parameters:
o - Object to cast
Returns:
casted Array
Throws:
PageException

toList

List toList(Object o,
            List defaultValue)
cast a Object to a Array Object

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Array

toList

List toList(Object o,
            boolean duplicate)
            throws PageException
cast a Object to a Array Object

Parameters:
o - Object to cast
duplicate -
Returns:
casted Array
Throws:
PageException

toList

List toList(Object o,
            boolean duplicate,
            List defaultValue)
cast a Object to a Array Object

Parameters:
o - Object to cast
duplicate -
defaultValue -
Returns:
casted Array

toArray

Array toArray(Object obj)
              throws PageException
cast a Object to a Array Object

Parameters:
obj - Object to cast
Returns:
casted Array
Throws:
PageException

toArray

Array toArray(Object obj,
              Array defaultValue)
cast a Object to a Array Object

Parameters:
obj - Object to cast
defaultValue -
Returns:
casted Array

toMap

Map toMap(Object o)
          throws PageException
cast a Object to a Map Object

Parameters:
o - Object to cast
Returns:
casted Struct
Throws:
PageException

toMap

Map toMap(Object o,
          Map defaultValue)
cast a Object to a Map Object

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Struct

toMap

Map toMap(Object o,
          boolean duplicate)
          throws PageException
cast a Object to a Map Object

Parameters:
o - Object to cast
duplicate -
Returns:
casted Struct
Throws:
PageException

toMap

Map toMap(Object o,
          boolean duplicate,
          Map defaultValue)
cast a Object to a Map Object

Parameters:
o - Object to cast
duplicate -
defaultValue -
Returns:
casted Struct

toStruct

Struct toStruct(Object o)
                throws PageException
cast a Object to a Struct Object

Parameters:
o - Object to cast
Returns:
casted Struct
Throws:
PageException

toStruct

Struct toStruct(Object o,
                Struct defaultValue)
cast a Object to a Struct Object

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Struct

toStruct

Struct toStruct(Object o,
                Struct defaultValue,
                boolean caseSensitive)

toBinary

byte[] toBinary(Object obj)
                throws PageException
cast a Object to a Binary

Parameters:
obj - Object to cast
Returns:
casted Binary
Throws:
PageException

toBinary

byte[] toBinary(Object obj,
                byte[] defaultValue)
cast a Object to a Binary

Parameters:
obj - Object to cast
defaultValue -
Returns:
casted Binary

toBase64

String toBase64(Object o)
                throws PageException
cast a Object to a Base64 value

Parameters:
o - Object to cast
Returns:
to Base64 String
Throws:
PageException

toBase64

String toBase64(Object o,
                String defaultValue)
cast a Object to a Base64 value

Parameters:
o - Object to cast
defaultValue -
Returns:
to Base64 String

toDate

DateTime toDate(boolean b,
                TimeZone tz)
cast a boolean to a DateTime Object

Parameters:
b - boolean to cast
tz -
Returns:
casted DateTime Object

toDate

DateTime toDate(char c,
                TimeZone tz)
cast a char to a DateTime Object

Parameters:
c - char to cast
tz -
Returns:
casted DateTime Object

toDate

DateTime toDate(double d,
                TimeZone tz)
cast a double to a DateTime Object

Parameters:
d - double to cast
tz -
Returns:
casted DateTime Object

toDate

DateTime toDate(Object o,
                TimeZone tz)
                throws PageException
cast a Object to a DateTime Object

Parameters:
o - Object to cast
tz -
Returns:
casted DateTime Object
Throws:
PageException

toDate

DateTime toDate(String str,
                TimeZone tz)
                throws PageException
cast a Object to a DateTime Object

Parameters:
str - String to cast
tz -
Returns:
casted DateTime Object
Throws:
PageException

toDate

DateTime toDate(Object o,
                boolean alsoNumbers,
                TimeZone tz,
                DateTime defaultValue)
cast a Object to a DateTime Object

Parameters:
o - Object to cast
alsoNumbers - define if also numbers will casted to a datetime value
tz -
defaultValue -
Returns:
casted DateTime Object

toDate

DateTime toDate(String str,
                boolean alsoNumbers,
                TimeZone tz,
                DateTime defaultValue)
cast a Object to a DateTime Object

Parameters:
str - String to cast
alsoNumbers - define if also numbers will casted to a datetime value
tz -
defaultValue -
Returns:
casted DateTime Object

toDateTime

DateTime toDateTime(Object o,
                    TimeZone tz)
                    throws PageException
cast a Object to a DateTime Object

Parameters:
o - Object to cast
tz -
Returns:
casted DateTime Object
Throws:
PageException

toDatetime

DateTime toDatetime(Object o,
                    TimeZone tz)
                    throws PageException
cast a Object to a DateTime Object (alias for toDateTime)

Parameters:
o - Object to cast
tz -
Returns:
casted DateTime Object
Throws:
PageException

toDate

DateTime toDate(Locale locale,
                String str,
                TimeZone tz)
                throws PageException
parse a string to a Datetime Object

Parameters:
locale -
str - String representation of a locale Date
tz -
Returns:
DateTime Object
Throws:
PageException

toDate

DateTime toDate(Locale locale,
                String str,
                TimeZone tz,
                DateTime defaultValue)
parse a string to a Datetime Object, returns null if can't convert

Parameters:
locale -
str - String representation of a locale Date
tz -
defaultValue -
Returns:
datetime object

toQuery

Query toQuery(Object o)
              throws PageException
cast a Object to a Query Object

Parameters:
o - Object to cast
Returns:
casted Query Object
Throws:
PageException

toQuery

Query toQuery(Object o,
              Query defaultValue)
cast a Object to a Query Object

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Query Object

toQuery

Query toQuery(Object o,
              boolean duplicate)
              throws PageException
cast a Object to a Query Object

Parameters:
o - Object to cast
duplicate - duplicate the object or not
Returns:
casted Query Object
Throws:
PageException

toQuery

Query toQuery(Object o,
              boolean duplicate,
              Query defaultValue)
cast a Object to a Query Object

Parameters:
o - Object to cast
duplicate - duplicate the object or not
defaultValue -
Returns:
casted Query Object

toUUId

Object toUUId(Object o)
              throws PageException
cast a Object to a UUID

Parameters:
o - Object to cast
Returns:
casted Query Object
Throws:
PageException

toUUId

Object toUUId(Object o,
              Object defaultValue)
cast a Object to a UUID

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Query Object

toVariableName

Object toVariableName(Object o)
                      throws PageException
cast a Object to a Variable Name

Parameters:
o - Object to cast
Returns:
casted Variable Name
Throws:
PageException

toVariableName

Object toVariableName(Object obj,
                      Object defaultValue)
cast a Object to a Variable Name

Parameters:
obj - Object to cast
defaultValue -
Returns:
casted Variable Name

toTimespan

TimeSpan toTimespan(Object o)
                    throws PageException
cast a Object to a TimeSpan Object (alias for toTimeSpan)

Parameters:
o - Object to cast
Returns:
casted TimeSpan Object
Throws:
PageException

toTimespan

TimeSpan toTimespan(Object o,
                    TimeSpan defaultValue)
cast a Object to a TimeSpan Object (alias for toTimeSpan)

Parameters:
o - Object to cast
defaultValue -
Returns:
casted TimeSpan Object

toPageException

PageException toPageException(Throwable t)
cast a Throwable Object to a PageException Object

Parameters:
t - Throwable to cast
Returns:
casted PageException Object

toTypeName

String toTypeName(Object o)
return the type name of a object (string, boolean, int aso.), type is not same like class name

Parameters:
o - Object to get type from
Returns:
type of the object

castTo

Object castTo(PageContext pc,
              String type,
              Object o)
              throws PageException
cast a value to a value defined by type argument

Parameters:
pc -
type - type of the returning Value
o - Object to cast
Returns:
casted Value
Throws:
PageException

castTo

Object castTo(PageContext pc,
              String type,
              Object o,
              boolean alsoPattern)
              throws PageException
cast a value to a value defined by type argument

Parameters:
pc -
type - type of the returning Value
o - Object to cast
alsoPattern - mean supporting also none real types like email or creditcard ...
Returns:
casted Value
Throws:
PageException

castTo

Object castTo(PageContext pc,
              short type,
              String strType,
              Object o)
              throws PageException
cast a value to a value defined by type argument

Parameters:
pc -
type - type of the returning Value (Example: Cast.TYPE_QUERY)
strType - type as String
o - Object to cast
Returns:
casted Value
Throws:
PageException

castTo

Object castTo(PageContext pc,
              short type,
              Object o)
              throws PageException
cast a value to a value defined by type argument

Parameters:
pc -
type - type of the returning Value (Example: Cast.TYPE_QUERY)
o - Object to cast
Returns:
casted Value
Throws:
PageException

toVoid

Object toVoid(Object o)
              throws PageException
cast a value to void (Empty String)

Parameters:
o -
Returns:
void value
Throws:
PageException

toVoid

Object toVoid(Object o,
              Object defaultValue)
cast a value to void (Empty String)

Parameters:
o -
defaultValue -
Returns:
void value

toRef

Object toRef(Object o)
cast a Object to a reference type (Object), in that case this method to nothing, because a Object is already a reference type

Parameters:
o - Object to cast
Returns:
casted Object

toRef

String toRef(String o)
cast a String to a reference type (Object), in that case this method to nothing, because a String is already a reference type

Parameters:
o - Object to cast
Returns:
casted Object

toRef

Collection toRef(Collection o)
cast a Collection to a reference type (Object), in that case this method to nothing, because a Collection is already a reference type

Parameters:
o - Collection to cast
Returns:
casted Object

toRef

String toRef(char c)
cast a char value to his (CFML) reference type String

Parameters:
c - char to cast
Returns:
casted String

toRef

Boolean toRef(boolean b)
cast a boolean value to his (CFML) reference type Boolean

Parameters:
b - boolean to cast
Returns:
casted Boolean

toRef

Byte toRef(byte b)
cast a byte value to his (CFML) reference type Boolean

Parameters:
b - byte to cast
Returns:
casted Boolean

toRef

Short toRef(short s)
cast a short value to his (CFML) reference type Integer

Parameters:
s - short to cast
Returns:
casted Integer

toRef

Integer toRef(int i)
cast a int value to his (CFML) reference type Integer

Parameters:
i - int to cast
Returns:
casted Integer

toRef

Float toRef(float f)
cast a float value to his (CFML) reference type Float

Parameters:
f - float to cast
Returns:
casted Float

toRef

Long toRef(long l)
cast a long value to his (CFML) reference type Long

Parameters:
l - long to cast
Returns:
casted Long

toRef

Double toRef(double d)
cast a double value to his (CFML) reference type Double

Parameters:
d - doble to cast
Returns:
casted Double

toIterator

Iterator toIterator(Object o)
                    throws PageException
cast a Object to a Iterator or get Iterator from Object

Parameters:
o - Object to cast
Returns:
casted Collection
Throws:
PageException

toCollection

Collection toCollection(Object o)
                        throws PageException
cast a Object to a Collection

Parameters:
o - Object to cast
Returns:
casted Collection
Throws:
PageException

toColor

Color toColor(Object o)
              throws PageException
cast to a color object

Parameters:
o - Object to cast
Throws:
PageException

toCollection

Collection toCollection(Object o,
                        Collection defaultValue)
cast a Object to a Collection, if not returns null

Parameters:
o - Object to cast
defaultValue -
Returns:
casted Collection

toResource

Resource toResource(Object obj)
                    throws PageException
convert a object to a Resource

Parameters:
obj -
Returns:
File
Throws:
PageException

toResource

Resource toResource(Object obj,
                    Resource defaultValue)
convert a object to a Resource

Parameters:
obj -
defaultValue -
Returns:
Resource

toFile

File toFile(Object obj)
            throws PageException
convert a object to a File

Parameters:
obj -
Returns:
File
Throws:
PageException

toFile

File toFile(Object obj,
            File defaultValue)
convert a object to a File

Parameters:
obj -
defaultValue -
Returns:
File

toLocale

Locale toLocale(String strLocale)
                throws PageException
casts a string to a Locale

Parameters:
strLocale -
Returns:
Locale ferom String
Throws:
PageException

toLocale

Locale toLocale(String strLocale,
                Locale defaultValue)
casts a string to a Locale

Parameters:
strLocale -
defaultValue -
Returns:
Locale from String

toNodeList

NodeList toNodeList(Object o)
                    throws PageException
casts a Object to a Node List

Parameters:
o - Object to Cast
Returns:
NodeList from Object
Throws:
PageException

toNodeList

NodeList toNodeList(Object o,
                    NodeList defaultValue)
casts a Object to a Node List

Parameters:
o - Object to Cast
defaultValue -
Returns:
NodeList from Object

toNode

Node toNode(Object o)
            throws PageException
casts a Object to a XML Node

Parameters:
o - Object to Cast
Returns:
Node from Object
Throws:
PageException

toNode

Node toNode(Object o,
            Node defaultValue)
casts a Object to a XML Node

Parameters:
o - Object to Cast
defaultValue -
Returns:
Node from Object

toInteger

Integer toInteger(boolean b)
casts a boolean to a Integer

Parameters:
b -
Returns:
Integer from boolean

toInteger

Integer toInteger(char c)
casts a char to a Integer

Parameters:
c -
Returns:
Integer from char

toInteger

Integer toInteger(double d)
casts a double to a Integer

Parameters:
d -
Returns:
Integer from double

toInteger

Integer toInteger(Object o)
                  throws PageException
casts a Object to a Integer

Parameters:
o - Object to cast to Integer
Returns:
Integer from Object
Throws:
PageException

toInteger

Integer toInteger(Object o,
                  Integer defaultValue)
casts a Object to a Integer

Parameters:
o - Object to cast to Integer
defaultValue -
Returns:
Integer from Object

toNull

Object toNull(Object value)
              throws PageException
casts a Object to null

Parameters:
value -
Returns:
to null from Object
Throws:
PageException

toNull

Object toNull(Object value,
              Object defaultValue)
casts a Object to null

Parameters:
value -
defaultValue -
Returns:
to null from Object

toXML

Node toXML(Object value)
           throws PageException
cast Object to a XML Node

Parameters:
value -
Returns:
XML Node
Throws:
PageException

toXML

Node toXML(Object value,
           Node defaultValue)
cast Object to a XML Node

Parameters:
value -
defaultValue -
Returns:
XML Node

to

Object to(String type,
          Object o,
          boolean alsoPattern)
          throws PageException
cast to given type

Parameters:
type -
o -
alsoPattern -
Throws:
PageException

toSerializable

Serializable toSerializable(Object obj)
                            throws PageException
cast Object to a Serializable Object

Parameters:
obj -
Throws:
PageException

toSerializable

Serializable toSerializable(Object object,
                            Serializable defaultValue)
cast Object to a Serializable Object

Parameters:
object -
defaultValue -
Returns:


Copyright © 2012 Railo