Change Jackson constructors from public to private
This commit is contained in:
parent
1c07b20f89
commit
4901e63599
@ -309,8 +309,6 @@ public final class APIv3 extends AbstractVerticle {
|
|||||||
webServer.requestHandler(http::accept).listen(port);
|
webServer.requestHandler(http::accept).listen(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: TEST IF OUR MODEL CONSTRUCTORS CAN BE PRIVATE
|
|
||||||
|
|
||||||
public static void respondJson(RoutingContext ctx, Object response) {
|
public static void respondJson(RoutingContext ctx, Object response) {
|
||||||
respondJson(ctx, 200, response);
|
respondJson(ctx, 200, response);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ public final class MaxMindCity {
|
|||||||
@Getter private int geonameId;
|
@Getter private int geonameId;
|
||||||
@Getter private String name;
|
@Getter private String name;
|
||||||
|
|
||||||
public MaxMindCity() {} // For Jackson
|
private MaxMindCity() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindCity(JsonObject legacy) {
|
public MaxMindCity(JsonObject legacy) {
|
||||||
this.confidence = legacy.getInteger("confidence", -1);
|
this.confidence = legacy.getInteger("confidence", -1);
|
||||||
|
@ -10,7 +10,7 @@ public final class MaxMindContinent {
|
|||||||
@Getter private int geonameId;
|
@Getter private int geonameId;
|
||||||
@Getter private String name;
|
@Getter private String name;
|
||||||
|
|
||||||
public MaxMindContinent() {} // For Jackson
|
private MaxMindContinent() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindContinent(JsonObject legacy) {
|
public MaxMindContinent(JsonObject legacy) {
|
||||||
this.code = legacy.getString("code", "");
|
this.code = legacy.getString("code", "");
|
||||||
|
@ -11,7 +11,7 @@ public final class MaxMindCountry {
|
|||||||
@Getter private int geonameId;
|
@Getter private int geonameId;
|
||||||
@Getter private String name;
|
@Getter private String name;
|
||||||
|
|
||||||
public MaxMindCountry() {} // For Jackson
|
private MaxMindCountry() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindCountry(JsonObject legacy) {
|
public MaxMindCountry(JsonObject legacy) {
|
||||||
this.isoCode = legacy.getString("iso_code", "");
|
this.isoCode = legacy.getString("iso_code", "");
|
||||||
|
@ -13,7 +13,7 @@ public final class MaxMindLocation {
|
|||||||
@Getter private int metroCode;
|
@Getter private int metroCode;
|
||||||
@Getter private int averageIncome;
|
@Getter private int averageIncome;
|
||||||
|
|
||||||
public MaxMindLocation() {} // For Jackson
|
private MaxMindLocation() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindLocation(JsonObject legacy) {
|
public MaxMindLocation(JsonObject legacy) {
|
||||||
this.latitude = legacy.getDouble("latitude", -1D);
|
this.latitude = legacy.getDouble("latitude", -1D);
|
||||||
|
@ -8,7 +8,7 @@ public final class MaxMindPostal {
|
|||||||
@Getter private String code;
|
@Getter private String code;
|
||||||
@Getter private int confidence;
|
@Getter private int confidence;
|
||||||
|
|
||||||
public MaxMindPostal() {} // For Jackson
|
private MaxMindPostal() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindPostal(JsonObject legacy) {
|
public MaxMindPostal(JsonObject legacy) {
|
||||||
this.code = legacy.getString("code", "");
|
this.code = legacy.getString("code", "");
|
||||||
|
@ -10,7 +10,7 @@ public final class MaxMindRegisteredCountry {
|
|||||||
@Getter private int geonameId;
|
@Getter private int geonameId;
|
||||||
@Getter private String name;
|
@Getter private String name;
|
||||||
|
|
||||||
public MaxMindRegisteredCountry() {} // For Jackson
|
private MaxMindRegisteredCountry() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindRegisteredCountry(JsonObject legacy) {
|
public MaxMindRegisteredCountry(JsonObject legacy) {
|
||||||
this.isoCode = legacy.getString("iso_code", "");
|
this.isoCode = legacy.getString("iso_code", "");
|
||||||
|
@ -19,7 +19,7 @@ public final class MaxMindResult {
|
|||||||
@Getter private MaxMindCountry country;
|
@Getter private MaxMindCountry country;
|
||||||
@Getter private MaxMindRegisteredCountry registeredCountry;
|
@Getter private MaxMindRegisteredCountry registeredCountry;
|
||||||
|
|
||||||
public MaxMindResult() {} // For Jackson
|
private MaxMindResult() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindResult(JsonObject legacy) {
|
public MaxMindResult(JsonObject legacy) {
|
||||||
this.continent = new MaxMindContinent(legacy.getJsonObject("continent", new JsonObject()));
|
this.continent = new MaxMindContinent(legacy.getJsonObject("continent", new JsonObject()));
|
||||||
|
@ -11,7 +11,7 @@ public final class MaxMindSubdivision {
|
|||||||
@Getter private int geonameId;
|
@Getter private int geonameId;
|
||||||
@Getter private String name;
|
@Getter private String name;
|
||||||
|
|
||||||
public MaxMindSubdivision() {} // For Jackson
|
private MaxMindSubdivision() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindSubdivision(JsonObject legacy) {
|
public MaxMindSubdivision(JsonObject legacy) {
|
||||||
this.isoCode = legacy.getString("iso_code", "");
|
this.isoCode = legacy.getString("iso_code", "");
|
||||||
|
@ -12,7 +12,7 @@ public final class MaxMindTraits {
|
|||||||
@Getter private MaxMindUserType userType;
|
@Getter private MaxMindUserType userType;
|
||||||
@Getter private String organization;
|
@Getter private String organization;
|
||||||
|
|
||||||
public MaxMindTraits() {} // For Jackson
|
private MaxMindTraits() {} // For Jackson
|
||||||
|
|
||||||
public MaxMindTraits(JsonObject legacy) {
|
public MaxMindTraits(JsonObject legacy) {
|
||||||
this.isp = legacy.getString("isp", "");
|
this.isp = legacy.getString("isp", "");
|
||||||
|
@ -41,7 +41,7 @@ public final class AuditLogEntry {
|
|||||||
auditLogCollection.find(query).into(new LinkedList<>(), callback);
|
auditLogCollection.find(query).into(new LinkedList<>(), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AuditLogEntry() {} // For Jackson
|
private AuditLogEntry() {} // For Jackson
|
||||||
|
|
||||||
public AuditLogEntry(User user, String userIp, Actor actor, AuditLogActionType type, Map<String, Object> metadata) {
|
public AuditLogEntry(User user, String userIp, Actor actor, AuditLogActionType type, Map<String, Object> metadata) {
|
||||||
this.id = new ObjectId().toString();
|
this.id = new ObjectId().toString();
|
||||||
|
@ -81,7 +81,7 @@ public final class Grant {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Grant() {} // For Jackson
|
private Grant() {} // For Jackson
|
||||||
|
|
||||||
public Grant(User user, String reason, Set<ServerGroup> scopes, Rank rank, Instant expiresAt, User addedBy) {
|
public Grant(User user, String reason, Set<ServerGroup> scopes, Rank rank, Instant expiresAt, User addedBy) {
|
||||||
this.id = new ObjectId().toString();
|
this.id = new ObjectId().toString();
|
||||||
|
@ -69,7 +69,7 @@ public final class IpBan {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public IpBan() {} // For Jackson
|
private IpBan() {} // For Jackson
|
||||||
|
|
||||||
public IpBan(String userIp, Punishment linked) {
|
public IpBan(String userIp, Punishment linked) {
|
||||||
this.id = new ObjectId().toString();
|
this.id = new ObjectId().toString();
|
||||||
|
@ -59,7 +59,7 @@ public final class IpIntel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public IpIntel() {} // For Jackson
|
private IpIntel() {} // For Jackson
|
||||||
|
|
||||||
private IpIntel(String ip, MaxMindResult result) {
|
private IpIntel(String ip, MaxMindResult result) {
|
||||||
this.id = ip;
|
this.id = ip;
|
||||||
|
@ -53,7 +53,7 @@ public final class IpLogEntry {
|
|||||||
ipLogCollection.find(new Document("user", user).append("userIp", userIp)).first(callback);
|
ipLogCollection.find(new Document("user", user).append("userIp", userIp)).first(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IpLogEntry() {} // For Jackson
|
private IpLogEntry() {} // For Jackson
|
||||||
|
|
||||||
public IpLogEntry(User user, String userIp) {
|
public IpLogEntry(User user, String userIp) {
|
||||||
this.id = new ObjectId().toString();
|
this.id = new ObjectId().toString();
|
||||||
|
@ -31,7 +31,7 @@ public final class NotificationTemplate {
|
|||||||
notificationTemplatesCollection.find(new Document("_id", id)).first(callback);
|
notificationTemplatesCollection.find(new Document("_id", id)).first(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NotificationTemplate() {} // For Jackson
|
private NotificationTemplate() {} // For Jackson
|
||||||
|
|
||||||
public NotificationTemplate(String id, String subject, String body) {
|
public NotificationTemplate(String id, String subject, String body) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -95,7 +95,7 @@ public final class Punishment {
|
|||||||
punishmentsCollection.find(new Document("user", user).append("type", new Document("$in", convertedTypes))).into(new LinkedList<>(), callback);
|
punishmentsCollection.find(new Document("user", user).append("type", new Document("$in", convertedTypes))).into(new LinkedList<>(), callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Punishment() {} // For Jackson
|
private Punishment() {} // For Jackson
|
||||||
|
|
||||||
public Punishment(User user, String reason, PunishmentType type, Instant expiresAt, User addedBy, Actor actor, Map<String, Object> metadata) {
|
public Punishment(User user, String reason, PunishmentType type, Instant expiresAt, User addedBy, Actor actor, Map<String, Object> metadata) {
|
||||||
this.id = new ObjectId().toString();
|
this.id = new ObjectId().toString();
|
||||||
|
@ -66,7 +66,7 @@ public final class Rank {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rank() {} // For Jackson
|
private Rank() {} // For Jackson
|
||||||
|
|
||||||
public Rank(String id, int weight, String displayName, String gameColor, String websiteColor, boolean staffRank) {
|
public Rank(String id, int weight, String displayName, String gameColor, String websiteColor, boolean staffRank) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -69,7 +69,7 @@ public final class Server {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Server() {} // For Jackson
|
private Server() {} // For Jackson
|
||||||
|
|
||||||
public Server(String id, String displayName, String apiKey, ServerGroup serverGroup, String serverIp) {
|
public Server(String id, String displayName, String apiKey, ServerGroup serverGroup, String serverIp) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -65,7 +65,7 @@ public final class ServerGroup {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerGroup() {} // For Jackson
|
private ServerGroup() {} // For Jackson
|
||||||
|
|
||||||
public ServerGroup(String id, String image) {
|
public ServerGroup(String id, String image) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
Loading…
Reference in New Issue
Block a user