This commit is contained in:
CocoTheOwner 2021-08-15 21:47:50 +02:00
parent a8449de731
commit aaccfdee44
2 changed files with 3 additions and 5 deletions

View File

@ -79,11 +79,11 @@ public class DecreeParameter {
} }
public Object getDefaultValue() throws DecreeParsingException, DecreeWhichException { public Object getDefaultValue() throws DecreeParsingException, DecreeWhichException {
return param.defaultValue().equals(Param.REQUIRED) ? null : getHandler().parse(param.defaultValue()); return param.defaultValue().trim().isEmpty() ? null : getHandler().parse(param.defaultValue().trim());
} }
public boolean hasDefault() { public boolean hasDefault() {
return !param.defaultValue().equals(Param.REQUIRED); return !param.defaultValue().trim().isEmpty();
} }
public String example() { public String example() {

View File

@ -28,8 +28,6 @@ import java.lang.annotation.Target;
public @interface Param { public @interface Param {
String DEFAULT_DESCRIPTION = "No Description Provided"; String DEFAULT_DESCRIPTION = "No Description Provided";
String REQUIRED = "Required";
/** /**
* The main name of this command.<br> * The main name of this command.<br>
* Required parameter.<br> * Required parameter.<br>
@ -49,7 +47,7 @@ public @interface Param {
* Which indicates the variable MUST be defined by the person running the command.<br> * Which indicates the variable MUST be defined by the person running the command.<br>
* If you define this, the variable automatically becomes non-required, but can still be set. * If you define this, the variable automatically becomes non-required, but can still be set.
*/ */
String defaultValue() default REQUIRED; String defaultValue() default "";
/** /**
* The aliases of this parameter (instead of just the {@link #name() name} (if specified) or Method Name (name of method))<br> * The aliases of this parameter (instead of just the {@link #name() name} (if specified) or Method Name (name of method))<br>