/* * Copyright (c) 2013 Data Harmonisation Panel * * All rights reserved. This program and the accompanying materials are made * available under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution. If not, see <http://www.gnu.org/licenses/>. * * Contributors: * Data Harmonisation Panel <http://www.dhpanel.eu> */ package eu.esdihumboldt.hale.common.core.io; /** * Text that is serialized as XML element with preserved whitespace when used as * complex value. * * @author Simon Templer */ public class Text { private final String text; /** * @param text the text */ public Text(String text) { super(); this.text = text; } /** * @return the text */ public String getText() { return text; } @Override public String toString() { return text; } @Override public int hashCode() { return ((text == null) ? 0 : text.hashCode()); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Text other = (Text) obj; if (text == null) { if (other.text != null) return false; } else if (!text.equals(other.text)) return false; return true; } }