From 1c3d65453e87eb0ad558c079f9616684caf8e969 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 12 Oct 2010 13:44:13 +0200 Subject: [PATCH] Add Sone stub. --- .../java/net/pterodactylus/sone/data/Sone.java | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/main/java/net/pterodactylus/sone/data/Sone.java diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java new file mode 100644 index 0000000..5efcc06 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -0,0 +1,82 @@ +/* + * FreenetSone - Sone.java - Copyright © 2010 David Roden + * + * This program 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. + * + * This program 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 this program. If not, see . + */ + +package net.pterodactylus.sone.data; + +import freenet.keys.FreenetURI; + +/** + * A Sone defines everything about a user: the {@link User} itself, her profile, + * her status updates. + * + * @author David ‘Bombe’ Roden + */ +public class Sone { + + /** The URI under which the Sone is stored in Freenet. */ + private final FreenetURI requestUri; + + /** The URI used to insert a new version of this Sone. */ + /* This will be null for remote Sones! */ + private final FreenetURI insertUri; + + /** + * Creates a new Sone. + * + * @param requestUri + * The request URI of the Sone + */ + public Sone(FreenetURI requestUri) { + this(requestUri, null); + } + + /** + * Creates a new Sone. + * + * @param requestUri + * The request URI of the Sone + * @param insertUri + * The insert URI of the Sone + */ + public Sone(FreenetURI requestUri, FreenetURI insertUri) { + this.requestUri = requestUri; + this.insertUri = insertUri; + } + + // + // ACCESSORS + // + + /** + * Returns the request URI of this Sone. + * + * @return The request URI of this Sone + */ + public FreenetURI requestUri() { + return requestUri; + } + + /** + * Returns the insert URI of this Sone. + * + * @return The insert URI of this Sone + */ + public FreenetURI insertUri() { + return insertUri; + } + +} -- 2.7.4