diff options
author | Dico Karssiens <dico.karssiens@gmail.com> | 2019-01-10 18:52:51 +0000 |
---|---|---|
committer | Dico Karssiens <dico.karssiens@gmail.com> | 2019-01-10 18:52:51 +0000 |
commit | 37fa1f9bbfc852dfa67862cde3d11a4e5415db11 (patch) | |
tree | 9350ab43d11b294cd7218fec3b61fa83ea3beda8 /dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java | |
parent | d80f69488656485a8b93b4982e678ed62c5df96b (diff) | |
parent | 778e301efc09eb8326146a084bb6788be748e6f1 (diff) |
Diffstat (limited to 'dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java')
-rw-r--r-- | dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java b/dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java index 868884c..7983997 100644 --- a/dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java +++ b/dicore3/command/src/main/java/io/dico/dicore/command/annotation/CommandAnnotationUtils.java @@ -1,35 +1,35 @@ -package io.dico.dicore.command.annotation; - -public class CommandAnnotationUtils { - - /** - * Get the short description from a {@link Desc} annotation. - * If {@link Desc#shortVersion()} is given, returns that. - * Otherwise, returns the first element of {@link Desc#value()} - * If neither is available, returns null. - * - * @param desc the annotation - * @return the short description - */ - public static String getShortDescription(Desc desc) { - String descString; - if (desc == null) { - descString = null; - } else if (!desc.shortVersion().isEmpty()) { - descString = desc.shortVersion(); - } else if (desc.value().length > 0) { - descString = desc.value()[0]; - if (desc.value().length > 1) { - //System.out.println("[Command Warning] Multiline descriptions not supported here. Keep it short for: " + targetIdentifier); - } - if (descString != null && descString.isEmpty()) { - descString = null; - } - } else { - descString = null; - } - - return descString; - } - -} +package io.dico.dicore.command.annotation;
+
+public class CommandAnnotationUtils {
+
+ /**
+ * Get the short description from a {@link Desc} annotation.
+ * If {@link Desc#shortVersion()} is given, returns that.
+ * Otherwise, returns the first element of {@link Desc#value()}
+ * If neither is available, returns null.
+ *
+ * @param desc the annotation
+ * @return the short description
+ */
+ public static String getShortDescription(Desc desc) {
+ String descString;
+ if (desc == null) {
+ descString = null;
+ } else if (!desc.shortVersion().isEmpty()) {
+ descString = desc.shortVersion();
+ } else if (desc.value().length > 0) {
+ descString = desc.value()[0];
+ if (desc.value().length > 1) {
+ //System.out.println("[Command Warning] Multiline descriptions not supported here. Keep it short for: " + targetIdentifier);
+ }
+ if (descString != null && descString.isEmpty()) {
+ descString = null;
+ }
+ } else {
+ descString = null;
+ }
+
+ return descString;
+ }
+
+}
|