package moe.oko.Kiafumi.model; import javax.annotation.Nullable; /** * Server Class * Used for in-memory data storage. Loaded from Database later. */ public class Server { private String id; private boolean welcomeEnabled; private String welcomeChannel; private String joinRole; private boolean serverProtected; private boolean modified; public Server(String id) { this.id = id; this.welcomeEnabled = false; this.welcomeChannel = null; this.joinRole = null; this.serverProtected = false; this.modified = false; } /** * Database Constructor * @param id - id of the server * @param welcomeEnabled - is welcome enabled for the server * @param welcomeChannel - channel for welcome messages, if enabled * @param serverProtected - is the server under protection rules. (/archive, /stop, etc.) */ public Server(String id, boolean welcomeEnabled, @Nullable String welcomeChannel, @Nullable String joinRole, boolean serverProtected) { this.id = id; this.welcomeEnabled = welcomeEnabled; this.welcomeChannel = welcomeChannel; this.joinRole = joinRole; this.serverProtected = serverProtected; this.modified = false; } public String getId() { return id; } public boolean isModified() { return modified; } @Override public String toString() { return "Server{id=" + this.id + ",welcomeEnabled=" + welcomeEnabled + ",welcomeChannel="+welcomeChannel+ ",joinrole=" + joinRole +",serverProtected="+serverProtected+"}"; } }