mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-09-20 15:04:23 +00:00
Removed unnecessary super interface
See: https://github.com/cryptomator/cryptomator/pull/1691#discussion_r650770011 Also fixes: https://github.com/cryptomator/cryptomator/pull/1691#discussion_r650769229
This commit is contained in:
@@ -1,23 +0,0 @@
|
|||||||
package org.cryptomator.common.settings;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
public interface AbstractInvalidSetting {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the corresponding issue URI of this setting.<br>
|
|
||||||
* The issue URI usually resolves to a page on the
|
|
||||||
* <a href="https://github.com/cryptomator/cryptomator/issues">Cryptomator Bugtracker.</a>
|
|
||||||
*
|
|
||||||
* @return the issue URI or {@code null} if none is provided.
|
|
||||||
*/
|
|
||||||
URI getIssueURI();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a (preferably localized) message, that helps the user understand the
|
|
||||||
* issue in their configuration and how to fix it.
|
|
||||||
*
|
|
||||||
* @return the non-null description of the issue.
|
|
||||||
*/
|
|
||||||
String getMessage();
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ import java.net.URI;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
public enum InvalidSetting implements AbstractInvalidSetting {
|
public enum InvalidSetting {
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -24,12 +24,23 @@ public enum InvalidSetting implements AbstractInvalidSetting {
|
|||||||
this(onDefaultTracker(issueId), Objects.requireNonNull(resourceKey));
|
this(onDefaultTracker(issueId), Objects.requireNonNull(resourceKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
|
* Returns the corresponding issue URI of this setting.<br>
|
||||||
|
* The issue URI usually resolves to a page on the
|
||||||
|
* <a href="https://github.com/cryptomator/cryptomator/issues">Cryptomator Bugtracker.</a>
|
||||||
|
*
|
||||||
|
* @return the issue URI or {@code null} if none is provided.
|
||||||
|
*/
|
||||||
public URI getIssueURI() {
|
public URI getIssueURI() {
|
||||||
return this.issue;
|
return this.issue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
|
* Returns a (preferably localized) message, that helps the user understand the
|
||||||
|
* issue in their configuration and how to fix it.
|
||||||
|
*
|
||||||
|
* @return the non-null description of the issue.
|
||||||
|
*/
|
||||||
public String getMessage() {
|
public String getMessage() {
|
||||||
if (!BUNDLE.containsKey(this.resourceKey)) {
|
if (!BUNDLE.containsKey(this.resourceKey)) {
|
||||||
return UNKNOWN_KEY_FORMAT.formatted(this.resourceKey);
|
return UNKNOWN_KEY_FORMAT.formatted(this.resourceKey);
|
||||||
|
|||||||
@@ -3,28 +3,28 @@ package org.cryptomator.common.settings;
|
|||||||
|
|
||||||
public class InvalidSettingException extends RuntimeException {
|
public class InvalidSettingException extends RuntimeException {
|
||||||
|
|
||||||
private final AbstractInvalidSetting reason;
|
private final InvalidSetting reason;
|
||||||
private final String additionalMessage;
|
private final String additionalMessage;
|
||||||
|
|
||||||
public InvalidSettingException(AbstractInvalidSetting reason) {
|
public InvalidSettingException(InvalidSetting reason) {
|
||||||
this(reason, null, null);
|
this(reason, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InvalidSettingException(AbstractInvalidSetting reason, String additionalMessage) {
|
public InvalidSettingException(InvalidSetting reason, String additionalMessage) {
|
||||||
this(reason, additionalMessage, null);
|
this(reason, additionalMessage, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InvalidSettingException(AbstractInvalidSetting reason, Throwable cause) {
|
public InvalidSettingException(InvalidSetting reason, Throwable cause) {
|
||||||
this(reason, null, cause);
|
this(reason, null, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InvalidSettingException(AbstractInvalidSetting reason, String additionalMessage, Throwable cause) {
|
public InvalidSettingException(InvalidSetting reason, String additionalMessage, Throwable cause) {
|
||||||
super(composeMessage(reason, additionalMessage), cause);
|
super(composeMessage(reason, additionalMessage), cause);
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
this.additionalMessage = additionalMessage;
|
this.additionalMessage = additionalMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AbstractInvalidSetting getReason() {
|
public InvalidSetting getReason() {
|
||||||
return this.reason;
|
return this.reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ public class InvalidSettingException extends RuntimeException {
|
|||||||
return this.additionalMessage;
|
return this.additionalMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String composeMessage(AbstractInvalidSetting reason, String additionalMessage) {
|
private static String composeMessage(InvalidSetting reason, String additionalMessage) {
|
||||||
if (additionalMessage == null) {
|
if (additionalMessage == null) {
|
||||||
return reason.getMessage();
|
return reason.getMessage();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user