All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tradeshift.sdk.assignments.domain.AssignmentLog Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2018 Tradeshift Inc. and/or its affiliates. All rights reserved.
 */
package com.tradeshift.sdk.assignments.domain;

import java.time.ZonedDateTime;
import java.util.List;
import java.util.Objects;

import org.apache.commons.lang3.builder.ToStringBuilder;

import com.tradeshift.sdk.core.domain.ID;
import com.tradeshift.sdk.core.domain.Identity;

public class AssignmentLog {

    private final Long id;
    private final String outcome;
    private final AssignmentStatus assignmentStatus;
    private final String comment;
    private final List> assigneeIds;
    private final ZonedDateTime created;
    private final ID assignmentId;

    public AssignmentLog(Builder builder) {
        this.id = Objects.requireNonNull(builder.id);
        this.outcome = builder.outcome;
        this.assignmentStatus = builder.assignmentStatus;
        this.comment = builder.comment;
        this.assigneeIds = builder.assigneeIds;
        this.created = builder.created;
        this.assignmentId = builder.assignmentId;
    }

    public Long getId() {
        return id;
    }

    public String getOutcome() {
        return outcome;
    }

    public AssignmentStatus getAssignmentStatus() {
        return assignmentStatus;
    }

    public String getComment() {
        return comment;
    }

    public List> getAssigneeIds() {
        return assigneeIds;
    }

    public ZonedDateTime getCreated() {
        return created;
    }

    public ID getAssignmentId() {
        return assignmentId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final AssignmentLog assignmentLog = (AssignmentLog) o;
        return Objects.equals(id, assignmentLog.id)
                && Objects.equals(outcome, assignmentLog.outcome)
                && Objects.equals(assignmentStatus, assignmentLog.assignmentStatus)
                && Objects.equals(comment, assignmentLog.comment)
                && Objects.equals(assignmentId, assignmentLog.assignmentId)
                && Objects.equals(assigneeIds, assignmentLog.assigneeIds)
                && Objects.equals(created, assignmentLog.created);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, outcome, assignmentStatus, comment, assignmentId, assigneeIds, created);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    public static final class Builder {
        private Long id;
        private ID assignmentId;
        private String outcome;
        private AssignmentStatus assignmentStatus;
        private String comment;
        private List> assigneeIds;
        private ZonedDateTime created;

        public Builder setId(Long id) {
            this.id = id;
            return this;
        }

        public Builder setAssignmentId(ID assignmentId) {
            this.assignmentId = assignmentId;
            return this;
        }

        public Builder setOutcome(String outcome) {
            this.outcome = outcome;
            return this;
        }

        public Builder setAssignmentStatus(AssignmentStatus assignmentStatus) {
            this.assignmentStatus = assignmentStatus;
            return this;
        }

        public Builder setComment(String comment) {
            this.comment = comment;
            return this;
        }

        public Builder setAssigneeIds(List> assigneeIds) {
            this.assigneeIds = assigneeIds;
            return this;
        }

        public Builder setCreated(ZonedDateTime created) {
            this.created = created;
            return this;
        }

        public AssignmentLog build() {
            return new AssignmentLog(this);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy