Made every class that can be final final
This commit is contained in:
@ -17,7 +17,7 @@ import envoy.data.Config;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Client v0.1-beta
|
||||
*/
|
||||
public class ClientConfig extends Config {
|
||||
public final class ClientConfig extends Config {
|
||||
|
||||
private static ClientConfig config;
|
||||
|
||||
|
@ -17,11 +17,11 @@ import envoy.event.GroupMessageStatusChange;
|
||||
* Project: <strong>envoy-client</strong><br>
|
||||
* File: <strong>GroupChat.java</strong><br>
|
||||
* Created: <strong>05.07.2020</strong><br>
|
||||
*
|
||||
*
|
||||
* @author Maximilian Käfer
|
||||
* @since Envoy Client v0.1-beta
|
||||
*/
|
||||
public class GroupChat extends Chat {
|
||||
public final class GroupChat extends Chat {
|
||||
|
||||
private final User sender;
|
||||
|
||||
@ -41,13 +41,10 @@ public class GroupChat extends Chat {
|
||||
public void read(WriteProxy writeProxy) throws IOException {
|
||||
for (int i = messages.size() - 1; i >= 0; --i) {
|
||||
final GroupMessage gmsg = (GroupMessage) messages.get(i);
|
||||
if (gmsg.getSenderID() != sender.getID()) {
|
||||
if (gmsg.getMemberStatuses().get(sender.getID()) == MessageStatus.READ) break;
|
||||
else {
|
||||
gmsg.getMemberStatuses().replace(sender.getID(), MessageStatus.READ);
|
||||
writeProxy
|
||||
.writeMessageStatusChange(new GroupMessageStatusChange(gmsg.getID(), MessageStatus.READ, Instant.now(), sender.getID()));
|
||||
}
|
||||
if (gmsg.getSenderID() != sender.getID()) if (gmsg.getMemberStatuses().get(sender.getID()) == MessageStatus.READ) break;
|
||||
else {
|
||||
gmsg.getMemberStatuses().replace(sender.getID(), MessageStatus.READ);
|
||||
writeProxy.writeMessageStatusChange(new GroupMessageStatusChange(gmsg.getID(), MessageStatus.READ, Instant.now(), sender.getID()));
|
||||
}
|
||||
}
|
||||
unreadAmount = 0;
|
||||
|
@ -22,7 +22,7 @@ import envoy.util.SerializationUtils;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Client v0.2-alpha
|
||||
*/
|
||||
public class Settings {
|
||||
public final class Settings {
|
||||
|
||||
// Actual settings accessible by the rest of the application
|
||||
private Map<String, SettingsItem<?>> items;
|
||||
@ -139,7 +139,9 @@ public class Settings {
|
||||
* before
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public void setDownloadSavedWithoutAsking(boolean autosaveDownload) { ((SettingsItem<Boolean>) items.get("autoSaveDownloads")).set(autosaveDownload); }
|
||||
public void setDownloadSavedWithoutAsking(boolean autosaveDownload) {
|
||||
((SettingsItem<Boolean>) items.get("autoSaveDownloads")).set(autosaveDownload);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the path where downloads should be saved
|
||||
|
@ -17,7 +17,7 @@ import javax.swing.JComponent;
|
||||
* @author Kai S. K. Engelbart
|
||||
* @since Envoy Client v0.3-alpha
|
||||
*/
|
||||
public class SettingsItem<T> implements Serializable {
|
||||
public final class SettingsItem<T> implements Serializable {
|
||||
|
||||
private T value;
|
||||
private String userFriendlyName, description;
|
||||
|
@ -24,7 +24,7 @@ import java.util.function.Supplier;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public class SystemCommand implements OnCall {
|
||||
public final class SystemCommand implements OnCall {
|
||||
|
||||
protected int relevance;
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.function.Consumer;
|
||||
* @author Leon Hofmeister
|
||||
* @since Envoy Client v0.2-beta
|
||||
*/
|
||||
public class SystemCommandBuilder {
|
||||
public final class SystemCommandBuilder {
|
||||
|
||||
private int numberOfArguments;
|
||||
private Consumer<List<String>> action;
|
||||
|
Reference in New Issue
Block a user