projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Return a collection instead of a list for the friends.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
impl
/
ReplyImpl.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/impl/ReplyImpl.java
b/src/main/java/net/pterodactylus/sone/data/impl/ReplyImpl.java
index
ee8c01e
..
a67081f
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/impl/ReplyImpl.java
+++ b/
src/main/java/net/pterodactylus/sone/data/impl/ReplyImpl.java
@@
-19,6
+19,7
@@
package net.pterodactylus.sone.data.impl;
import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
+import net.pterodactylus.sone.database.SoneProvider;
/**
* Abstract base class for all replies.
/**
* Abstract base class for all replies.
@@
-29,11
+30,14
@@
import net.pterodactylus.sone.data.Sone;
*/
public abstract class ReplyImpl<T extends Reply<T>> implements Reply<T> {
*/
public abstract class ReplyImpl<T extends Reply<T>> implements Reply<T> {
+ /** The Sone provider. */
+ private final SoneProvider soneProvider;
+
/** The ID of the reply. */
private final String id;
/** The Sone that created this reply. */
/** The ID of the reply. */
private final String id;
/** The Sone that created this reply. */
- private final S
one sone
;
+ private final S
tring soneId
;
/** The time of the reply. */
private final long time;
/** The time of the reply. */
private final long time;
@@
-47,18
+51,21
@@
public abstract class ReplyImpl<T extends Reply<T>> implements Reply<T> {
/**
* Creates a new reply.
*
/**
* Creates a new reply.
*
+ * @param soneProvider
+ * The Sone provider
* @param id
* The ID of the reply
* @param id
* The ID of the reply
- * @param sone
- * The Sone of the reply
+ * @param sone
Id
+ * The
ID of the
Sone of the reply
* @param time
* The time of the reply
* @param text
* The text of the reply
*/
* @param time
* The time of the reply
* @param text
* The text of the reply
*/
- protected ReplyImpl(String id, Sone sone, long time, String text) {
+ protected ReplyImpl(SoneProvider soneProvider, String id, String soneId, long time, String text) {
+ this.soneProvider = soneProvider;
this.id = id;
this.id = id;
- this.sone
= sone
;
+ this.sone
Id = soneId
;
this.time = time;
this.text = text;
}
this.time = time;
this.text = text;
}
@@
-76,7
+83,7
@@
public abstract class ReplyImpl<T extends Reply<T>> implements Reply<T> {
*/
@Override
public Sone getSone() {
*/
@Override
public Sone getSone() {
- return sone;
+ return sone
Provider.getSone(soneId).get()
;
}
/**
}
/**
@@
-142,7
+149,7
@@
public abstract class ReplyImpl<T extends Reply<T>> implements Reply<T> {
*/
@Override
public String toString() {
*/
@Override
public String toString() {
- return
getClass().getName() + "[id=" + id + ",sone=" + sone + ",time=" + time + ",text=" + text + "]"
;
+ return
String.format("%s[id=%s,sone=%s,time=%d,text=%s]", getClass().getName(), id, soneId, time, text)
;
}
}
}
}