001/*
002 *  Copyright 2020 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.cms.search.advanced;
017
018/**
019 * Class wrapping a value for {@link TreeMaker#toQuery}
020 */
021public class WrappedValue
022{
023    private Object _value;
024    
025    /**
026     * Constructor
027     * @param value the wrapped value
028     */
029    public WrappedValue(Object value)
030    {
031        _value = value;
032    }
033    
034    /**
035     * Gets the wrapped value
036     * @return the wrapped value
037     */
038    public Object getValue()
039    {
040        return _value;
041    }
042    
043    /**
044     * Sets a new wrapped value
045     * @param value the new wrapped value
046     */
047    public void setValue(Object value)
048    {
049        _value = value;
050    }
051    
052    @Override
053    public String toString()
054    {
055        return String.valueOf(_value);
056    }
057}
058