001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search.facet.config;
016    
017    import com.liferay.portal.kernel.json.JSONFactoryUtil;
018    import com.liferay.portal.kernel.json.JSONObject;
019    
020    /**
021     * @author Raymond Aug??
022     */
023    public class FacetConfiguration {
024    
025            public String getClassName() {
026                    return _className;
027            }
028    
029            public JSONObject getData() {
030                    if (_dataJSONObject == null) {
031                            _dataJSONObject = JSONFactoryUtil.createJSONObject();
032                    }
033    
034                    return _dataJSONObject;
035            }
036    
037            public String getDisplayStyle() {
038                    return _displayStyle;
039            }
040    
041            public String getFieldName() {
042                    return _fieldName;
043            }
044    
045            public String getLabel() {
046                    return _label;
047            }
048    
049            public String getOrder() {
050                    if (_order == null) {
051                            return "OrderHitsDesc";
052                    }
053    
054                    return _order;
055            }
056    
057            public double getWeight() {
058                    return _weight;
059            }
060    
061            public boolean isStatic() {
062                    return _static;
063            }
064    
065            public void setClassName(String className) {
066                    _className = className;
067            }
068    
069            public void setDataJSONObject(JSONObject dataJSONObject) {
070                    _dataJSONObject = dataJSONObject;
071            }
072    
073            public void setDisplayStyle(String displayStyle) {
074                    _displayStyle = displayStyle;
075            }
076    
077            public void setFieldName(String fieldName) {
078                    _fieldName = fieldName;
079            }
080    
081            public void setLabel(String label) {
082                    _label = label;
083            }
084    
085            public void setOrder(String order) {
086                    _order = order;
087            }
088    
089            public void setStatic(boolean isStatic) {
090                    _static = isStatic;
091            }
092    
093            public void setWeight(double weight) {
094                    _weight = weight;
095            }
096    
097            private String _className;
098            private JSONObject _dataJSONObject;
099            private String _displayStyle;
100            private String _fieldName;
101            private String _label;
102            private String _order;
103            private boolean _static;
104            private double _weight;
105    
106    }