/** * Compares an {@link ObjectRange} to another {@link ObjectRange}. * * @param that the object to check equality with * @return <code>true</code> if the ranges are equal */ public boolean equals(ObjectRange that) { return that != null && reverse == that.reverse && DefaultTypeTransformation.compareEqual(from, that.from) && DefaultTypeTransformation.compareEqual(to, that.to); }
public static boolean equals(Object obj, Object other) { return DefaultTypeTransformation.compareEqual(obj, other); }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(char[] self, Object value) { for (char next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(int[] self, Object value) { for (int next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(short[] self, Object value) { for (short next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(float[] self, Object value) { for (float next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(byte[] self, Object value) { for (byte next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
public boolean equals(MapEntry that) { return DefaultTypeTransformation.compareEqual(this.key, that.key) && DefaultTypeTransformation.compareEqual(this.value, that.value); }
/** * Checks whether the array contains the given value. * * @param self the array within which we count the number of occurrences * @param value the value being searched for * @return the number of occurrences * @since 1.8.6 */ public static boolean contains(boolean[] self, Object value) { for (boolean next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(Object[] self, Object value) { for (Object next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(long[] self, Object value) { for (long next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
/** * Checks whether the array contains the given value. * * @param self the array we are searching * @param value the value being searched for * @return true if the array contains the value * @since 1.8.6 */ public static boolean contains(double[] self, Object value) { for (double next : self) { if (DefaultTypeTransformation.compareEqual(value, next)) return true; } return false; }
public static void assertEquals(String message, Object expected, Object actual) { if (expected == null && actual == null) return; if (expected != null && DefaultTypeTransformation.compareEqual(expected, actual)) return; TestCase.assertEquals(message, expected, actual); }
public void run() { Object sourceValue = getSourceValue(); // if (isNonChangeCheck()) { if ((sourceValue == null && newValue == null) || DefaultTypeTransformation.compareEqual(sourceValue, newValue)) { // not a change, don't fire it return; } // } setBeanProperty(newValue); } };
private static boolean coercedEquals(Object o1, Object o2) { if (o1 instanceof Comparable) { if (!(o2 instanceof Comparable && numberAwareCompareTo((Comparable) o1, (Comparable) o2) == 0)) { return false; } } return DefaultTypeTransformation.compareEqual(o1, o2); }
public boolean equals(SpreadMap that) { if (that == null) return false; if (size() == that.size()) { for (Object e : entrySet()) { Map.Entry entry = (Map.Entry) e; Object key = entry.getKey(); if (!DefaultTypeTransformation.compareEqual(entry.getValue(), that.get(key))) { return false; } } return true; } return false; }
public void testCompareTo() { assertTrue(DefaultTypeTransformation.compareEqual("x", new Integer('x'))); }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Tuple)) return false; Tuple that = (Tuple) o; int size = size(); if (size != that.size()) return false; for (int i = 0; i < size; i++) { if (!DefaultTypeTransformation.compareEqual(get(i), that.get(i))) { return false; } } return true; }
public void testInject() { Collection<Integer> c = Arrays.asList(2, 4, 5, 20); Number initial = BigDecimal.ZERO; Closure<? extends Number> closure = new Closure<BigDecimal>(c) { BigDecimal doCall(BigDecimal total, Integer next) { return total.add(BigDecimal.ONE.divide(new BigDecimal(next))); } }; assertTrue(DefaultTypeTransformation.compareEqual(BigDecimal.ONE, inject(c, initial, closure))); } }
public boolean equals(Sequence that) { if (size() == that.size()) { for (int i = 0; i < size(); i++) { if (!DefaultTypeTransformation.compareEqual(this.get(i), that.get(i))) { return false; } } return true; } return false; }