Package org.apache.juneau.swaps
Class BeanStringSwap<T>
java.lang.Object
org.apache.juneau.swap.ObjectSwap<T,String>
 
org.apache.juneau.swap.StringSwap<T>
org.apache.juneau.swaps.BeanStringSwap<T>
- Type Parameters:
- T- The class type of the bean.
Transforms beans into 
Strings by simply calling the Object.toString() method.
 
 Allows you to specify classes that should just be converted to Strings instead of potentially
 being turned into Maps by the BeanContext (or worse, throwing
 BeanRuntimeExceptions).
 
This is usually a one-way transform. Beans serialized as strings cannot be reconstituted using a parser unless it is a POJO Categories.
See Also:
- 
Field SummaryFields inherited from class org.apache.juneau.swap.ObjectSwapNULL
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionswap(BeanSession session, T o) Converts the specified bean to aString.Methods inherited from class org.apache.juneau.swap.StringSwapunswapMethods inherited from class org.apache.juneau.swap.ObjectSwapforMediaTypes, forMediaTypes, getNormalClass, getSwapClass, getSwapClassMeta, isNormalObject, isSwappedObject, match, swap, toString, unswap, withTemplate, withTemplate
- 
Constructor Details- 
BeanStringSwappublic BeanStringSwap()
 
- 
- 
Method Details- 
swapConverts the specified bean to aString.- Overrides:
- swapin class- StringSwap<T>
- Parameters:
- session- The bean session to use to get the class meta. This is always going to be the same bean context that created this swap.
- o- The object to be transformed.
- Returns:
- The transformed object.
 
 
-