本文整理汇总了Java中org.kuali.rice.core.api.util.io.SerializationUtils.deserializeFromBase64方法的典型用法代码示例。如果您正苦于以下问题:Java SerializationUtils.deserializeFromBase64方法的具体用法?Java SerializationUtils.deserializeFromBase64怎么用?Java SerializationUtils.deserializeFromBase64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.util.io.SerializationUtils
的用法示例。
在下文中一共展示了SerializationUtils.deserializeFromBase64方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unwrapPayload
import org.kuali.rice.core.api.util.io.SerializationUtils; //导入方法依赖的package包/类
/**
* Extracts the payload from a PersistedMessageBO, attempts to convert it to the expected AsynchronousCall type, and
* returns it.
*
* Throws an IllegalArgumentException if the decoded payload isnt of the expected type.
*
* @param message
* The populated PersistedMessageBO object to extract the payload from.
* @return Returns the payload if one is present and it can be deserialized, otherwise returns null.
*/
protected AsynchronousCall unwrapPayload(PersistedMessageBO message) {
if (message == null || message.getPayload() == null) {
return null;
}
String encodedPayload = message.getPayload().getPayload();
if (StringUtils.isBlank(encodedPayload)) {
return null;
}
Object decodedPayload = null;
if (encodedPayload != null) {
decodedPayload = SerializationUtils.deserializeFromBase64(encodedPayload);
}
// fail fast if its not the expected type of AsynchronousCall
if ((decodedPayload != null) && !(decodedPayload instanceof AsynchronousCall)) {
throw new IllegalArgumentException("PersistedMessageBO payload was not of the expected class. " + "Expected was ["
+ AsynchronousCall.class.getName() + "], actual was: [" + decodedPayload.getClass().getName() + "]");
}
return (AsynchronousCall) decodedPayload;
}
示例2: getMethodCall
import org.kuali.rice.core.api.util.io.SerializationUtils; //导入方法依赖的package包/类
public AsynchronousCall getMethodCall() {
if (this.methodCall != null) {
return this.methodCall;
}
this.methodCall = (AsynchronousCall) SerializationUtils.deserializeFromBase64(getPayload());
return this.methodCall;
}
示例3: testQNameSerializaion
import org.kuali.rice.core.api.util.io.SerializationUtils; //导入方法依赖的package包/类
@Test public void testQNameSerializaion() throws Exception {
QName qname = new QName("hi", "HI");
String qnameSerialized = SerializationUtils.serializeToBase64(qname);
SerializationUtils.deserializeFromBase64(qnameSerialized);
assertTrue(true);
}