Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

[OmniFaces utilities 2.4] Check if the given object is serializable


[OmniFaces utilities] The isSerializable() method returns true if the given object is serializable.

Method:
Usage:

Example 1 - test Object:

import org.omnifaces.util.Utils;
...
Utils.isSerializable(new Object()); // return false

Example 2 - test two classes

// Serializable class
public class ShopingCart implements Serializable {
 ...    
}

// NOT Serializable class
 ...    
}

Utils.isSerializable(new ShopingCart()); // return true
Utils.isSerializable(new Item()); // return false

API GH


This post first appeared on OmniFaces & JSF Fans, please read the originial post: here

Share the post

[OmniFaces utilities 2.4] Check if the given object is serializable

×

Subscribe to Omnifaces & Jsf Fans

Get updates delivered right to your inbox!

Thank you for your subscription

×