001package org.kuali.ole.docstore.common.search;
002
003import javax.xml.bind.annotation.XmlAccessType;
004import javax.xml.bind.annotation.XmlAccessorType;
005import javax.xml.bind.annotation.XmlType;
006
007/**
008 * Created with IntelliJ IDEA.
009 * User: jayabharathreddy
010 * Date: 2/26/14
011 * Time: 6:22 PM
012 * To change this template use File | Settings | File Templates.
013 */
014
015
016/**
017 * <p>Java class for facetCondition complex type.
018 * <p/>
019 * <p>The following schema fragment specifies the expected content contained within this class.
020 * <p/>
021 * <pre>
022 * &lt;complexType name="facetCondition">
023 *   &lt;complexContent>
024 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
025 *       &lt;sequence>
026 *         &lt;element name="facetField" type="{}facetField" minOccurs="0"/>
027 *         &lt;element name="facetFieldPageSize" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
028 *       &lt;/sequence>
029 *     &lt;/restriction>
030 *   &lt;/complexContent>
031 * &lt;/complexType>
032 * </pre>
033 */
034@XmlAccessorType(XmlAccessType.FIELD)
035@XmlType(name = "facetCondition", propOrder = {
036        "docType",
037        "fieldName",
038        "fieldValue",
039        "shortValue"
040})
041public class FacetCondition {
042
043    protected String docType;
044    protected String fieldName;
045    protected String fieldValue;
046    protected String shortValue;
047
048    public String getDocType() {
049        return docType;
050    }
051
052    public void setDocType(String docType) {
053        this.docType = docType;
054    }
055
056    public String getFieldName() {
057        return fieldName;
058    }
059
060    public void setFieldName(String fieldName) {
061        this.fieldName = fieldName;
062    }
063
064    /**
065     * Gets the value of the fieldValue property.
066     *
067     * @return possible object is
068     *         {@link String }
069     */
070    public String getFieldValue() {
071        return fieldValue;
072    }
073
074    /**
075     * Sets the value of the fieldValue property.
076     *
077     * @param value allowed object is
078     *              {@link String }
079     */
080    public void setFieldValue(String value) {
081        this.fieldValue = value;
082    }
083
084    public String getShortValue() {
085        if(fieldValue.contains("/r/n!@#$")) {
086            int index = fieldValue.indexOf("/r/n!@#$");
087            shortValue = fieldValue.substring(index + 8, fieldValue.length());
088        }
089        else {
090            shortValue = fieldValue;
091        }
092        return shortValue;
093    }
094
095    public void setShortValue(String shortValue) {
096        this.shortValue = shortValue;
097    }
098}