public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static String |
asString(Object object)
Return a string identification for the specified object.
|
static boolean |
compare(String me,
String you)
Compare two strings.
|
static Object |
deserialize(byte[] data)
Deserialize the byte array into an object.
|
static TransactionManager |
locateTM(String locatorClass,
String locatorMethod)
The Resource adapter can't depend on any provider's specific library.
|
static <T> T |
lookup(Context context,
String name,
Class<T> clazz)
Lookup an object in the default initial context
|
static String |
maskUrlForLog(String url) |
static byte[] |
serialize(Serializable serializable)
Serialize the object into a byte array.
|
public static boolean compare(String me, String you)
me
- First valueyou
- Second valuepublic static <T> T lookup(Context context, String name, Class<T> clazz) throws Exception
context
- The context to usename
- the name to lookupclazz
- the expected typeException
- for any errorpublic static TransactionManager locateTM(String locatorClass, String locatorMethod)
public static byte[] serialize(Serializable serializable) throws IOException
serializable
- The serializable objectIOException
- For errors during serialization.public static Object deserialize(byte[] data) throws IOException, ClassNotFoundException
data
- The serialized object as a byte arrayIOException
- For errors during deserializationClassNotFoundException
- If the deserialized class cannot be found.public static String asString(Object object)
object
- The object value.Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.