com.tradeshift.sdk.assignments.domain.AbstractAssignmentMessage Maven / Gradle / Ivy
/*
* Copyright (c) 2018 Tradeshift Inc. and/or its affiliates. All rights reserved.
*/
package com.tradeshift.sdk.assignments.domain;
import java.util.Objects;
import com.tradeshift.sdk.core.domain.ContextMsg;
import com.tradeshift.sdk.core.domain.ID;
import com.tradeshift.sdk.core.domain.UserContext;
/**
* A message containing information about a single assignment.
*/
abstract class AbstractAssignmentMessage extends ContextMsg {
private final ID assignmentId;
AbstractAssignmentMessage(UserContext ctx, ID assignmentId) {
super(ctx);
this.assignmentId = Objects.requireNonNull(assignmentId);
}
public ID getAssignmentId() {
return assignmentId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
final AbstractAssignmentMessage msg = (AbstractAssignmentMessage) o;
return Objects.equals(assignmentId, msg.assignmentId);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), assignmentId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy