@Test public void testEqualsCode() { JmsTransactionInfo first = new JmsTransactionInfo(firstSessionId, firstTxId); JmsTransactionInfo second = new JmsTransactionInfo(secondSessionId, secondTxId); assertEquals(first, first); assertEquals(second, second); assertFalse(first.equals(second)); assertFalse(second.equals(first)); assertFalse(first.equals(null)); assertFalse(second.equals("test")); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } JmsTransactionInfo other = (JmsTransactionInfo) obj; return transactionId.equals(other.transactionId); }
JmsTransactionInfo extends JmsAbstractResource implements Comparable<JmsTransactionInfo> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } JmsTransactionInfo other = (JmsTransactionInfo) obj; return transactionId.equals(other.transactionId); } }
JmsTransactionInfo extends JmsAbstractResource implements Comparable<JmsTransactionInfo> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } JmsTransactionInfo other = (JmsTransactionInfo) obj; return transactionId.equals(other.transactionId); } JmsTransactionInfo(JmsSessionId sessionId, JmsTransactionId transactionId); }
JmsTransactionInfo extends JmsAbstractResource implements Comparable<JmsTransactionInfo> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } JmsTransactionInfo other = (JmsTransactionInfo) obj; return transactionId.equals(other.transactionId); } JmsTransactionInfo(JmsSessionId sessionId, JmsTransactionId transactionId); JmsTransactionInfo copy(); @Override JmsTransactionId getId(); JmsSessionId getSessionId(); boolean isInDoubt(); void setInDoubt(boolean inDoubt); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(JmsTransactionInfo other); @Override String toString(); @Override void visit(JmsResourceVistor visitor); }
JmsTransactionInfo extends JmsAbstractResource implements Comparable<JmsTransactionInfo> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } JmsTransactionInfo other = (JmsTransactionInfo) obj; return transactionId.equals(other.transactionId); } JmsTransactionInfo(JmsSessionId sessionId, JmsTransactionId transactionId); JmsTransactionInfo copy(); @Override JmsTransactionId getId(); JmsSessionId getSessionId(); boolean isInDoubt(); void setInDoubt(boolean inDoubt); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(JmsTransactionInfo other); @Override String toString(); @Override void visit(JmsResourceVistor visitor);  }