@Override public int compare(T p, T q) { return ObjectContracts.compare(p, q, propertyNames); } };
@Override public String toString() { return ObjectContracts.toString(this, "source"); } //endregion
@Override public boolean equals(Object obj) { return ObjectContracts.equals(this, obj, KEY_FIELDS); }
/** * Returns a string representation of the object consisting of 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 String toString(Object p, String... propertyNames) { return new ObjectContracts().toStringOf(p, propertyNames); } //endregion
/** * 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); }
/** * 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! * @param propertyNames - the property name or names, CSV format. If multiple properties, use the {@link #compare(Object, Object, String...) varargs} overloaded version of this method. */ @Deprecated @SuppressWarnings("unchecked") public static <T> int compare(final T p, final T q, final String propertyNames) { final Iterable<String> propertyNamesIter = csvToIterable(propertyNames); return compare(p, q, propertyNamesIter); }
@Override public int hashCode() { return ObjectContracts.hashCode(this, KEY_FIELDS); }
@Override public String toString() { return new ObjectContracts().with(new NumberedEvaluator()).toStringOf(this, KEY_PROPERTIES); } @Override
/** * 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! * @param propertyNames - the property name or names, CSV format. If multiple properties, use the {@link #hashCode(Object, String...)} varargs} overloaded version of this method. */ @Deprecated public static int hashCode(Object obj, String propertyNames) { final Iterable<String> propertyNamesIter = csvToIterable(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! * @param propertyNames - the property name or names, CSV format. If multiple properties, use the {@link #equals(Object, Object, String...)} varargs} overloaded version of this method. */ @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 = csvToIterable(propertyNames); return equals(p, q, 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); }
/** * 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! * @param propertyNames - the property name or names, CSV format. If multiple properties, use the {@link #toString(Object, String...)} varargs} overloaded version of this method. */ @Deprecated public String toStringOf(Object p, String propertyNames) { final Iterable<String> propertyNamesIter = csvToIterable(propertyNames); return toStringOf(p, propertyNamesIter); }
/** * 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); }
/** * Returns a string representation of the object consisting of 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! * @param propertyNames - the property name or names, CSV format. If multiple properties, use the {@link #toString(Object, String...)} varargs} overloaded version of this method. */ @Deprecated public static String toString(Object p, String propertyNames) { return new ObjectContracts().toStringOf(p, propertyNames); } /**
@Override public int hashCode() { return ObjectContracts.hashCode(this, KEY_PROPERTIES); } @Override
@Override public int compare(T p, T q) { return ObjectContracts.compare(p, q, propertyNames); } };
@Override public String toString() { return ObjectContracts.toString(this, "source,identifier,phase,oldValue,newValue"); } //endregion
@Override public boolean equals(Object obj) { return ObjectContracts.equals(this, obj, KEY_PROPERTIES); } }
/** * Returns a string representation of the object consisting of 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! * @param propertyNames - the property name or names, CSV format. If multiple properties, use the {@link #toString(Object, String...)} varargs} overloaded version of this method. */ @Deprecated public static String toString(Object p, String propertyNames) { return new ObjectContracts().toStringOf(p, propertyNames); } /**