/* * Copyright 2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.wamblee.photos.tapestry; import java.io.Serializable; import org.wamblee.photos.model.Path; /** * Reference to an entry. */ public class EntryRef implements Serializable { static final long serialVersionUID = -3959517013304849351L; /** * Relative path of the entry. */ private String _relativePath; /** * Whether or not the item may be linked to. */ private boolean _linkable; /** * Flag describing whether this is a photo or not. */ private boolean _photo; /** * Entry reference. * @param aRelativePath Relative path. * @param aLinkable Whether or not the item may be linked to. * @param aPhoto Whether the item is a photo or not. */ public EntryRef(String aRelativePath, boolean aLinkable, boolean aPhoto) { _relativePath = aRelativePath; _linkable = aLinkable; _photo = aPhoto; } /** * @return Returns the linkable. */ public boolean isLinkable() { return _linkable; } /** * @param aLinkable The linkable to set. */ public void setLinkable(boolean aLinkable) { _linkable = aLinkable; } /** * @return Returns the relativePath. */ public String getRelativePath() { return _relativePath; } /** * @param aRelativePath The relativePath to set. */ public void setRelativePath(String aRelativePath) { _relativePath = aRelativePath; } /** * @return True if the item is a photo. */ public boolean isPhoto() { return _photo; } /** * Gets the id of the item. * @return Id. */ public String getId() { return new Path(getRelativePath()).getId(); } }