? !userAttachResponse.equals(that.userAttachResponse) : that.userAttachResponse != null) { return false;
private static UserAttachResponse convert( org.kaaproject.kaa.server.sync.UserAttachResponse source) { UserAttachResponse response = new UserAttachResponse(); response.setResult(source.getResult() == SyncStatus.SUCCESS ? SyncResponseResultType.SUCCESS : SyncResponseResultType.FAILURE); response.setErrorCode(convert(source.getErrorCode())); response.setErrorReason(source.getErrorReason()); return response; }
@Override public int hashCode() { int result = userAttachResponse != null ? userAttachResponse.hashCode() : 0; result = 31 * result + (userAttachNotification != null ? userAttachNotification.hashCode() : 0); result = 31 * result + (userDetachNotification != null ? userDetachNotification.hashCode() : 0); result = 31 * result + (endpointAttachResponses != null ? endpointAttachResponses.hashCode() : 0); result = 31 * result + (endpointDetachResponses != null ? endpointDetachResponses.hashCode() : 0); return result; }
private static UserServerSync deepCopy(UserServerSync source) { if (source == null) { return null; } UserServerSync copy = new UserServerSync(); if (source.getEndpointAttachResponses() != null) { copy.setEndpointAttachResponses(new ArrayList<>(source.getEndpointAttachResponses())); } if (source.getEndpointDetachResponses() != null) { copy.setEndpointDetachResponses(new ArrayList<>(source.getEndpointDetachResponses())); } if (source.getUserAttachNotification() != null) { copy.setUserAttachNotification(new UserAttachNotification( source.getUserAttachNotification().getUserExternalId(), source .getUserAttachNotification().getEndpointAccessToken())); } if (source.getUserAttachResponse() != null) { UserAttachResponse uarSource = source.getUserAttachResponse(); copy.setUserAttachResponse(new UserAttachResponse( uarSource.getResult(), uarSource.getErrorCode(), uarSource.getErrorReason())); } if (source.getUserDetachNotification() != null) { copy.setUserDetachNotification(new UserDetachNotification( source.getUserDetachNotification().getEndpointAccessToken())); } return copy; }
/** * Convert user verification response message to user attach response. * * @param value the user verification response message * @return the user attach response */ public static UserAttachResponse convert(UserVerificationResponseMessage value) { UserAttachResponse response = new UserAttachResponse(value.isSuccess() ? SyncStatus.SUCCESS : SyncStatus.FAILURE, EntityConvertUtils.toErrorCode(value.getErrorCode()), value.getFailureReason()); return response; }
buf.put(USER_ATTACH_RESPONSE_FIELD_ID); buf.put(NOTHING); buf.put(uaResponse.getResult() == SyncStatus.SUCCESS ? SUCCESS : FAILURE); buf.put(NOTHING); if (uaResponse.getResult() != SyncStatus.SUCCESS) { buf.putShort((short) (uaResponse.getErrorCode() != null ? uaResponse.getErrorCode().ordinal() : 0)); if (uaResponse.getErrorReason() != null) { byte[] data = uaResponse.getErrorReason().getBytes(UTF8); buf.putShort((short) data.length); put(buf, data);