[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
public class Item {
...
}
Utils.isSerializable(new ShopingCart()); // return true
Utils.isSerializable(new
Item()); // return false
Niciun comentariu :
Trimiteți un comentariu