/** * Returns a string representation of two objects, considering just the specified property name(s). * @deprecated - please be aware that this utility heavily uses reflection. We don't actually intend to deprecate this method (it's useful while prototyping), but we wanted to bring this to your attention! */ @Deprecated public String toStringOf(Object p, String... propertyNames) { final Iterable<String> propertyNamesIter = varargsToIterable(propertyNames); return toStringOf(p, propertyNamesIter); }
/** * Evaluates which of p and q is first. * * @deprecated - please be aware that this utility heavily uses reflection. We don't actually intend to deprecate this method (it's useful while prototyping), but we wanted to bring this to your attention! */ @Deprecated @SuppressWarnings("unchecked") public static <T> int compare(final T p, final T q, final String... propertyNames) { final Iterable<String> propertyNamesIter = varargsToIterable(propertyNames); return compare(p, q, propertyNamesIter); }
/** * Returns the hashCode for the object using the specified property name(s). * @deprecated - please be aware that this utility heavily uses reflection. We don't actually intend to deprecate this method (it's useful while prototyping), but we wanted to bring this to your attention! */ @Deprecated public static int hashCode(Object obj, String... propertyNames) { final Iterable<String> propertyNamesIter = varargsToIterable(propertyNames); return hashCode(obj, propertyNamesIter); }
/** * Returns whether two objects are equal, considering just the specified property name(s). * @deprecated - please be aware that this utility heavily uses reflection. We don't actually intend to deprecate this method (it's useful while prototyping), but we wanted to bring this to your attention! */ @Deprecated public static boolean equals(Object p, Object q, String... propertyNames) { if(p==null && q==null) { return true; } if(p==null || q==null) { return false; } if(p.getClass() != q.getClass()) { return false; } final Iterable<String> propertyNamesIter = varargsToIterable(propertyNames); return equals(p, q, propertyNamesIter); }