import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.logging.Logger.getLogger;
+import static net.pterodactylus.sone.data.SoneKt.*;
import java.net.MalformedURLException;
import java.util.ArrayList;
import net.pterodactylus.sone.data.SoneOptions.DefaultSoneOptions;
import net.pterodactylus.sone.database.Database;
import net.pterodactylus.sone.freenet.wot.Identity;
-import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import freenet.keys.FreenetURI;
}
/**
- * Returns the insert URI of this Sone.
- *
- * @return The insert URI of this Sone
- */
- @Nullable
- public FreenetURI getInsertUri() {
- if (!isLocal()) {
- return null;
- }
- try {
- return new FreenetURI(((OwnIdentity) getIdentity()).getInsertUri())
- .setDocName("Sone")
- .setMetaString(new String[0])
- .setSuggestedEdition(latestEdition);
- } catch (MalformedURLException e) {
- throw new IllegalStateException(format("Own identity %s's insert URI is incorrect.", getIdentity()), e);
- }
- }
-
- /**
* Returns the latest edition of this Sone.
*
* @return The latest edition of this Sone
/** {@inheritDoc} */
@Override
public int compareTo(Sone sone) {
- return NICE_NAME_COMPARATOR.compare(this, sone);
+ return niceNameComparator().compare(this, sone);
}
//