2 * Sone - Shell.java - Copyright © 2010 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.sone.data;
21 * Marker interface for classes that are only empty shells for objects that have
22 * not yet been retrieved from Freenet.
25 * The type of object that is shelled
26 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
28 public interface Shell<T> {
31 * Returns whether the shelled object can be unshelled now.
33 * @return {@code true} if {@link #getShelled()} can return the shelled
34 * object, {@code false} otherwise
36 public boolean canUnshell();
39 * Returns the object that is shelled. This method with return the shell
40 * itself if {@link #canUnshell()} returns {@code false} and will return the
41 * real object once {@link #canUnshell()} returns true.
43 * @return The shelled object, or the shell itself
45 public T getShelled();