@Test public void testMatching() throws Exception { assertTrue(ACL1.equals(ACL1)); final AclBinding acl1Copy = new AclBinding( new Resource(ResourceType.TOPIC, "mytopic"), new AccessControlEntry("User:ANONYMOUS", "", AclOperation.ALL, AclPermissionType.ALLOW)); assertTrue(ACL1.equals(acl1Copy)); assertTrue(acl1Copy.equals(ACL1)); assertTrue(ACL2.equals(ACL2)); assertFalse(ACL1.equals(ACL2)); assertFalse(ACL2.equals(ACL1)); assertTrue(AclBindingFilter.ANY.matches(ACL1)); assertFalse(AclBindingFilter.ANY.equals(ACL1)); assertTrue(AclBindingFilter.ANY.matches(ACL2)); assertFalse(AclBindingFilter.ANY.equals(ACL2)); assertTrue(AclBindingFilter.ANY.matches(ACL3)); assertFalse(AclBindingFilter.ANY.equals(ACL3)); assertTrue(AclBindingFilter.ANY.equals(AclBindingFilter.ANY)); assertTrue(ANY_ANONYMOUS.matches(ACL1)); assertFalse(ANY_ANONYMOUS.equals(ACL1)); assertFalse(ANY_ANONYMOUS.matches(ACL2)); assertFalse(ANY_ANONYMOUS.equals(ACL2)); assertTrue(ANY_ANONYMOUS.matches(ACL3)); assertFalse(ANY_ANONYMOUS.equals(ACL3)); assertFalse(ANY_DENY.matches(ACL1)); assertFalse(ANY_DENY.matches(ACL2)); assertTrue(ANY_DENY.matches(ACL3)); assertTrue(ANY_MYTOPIC.matches(ACL1)); assertTrue(ANY_MYTOPIC.matches(ACL2)); assertFalse(ANY_MYTOPIC.matches(ACL3)); assertTrue(ANY_ANONYMOUS.matches(UNKNOWN_ACL)); assertTrue(ANY_DENY.matches(UNKNOWN_ACL)); assertTrue(UNKNOWN_ACL.equals(UNKNOWN_ACL)); assertFalse(ANY_MYTOPIC.matches(UNKNOWN_ACL)); }
@Override public boolean equals(Object o) { if (!(o instanceof AclBinding)) return false; AclBinding other = (AclBinding) o; return resource.equals(other.resource) && entry.equals(other.entry); }
AclBinding { @Override public boolean equals(Object o) { if (!(o instanceof AclBinding)) return false; AclBinding other = (AclBinding) o; return resource.equals(other.resource) && entry.equals(other.entry); } }
AclBinding { @Override public boolean equals(Object o) { if (!(o instanceof AclBinding)) return false; AclBinding other = (AclBinding) o; return resource.equals(other.resource) && entry.equals(other.entry); } AclBinding(Resource resource, AccessControlEntry entry); }
AclBinding { @Override public boolean equals(Object o) { if (!(o instanceof AclBinding)) return false; AclBinding other = (AclBinding) o; return resource.equals(other.resource) && entry.equals(other.entry); } AclBinding(Resource resource, AccessControlEntry entry); boolean isUnknown(); Resource resource(); final AccessControlEntry entry(); AclBindingFilter toFilter(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
AclBinding { @Override public boolean equals(Object o) { if (!(o instanceof AclBinding)) return false; AclBinding other = (AclBinding) o; return resource.equals(other.resource) && entry.equals(other.entry); } AclBinding(Resource resource, AccessControlEntry entry); boolean isUnknown(); Resource resource(); final AccessControlEntry entry(); AclBindingFilter toFilter(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }