com.latencybusters.jms.message
Class Conversions

java.lang.Object
  extended by com.latencybusters.jms.message.Conversions

public final class Conversions
extends java.lang.Object

A helper class returning the conversion types supported by MapMessage and StreamMessage


Field Summary
static java.lang.Class[] TYPES
          All types supported by MapMessage and StreamMessage
 
Method Summary
static java.lang.Object convert(java.lang.Object value, java.lang.Class type)
          Converts an object from one type to another
static java.lang.Object convertBoolean(java.lang.Boolean value, java.lang.Class type)
          Convert a boolean to the specified type
static java.lang.Object convertByte(java.lang.Byte value, java.lang.Class type)
          Convert a byte to the specified type
static java.lang.Object convertChar(java.lang.Character value, java.lang.Class type)
          Convert a char to the specified type
static java.lang.Object convertDouble(java.lang.Double value, java.lang.Class type)
          Convert a double to the specified type
static java.lang.Object convertFloat(java.lang.Float value, java.lang.Class type)
          Convert a float to the specified type
static java.lang.Object convertInt(java.lang.Integer value, java.lang.Class type)
          Convert an int to the specified type
static java.lang.Object convertLong(java.lang.Long value, java.lang.Class type)
          Convert a long to the specified type
static java.lang.Object convertShort(java.lang.Short value, java.lang.Class type)
          Convert a short to the specified type
static java.lang.Object convertString(java.lang.String value, java.lang.Class type)
          Convert a String to the specified type
static java.lang.Class[] getInvalidConversions(java.lang.Class type)
          Returns the list of invalid conversions for a particular type
static java.lang.Class[] getValidConversions(java.lang.Class type)
          Returns the list of valid conversions for a particular type
static boolean isValidConversion(java.lang.Object value, java.lang.Class type)
          Returns true if it is valid to convert a value to a particular type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPES

public static final java.lang.Class[] TYPES
All types supported by MapMessage and StreamMessage

Method Detail

getValidConversions

public static java.lang.Class[] getValidConversions(java.lang.Class type)
Returns the list of valid conversions for a particular type

Parameters:
type - the type to convert from. For primitives, this must be the corresponding objectified type
Returns:
the list of valid conversions for type

getInvalidConversions

public static java.lang.Class[] getInvalidConversions(java.lang.Class type)
Returns the list of invalid conversions for a particular type

Parameters:
type - the type to convert from. For primitives, this must be the corresponding objectified type
Returns:
the list of invalid conversions for type

isValidConversion

public static boolean isValidConversion(java.lang.Object value,
                                        java.lang.Class type)
Returns true if it is valid to convert a value to a particular type

Parameters:
value - the value to convert from.
type - the type to convert to. For primitives, this must be the corresponding objectified type
Returns:
true if it is valid to perform a conversion

convert

public static java.lang.Object convert(java.lang.Object value,
                                       java.lang.Class type)
Converts an object from one type to another

Parameters:
value - the value to convert from.
type - the type to convert to. For primitives, this must be the corresponding objectified type
Returns:
the converted object

convertBoolean

public static java.lang.Object convertBoolean(java.lang.Boolean value,
                                              java.lang.Class type)
Convert a boolean to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertByte

public static java.lang.Object convertByte(java.lang.Byte value,
                                           java.lang.Class type)
Convert a byte to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertShort

public static java.lang.Object convertShort(java.lang.Short value,
                                            java.lang.Class type)
Convert a short to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertChar

public static java.lang.Object convertChar(java.lang.Character value,
                                           java.lang.Class type)
Convert a char to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertInt

public static java.lang.Object convertInt(java.lang.Integer value,
                                          java.lang.Class type)
Convert an int to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertLong

public static java.lang.Object convertLong(java.lang.Long value,
                                           java.lang.Class type)
Convert a long to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertFloat

public static java.lang.Object convertFloat(java.lang.Float value,
                                            java.lang.Class type)
Convert a float to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertDouble

public static java.lang.Object convertDouble(java.lang.Double value,
                                             java.lang.Class type)
Convert a double to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value

convertString

public static java.lang.Object convertString(java.lang.String value,
                                             java.lang.Class type)
Convert a String to the specified type

Parameters:
value - the value to convert
type - the type to convert to
Returns:
the converted value


All of the documentation and software included in this and any other Informatica, Inc. "Ultra Messaging" Release is Copyright (C) 2004-2014, Informatica Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted only as covered by the terms of a valid software license agreement with Informatica Inc. Copyright © 2004-2014, Informatica, Inc. All Rights Reserved.