/** * Determine two values of any type equal * @param first is actual value * @param second is value in query condition * @return true if equal, otherwise false */ protected static boolean equals(final Object first, final Object second) { if (first == null) { return second == null; } else if (first instanceof Id) { if (second instanceof String) { return second.equals(((Id) first).asString()); } else if (second instanceof Long) { return second.equals(((Id) first).asLong()); } } else if (first instanceof Number || second instanceof Number) { return compare(first, second) == 0; } return first.equals(second); }
/** * Determine two values of any type equal * @param first is actual value * @param second is value in query condition * @return true if equal, otherwise false */ protected static boolean equals(final Object first, final Object second) { if (first == null) { return second == null; } else if (first instanceof Id) { if (second instanceof String) { return second.equals(((Id) first).asString()); } else if (second instanceof Long) { return second.equals(((Id) first).asLong()); } } else if (first instanceof Number || second instanceof Number) { return compare(first, second) == 0; } return first.equals(second); }