package org.intermine.bio.web.model;

/*
 * Copyright (C) 2002-2016 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import java.util.List;
import java.util.Set;

/**
 * A class to represent the constraints a user selected including a list of features and genomic
 * regions, etc.
 *
 * @author Fengyuan Hu
 */
public class GenomicRegionSearchConstraint
{
    private String orgName = null;
    private Set<Class<?>> featureTypes = null;
    private List<GenomicRegion> genomicRegionList = null;
    private int extendedRegionSize = 0;

    // TODO add liftOver contraints: org, source, target

    /**
     * @return the orgName
     */
    public String getOrgName() {
        return orgName;
    }
    /**
     * @param orgName the orgName to set
     */
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    /**
     * @return the feature types to search for
     */
    public Set<Class<?>> getFeatureTypes() {
        return featureTypes;
    }
    /**
     * @param featureTypes the feature types to search for
     */
    public void setFeatureTypes(Set<Class<?>> featureTypes) {
        this.featureTypes = featureTypes;
    }

    /**
     * @return the genomicRegionList
     */
    public List<GenomicRegion> getGenomicRegionList() {
        return genomicRegionList;
    }
    /**
     * @param genomicRegionList the genomicRegionList to set
     */
    public void setGenomicRegionList(List<GenomicRegion> genomicRegionList) {
        this.genomicRegionList = genomicRegionList;
    }

    /**
     * @return the extendedRegionSize
     */
    public int getExtendedRegionSize() {
        return extendedRegionSize;
    }
    /**
     * @param extededRegionSize the extendedRegionSize to set
     */
    public void setExtededRegionSize(int extededRegionSize) {
        this.extendedRegionSize = extededRegionSize;
    }

    /**
     * @param obj a GenomicRegionSearchConstraint object
     * @return boolean
     */
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof GenomicRegionSearchConstraint) {
            GenomicRegionSearchConstraint c = (GenomicRegionSearchConstraint) obj;
            return (extendedRegionSize == c.getExtendedRegionSize()
                    && genomicRegionList.equals(c.getGenomicRegionList())
                    && featureTypes.equals(c.getFeatureTypes())
                    && orgName.equals(c.getOrgName()));
        }
        return false;
    }

    /**
     * @return hashCode
     */
    @Override
    public int hashCode() {
        return extendedRegionSize + genomicRegionList.hashCode() + featureTypes.hashCode()
            + orgName.hashCode();
    }

}

@@ -749,16 +749,53 @@
 e = 0;%0A%0A
+    private boolean strandSpecific;%0A%0A
     // T
@@ -1941,24 +1941,25 @@
  @param exte
+n
 dedRegionSiz
@@ -2021,16 +2021,17 @@
  setExte
+n
 dedRegio
@@ -2040,24 +2040,25 @@
 ize(int exte
+n
 dedRegionSiz
@@ -2100,16 +2100,17 @@
 e = exte
+n
 dedRegio
@@ -2115,32 +2115,321 @@
 ionSize;%0A    %7D%0A%0A
+    /**%0A     * @param strandSpecific%0A     */%0A    public void setStrandSpecific(boolean strandSpecific) %7B%0A        this.strandSpecific = strandSpecific;%0A    %7D%0A%0A    /**%0A     * @return strandSpecific value%0A     */%0A    public boolean getStrandSpecific() %7B%0A        return strandSpecific;%0A    %7D%0A%0A
     /**%0A     * @
@@ -2964,16 +2964,77 @@
 gName())
+%0A                    && strandSpecific==c.getStrandSpecific()
 );%0A     

Add strandSpecific boolean to constructor and equals() method