@Test public void testEquals() { String message; String param = "param"; String key = "foo"; sut = new ActionRequestImpl<String>(key, param); ActionRequestImpl<String> other = new ActionRequestImpl<String>(); message = "other classes shouldn't match"; assertFalse(message, sut.equals(null)); assertFalse(message, sut.equals("another class")); message = "should not match with unequal key or parameters"; assertFalse(message, sut.equals(other)); other.setActionKey(key); assertFalse(message, sut.equals(other)); message = "should match with equal key and parameters"; other.setActionKey(key); other.setParam(param); assertTrue(message, sut.equals(other)); }
@SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } ActionRequestImpl();  ActionRequestImpl(final String inActionKey, final Serializable inParam); }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } ActionRequestImpl();  ActionRequestImpl(final String inActionKey, final Serializable inParam); int getId(); void setId(final int inId); String getActionKey(); void setActionKey(final String inActionKey); Serializable getParam(); void setParam(final Serializable inParam); T getResponse(); void setResponse(final T inResponse); @SuppressWarnings("rawtypes") @Override boolean equals(final Object other); @Override int hashCode(); String getSessionId(); void setSessionId(final String inSessionId); }
ActionRequestImpl implements Serializable, ActionRequest<T> { @SuppressWarnings("rawtypes") @Override public boolean equals(final Object other) { if (!(other instanceof ActionRequestImpl)) { return false; } ActionRequestImpl request = (ActionRequestImpl) other; if (!actionKey.equals(request.actionKey)) { return false; } return (param != null && request.param != null) ? param.equals(request.param) : param == request.param; } ActionRequestImpl();  ActionRequestImpl(final String inActionKey, final Serializable inParam); int getId(); void setId(final int inId); String getActionKey(); void setActionKey(final String inActionKey); Serializable getParam(); void setParam(final Serializable inParam); T getResponse(); void setResponse(final T inResponse); @SuppressWarnings("rawtypes") @Override boolean equals(final Object other); @Override int hashCode(); String getSessionId(); void setSessionId(final String inSessionId);  }