Back to project page NexusData.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCT...
If you think the Android project NexusData listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.dkharrat.nexusdata.utils; // ww w. ja v a2s . c o m public class ObjectUtil { public static boolean objectsEqual(Object a, Object b) { return a == b || (a != null && a.equals(b)); } public static Comparable<?> toComparable(Object object) { if (object == null) { return null; } else if (object instanceof Comparable) { return (Comparable<?>) object; } else if (object instanceof StringBuffer) { return object.toString(); } else if (object instanceof char[]) { return new String((char[]) object); } else { throw new ClassCastException("Could not get a valid Comparable instance for class:" + object.getClass().getName()); } } }