001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
018 */
019
020package org.nuxeo.ecm.platform.el;
021
022/**
023 * Simple String wrapper to allow manipulating a "standalone" string in the context == changing value without changing
024 * reference.
025 *
026 * @author tiry
027 */
028public class ContextStringWrapper {
029
030    private String value;
031
032    public ContextStringWrapper(String value) {
033        this.value = value;
034    }
035
036    public String getValue() {
037        return value;
038    }
039
040    public void setValue(String value) {
041        this.value = value;
042    }
043
044    @Override
045    public String toString() {
046        return value;
047    }
048
049    @Override
050    public boolean equals(Object object) {
051        if (this == object) {
052            return true;
053        }
054        if (!(object instanceof ContextStringWrapper)) {
055            return false;
056        }
057
058        ContextStringWrapper other = (ContextStringWrapper) object;
059        return value.equals(other.value);
060    }
061
062    @Override
063    public int hashCode() {
064        return value.hashCode();
065    }
066
067}