Java tutorial
/******************************************************************************* * This file is part of Eldar Works. * * Eldar Works is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Eldar Works is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Eldar Works. If not, see <http://www.gnu.org/licenses/>. * Copyright (c) 2012. Phillip Sanderson ******************************************************************************/ package com.eldar.models.resources; import com.eldar.models.Base; import com.eldar.models.VersionState; import com.eldar.models.Versionable; import org.apache.commons.lang3.SerializationUtils; /** * @author Phillip Sanderson * Date: 26/05/12 * Time: 5:43 PM */ public class Style extends Base implements Versionable<StyleVersion> { private StyleVersion version; public Style(StyleVersion version) { this.version = version; } @Override public void setVersion(StyleVersion styleVersion) { this.version = styleVersion; } public StyleVersion getVersion() { return this.version; } @Override public StyleVersion cloneCurrentVersion() { StyleVersion clone = SerializationUtils.clone(version); clone.setId(0); return clone; } @Override public int getVersionNumber() { return version.getVersion(); } public Resource getResource() { return version.getResource(); } public void setResource(Resource resource) { version.setResource(resource); } public String getName() { return version.getName(); } public void setName(String name) { version.setName(name); } public String getDescription() { return version.getDescription(); } public void setDescription(String description) { version.setDescription(description); } public VersionState getVersionState() { return version.getState(); } }