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.templates; import com.eldar.models.Base; import com.eldar.models.Versionable; import org.apache.commons.lang3.SerializationUtils; /** * @author Phillip Sanderson * Date: 23/06/12 * Time: 12:51 PM */ public class Layout extends Base implements Versionable<LayoutVersion> { private String name; private String description; private LayoutVersion currentVersion; public Layout() { } /** * Name of the layout * @return - Layout name. */ public String getName() { return name; } public void setName(String name) { this.name = name; } /** * Description of the layout. * @return - Layout description */ public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Override public void setVersion(LayoutVersion layoutVersion) { currentVersion = layoutVersion; } @Override public LayoutVersion getVersion() { return this.currentVersion; } @Override public LayoutVersion cloneCurrentVersion() { LayoutVersion clone = SerializationUtils.clone(currentVersion); clone.setId(0); return clone; } @Override public int getVersionNumber() { return currentVersion.getVersion(); } }