@Override public Boolean apply(A x) { return EqualsUtil.eq(x, a); } };
@Override public int hashCode() { return EqualsUtil.hash(name, organization); }
/** Set the cell's value. */ public void set(A a) { synchronized (lock) { if (ne(a, this.a)) { this.a = a; change += 1; } } }
/** * Define equality on AccessControlLists. Two AccessControlLists are considered equal if they contain the exact same * entries no matter in which order. * <p> * This has not been implemented in terms of #equals and #hashCode because the list of entries is not immutable and * therefore not suitable to be put in a set. */ public static boolean equals(AccessControlList a, AccessControlList b) { return bothNotNull(a, b) && eqListUnsorted(a.getEntries(), b.getEntries()); }
@Override public boolean equals(Object that) { if (this == that) return true; if (!eqClasses(this, that)) return false; Tuple thatc = (Tuple) that; return a.equals(thatc.a) && b.equals(thatc.b); }
/** Check if <code>a</code> and <code>b</code> have the same class ({@link Object#getClass()}). Each may be null. */ public static boolean eqClasses(Object a, Object b) { return bothNotNull(a, b) && a.getClass().equals(b.getClass()); }
@Override public Boolean apply(A x) { return EqualsUtil.ne(x, a); } };
@Override public boolean equals(Object that) { if (this == that) return true; if (!eqClasses(this, that)) return false; Tuple3 thatc = (Tuple3) that; return a.equals(thatc.a) && b.equals(thatc.b) && c.equals(thatc.c); }
@Override public int hashCode() { return hash(a, b); }
public SecurityContext(SecurityService sec, Organization org, User user) { if (ne(org, user.getOrganization())) { throw new IllegalArgumentException("User is not a member of organization " + org.getId()); } this.sec = sec; this.user = user; this.org = org; }
/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return EqualsUtil.hash(username, organization); }
/** Check if <code>a</code> and <code>b</code> are not equal. Each of them may be null. */ public static boolean ne(Object a, Object b) { return !eq(a, b); }
/** * Compare two maps. * * @deprecated use {@link #eqObj(Object, Object)} or {@link java.util.Map#equals(Object)} */ public static boolean eqMap(Map<?, ?> as, Map<?, ?> bs) { for (Map.Entry<?, ?> ae : as.entrySet()) { final Object bv = bs.get(ae.getKey()); if (bv == null || !eqObj(ae.getValue(), bv)) return false; } return true; }
@Override public Response apply(List<BundleInfo> infos) { final String bundleVersion = infos.get(0).getBundleVersion(); final Option<String> buildNumber = infos.get(0).getBuildNumber(); for (BundleInfo a : infos) { if (ne(a.getBundleVersion(), bundleVersion) || ne(a.getBuildNumber(), buildNumber)) return ok(TEXT_PLAIN_TYPE, "false"); } return ok(TEXT_PLAIN_TYPE, "true"); } });
/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return EqualsUtil.hash(name, organization); }