@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } if (!(obj instanceof TicketAuthenticationToken)) { return false; } TicketAuthenticationToken test = (TicketAuthenticationToken) obj; return ticket.equals(test.getPrincipal()); }
/* (non-Javadoc) * @see org.osaf.cosmo.model.copy.InterfaceTicket#isGranted(org.osaf.cosmo.model.copy.Item) */ public boolean isGranted(Item item) { if (item == null) return false; for (Ticket ticket : item.getTickets()) { if (ticket.equals(this)) return true; } for (Item parent : item.getParents()) { if (isGranted(parent)) return true; } return false; }