001    /**
002     * Copyright (c) 2000-present 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    import com.liferay.portal.kernel.util.StringPool;
020    
021    /**
022     * @author Raymond Aug??
023     */
024    public class FacetConfiguration {
025    
026            public String getClassName() {
027                    return _className;
028            }
029    
030            public JSONObject getData() {
031                    if (_dataJSONObject == null) {
032                            _dataJSONObject = JSONFactoryUtil.createJSONObject();
033                    }
034    
035                    return _dataJSONObject;
036            }
037    
038            /**
039             * @deprecated As of 7.0.0, with no direct replacement
040             */
041            @Deprecated
042            public String getDisplayStyle() {
043                    return StringPool.BLANK;
044            }
045    
046            public String getFieldName() {
047                    return _fieldName;
048            }
049    
050            public String getLabel() {
051                    return _label;
052            }
053    
054            public String getOrder() {
055                    if (_order == null) {
056                            return "OrderHitsDesc";
057                    }
058    
059                    return _order;
060            }
061    
062            public double getWeight() {
063                    return _weight;
064            }
065    
066            public boolean isStatic() {
067                    return _static;
068            }
069    
070            public void setClassName(String className) {
071                    _className = className;
072            }
073    
074            public void setDataJSONObject(JSONObject dataJSONObject) {
075                    _dataJSONObject = dataJSONObject;
076            }
077    
078            /**
079             * @deprecated As of 7.0.0, with no direct replacement
080             */
081            @Deprecated
082            public void setDisplayStyle(String displayStyle) {
083            }
084    
085            public void setFieldName(String fieldName) {
086                    _fieldName = fieldName;
087            }
088    
089            public void setLabel(String label) {
090                    _label = label;
091            }
092    
093            public void setOrder(String order) {
094                    _order = order;
095            }
096    
097            public void setStatic(boolean isStatic) {
098                    _static = isStatic;
099            }
100    
101            public void setWeight(double weight) {
102                    _weight = weight;
103            }
104    
105            private String _className;
106            private JSONObject _dataJSONObject;
107            private String _fieldName;
108            private String _label;
109            private String _order;
110            private boolean _static;
111            private double _weight;
112    
113    }