package no.abmu.abmstatistikk.annualstatistic.domain;

import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        Members of a constraint group
 *     
*/
public class FieldGroupConstraintMember extends no.abmu.common.AuditableDomainObject implements Serializable {

    /** identifier field */
    private no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraintMemberPK comp_id;

    /** nullable persistent field */
    private no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraint fieldGroupConstraint;

    /** persistent field */
    private no.abmu.abmstatistikk.annualstatistic.domain.Field field;

    /** full constructor */
    public FieldGroupConstraintMember(no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraintMemberPK comp_id, no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraint fieldGroupConstraint, no.abmu.abmstatistikk.annualstatistic.domain.Field field) {
        this.comp_id = comp_id;
        this.fieldGroupConstraint = fieldGroupConstraint;
        this.field = field;
    }

    /** default constructor */
    public FieldGroupConstraintMember() {
    }

    /** minimal constructor */
    public FieldGroupConstraintMember(no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraintMemberPK comp_id, no.abmu.abmstatistikk.annualstatistic.domain.Field field) {
        this.comp_id = comp_id;
        this.field = field;
    }

    public no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraintMemberPK getComp_id() {
        return this.comp_id;
    }

    public void setComp_id(no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraintMemberPK comp_id) {
        this.comp_id = comp_id;
    }

    public no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraint getFieldGroupConstraint() {
        return this.fieldGroupConstraint;
    }

    public void setFieldGroupConstraint(no.abmu.abmstatistikk.annualstatistic.domain.FieldGroupConstraint fieldGroupConstraint) {
        this.fieldGroupConstraint = fieldGroupConstraint;
    }

    public no.abmu.abmstatistikk.annualstatistic.domain.Field getField() {
        return this.field;
    }

    public void setField(no.abmu.abmstatistikk.annualstatistic.domain.Field field) {
        this.field = field;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("comp_id", getComp_id())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof FieldGroupConstraintMember) ) return false;
        FieldGroupConstraintMember castOther = (FieldGroupConstraintMember) other;
        return new EqualsBuilder()
            .append(this.getComp_id(), castOther.getComp_id())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getComp_id())
            .toHashCode();
    }

}
