Private home list display, caching

This commit is contained in:
William committed 2022-05-27 12:43:40 +01:00
1 parent 83d5a921ee
commit bafd3837dd
10 files changed
+237 -19

No files matched your search

@@ -30,7 +30,7 @@ public class Home extends SavedPosition {
this.isPublic = isPublic;
}
public Home(Position position, PositionMeta meta, @NotNull User owner) {
public Home(@NotNull Position position, @NotNull PositionMeta meta, @NotNull User owner) {
super(position, meta);
this.owner = owner;
this.isPublic = false;
@@ -12,7 +12,7 @@ import java.io.IOException;
import java.util.UUID;
/**
* Represents a position - a location somewhere on the proxy network or server
* Represents a position - a {@link Location} somewhere on the proxy network or server
*/
public class Position extends Location implements MessageSerializable {
@@ -7,7 +7,7 @@ import java.util.UUID;
/**
* Represents a persistently-saved {@link Position}
*/
public abstract class SavedPosition extends Position {
public abstract class SavedPosition extends Position implements Comparable<SavedPosition> {
/**
* Metadata about this position (name, description)
@@ -42,4 +42,15 @@ public abstract class SavedPosition extends Position {
this.uuid = UUID.randomUUID();
}
/**
* Compare two {@link SavedPosition}s, returns alphabetical compareTo result
*
* @param other the object to be compared.
* @return the alphabetical comparison with another {@link SavedPosition}'s {@link PositionMeta#name}
*/
@Override
public final int compareTo(@NotNull SavedPosition other) {
return meta.name.compareToIgnoreCase(other.meta.name);
}
}
@@ -21,8 +21,7 @@ public class Warp extends SavedPosition {
* @param position The {@link Position} to save as a warp
* @param meta {@link PositionMeta} information about this position
*/
public Warp(Position position, PositionMeta meta) {
public Warp(@NotNull Position position, @NotNull PositionMeta meta) {
super(position, meta);
}
}