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

com.tradeshift.sdk.assignments.domain.Assignment 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.IDAble;
import com.tradeshift.sdk.core.domain.SecurityGroup;
import com.tradeshift.sdk.core.domain.User;

public class Assignment implements IDAble {

    private final ID id;
    private final String primarySubject;
    private final String app;
    private final ID assignerId;
    private final ID companyId;
    private final List tags;
    private final ZonedDateTime reminderDate;
    private final ZonedDateTime deadlineDate;
    private final Boolean important;
    private final Boolean hold;
    private final String type;
    private final ZonedDateTime created;
    private final ZonedDateTime modified;
    private final AssignmentLog assignmentLog;

    public Assignment(Builder builder) {
        this.id = Objects.requireNonNull(builder.id);
        this.primarySubject = builder.primarySubject;
        this.app = builder.app;
        this.assignerId = builder.assignerId;
        this.companyId = builder.companyId;
        this.tags = builder.tags;
        this.reminderDate = builder.reminderDate;
        this.deadlineDate = builder.deadlineDate;
        this.important = builder.important;
        this.hold = builder.hold;
        this.type = builder.type;
        this.created = builder.created;
        this.modified = builder.modified;
        this.assignmentLog = builder.assignmentLog;
    }

    public ID getId() {
        return id;
    }

    public String getPrimarySubject() {
        return primarySubject;
    }

    public String getApp() {
        return app;
    }

    public ID getAssignerId() {
        return assignerId;
    }

    public ID getCompanyId() {
        return companyId;
    }

    public List getTags() {
        return tags;
    }

    public ZonedDateTime getReminderDate() {
        return reminderDate;
    }

    public ZonedDateTime getDeadlineDate() {
        return deadlineDate;
    }

    public Boolean getImportant() {
        return important;
    }

    public Boolean getHold() {
        return hold;
    }

    public String getType() {
        return type;
    }

    public ZonedDateTime getCreated() {
        return created;
    }

    public ZonedDateTime getModified() {
        return modified;
    }

    public AssignmentLog getAssignmentLog() {
        return assignmentLog;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final Assignment assignment = (Assignment) o;
        return Objects.equals(id, assignment.id)
                && Objects.equals(primarySubject, assignment.primarySubject)
                && Objects.equals(app, assignment.app)
                && Objects.equals(assignerId, assignment.assignerId)
                && Objects.equals(companyId, assignment.companyId)
                && Objects.equals(tags, assignment.tags)
                && Objects.equals(reminderDate, assignment.reminderDate)
                && Objects.equals(deadlineDate, assignment.deadlineDate)
                && Objects.equals(important, assignment.important)
                && Objects.equals(hold, assignment.hold)
                && Objects.equals(type, assignment.type)
                && Objects.equals(created, assignment.created)
                && Objects.equals(modified, assignment.modified)
                && Objects.equals(assignmentLog, assignment.assignmentLog);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, primarySubject, app, assignerId, companyId, tags, reminderDate,
                deadlineDate, important, hold, type, created, modified, assignmentLog);
    }

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

    public static final class Builder {
        private ID id;
        private String primarySubject;
        private String app;
        private ID assignerId;
        private ID companyId;
        private List tags;
        private ZonedDateTime reminderDate;
        private ZonedDateTime deadlineDate;
        private Boolean important;
        private Boolean hold;
        private String type;
        private ZonedDateTime created;
        private ZonedDateTime modified;
        private AssignmentLog assignmentLog;

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

        public Builder setPrimarySubject(String primarySubject) {
            this.primarySubject = primarySubject;
            return this;
        }

        public Builder setApp(String app) {
            this.app = app;
            return this;
        }

        public Builder setAssignerId(ID assignerId) {
            this.assignerId = assignerId;
            return this;
        }

        public Builder setCompanyId(ID companyId) {
            this.companyId = companyId;
            return this;
        }

        public Builder setTags(List tags) {
            this.tags = tags;
            return this;
        }

        public Builder setReminderDate(ZonedDateTime reminderDate) {
            this.reminderDate = reminderDate;
            return this;
        }

        public Builder setDeadlineDate(ZonedDateTime deadlineDate) {
            this.deadlineDate = deadlineDate;
            return this;
        }

        public Builder setImportant(Boolean important) {
            this.important = important;
            return this;
        }

        public Builder setHold(Boolean hold) {
            this.hold = hold;
            return this;
        }

        public Builder setType(String type) {
            this.type = type;
            return this;
        }

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

        public Builder setModified(ZonedDateTime modified) {
            this.modified = modified;
            return this;
        }

        public Builder setAssignmentLog(AssignmentLog assignmentLog) {
            this.assignmentLog = assignmentLog;
            return this;
        }

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy