package org.openengsb.opencit.core.projectmanager.model;

import java.io.Serializable;
import java.util.UUID;

@SuppressWarnings("serial")
public class Build implements Serializable {
    private UUID id;
    private String projectId;
    private BuildReason reason;
    
    public Build() {
        this.id = UUID.randomUUID();
    }

    public Build(String projectId, BuildReason reason) {
        this.id = UUID.randomUUID();
        this.setProjectId(projectId);
        this.setReason(reason);
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setReason(BuildReason reason) {
        this.reason = reason;
    }

    public BuildReason getReason() {
        return reason;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public UUID getId() {
        return id;
    }
}

@@ -104,16 +104,61 @@
 .UUID;%0A%0A
+import org.apache.commons.lang.ObjectUtils;%0A%0A
 @Suppres
@@ -970,11 +970,868 @@
 d;%0A    %7D
+%0A%0A    private boolean objectEquals(Object o1, Object o2) %7B%0A        /* Needed for the persistence service */%0A        if (o1 == null %7C%7C o2 == null) %7B%0A            return true;%0A        %7D%0A        return ObjectUtils.equals(o1, o2);%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if (!(obj instanceof Build)) %7B%0A            return false;%0A        %7D%0A        Build other = (Build) obj;%0A%0A        if (!objectEquals(id, other.id)) return false;%0A        if (!objectEquals(projectId, other.projectId)) return false;%0A        if (!objectEquals(reason, other.reason)) return false;%0A%0A        return true;%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        int hash = 17;%0A        hash += 31 * ObjectUtils.hashCode(id);%0A        hash += 31 * ObjectUtils.hashCode(projectId);%0A        hash += 31 * ObjectUtils.hashCode(reason);%0A        return hash;%0A    %7D
 %0A%7D%0A

Implement equals and hashcode in Build