/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.zowyapp.store.ui;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author dhaval
 */
public class Form implements Serializable{

    private String name;
    private String description;
    private String groupId;
    private String base;
    private Set<FormField> fields;

    public Form(String name, String description) {
        this.name = name;
        this.description = description;
    }

    public String getDescription() {
        return description;
    }


    public String getName() {
        return name;
    }

    public void setFields(Set<FormField> fields) {
        this.fields = fields;
    }

    public Set<FormField> getFields() {
        return fields;
    }

    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof Form)){
            return false;
        }

        Form f = (Form) obj;
        return name.equalsIgnoreCase(f.name);
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setBase(String base) {
        this.base = base;
    }

    public String getBase() {
        return base;
    }
}
