Package cloud.commandframework.meta
Class CommandMeta
- java.lang.Object
-
- cloud.commandframework.meta.CommandMeta
-
- Direct Known Subclasses:
SimpleCommandMeta
public abstract class CommandMeta extends java.lang.ObjectObject that is associated with aCommand. Command meta should not be mutable, as one fixed instance will be used per command.Appropriate use for command meta would be fixed state, such as command descriptions.
-
-
Constructor Summary
Constructors Constructor Description CommandMeta()
-
Method Summary
Modifier and Type Method Description abstract @NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String>getAll()Get a copy of the meta mapabstract @NonNull java.lang.StringgetOrDefault(@NonNull java.lang.String key, @NonNull java.lang.String defaultValue)Get the value if it exists, else return the default valueabstract @NonNull java.util.Optional<java.lang.String>getValue(@NonNull java.lang.String key)Get the value associated with a keystatic @NonNull SimpleCommandMeta.Buildersimple()Create a new simple command meta builder@NonNull java.lang.StringtoString()
-
-
-
Method Detail
-
simple
public static @NonNull SimpleCommandMeta.Builder simple()
Create a new simple command meta builder- Returns:
- Builder instance
-
toString
public final @NonNull java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getValue
public abstract @NonNull java.util.Optional<java.lang.String> getValue(@NonNull java.lang.String key)
Get the value associated with a key- Parameters:
key- Key- Returns:
- Optional that may contain the associated value
-
getOrDefault
public abstract @NonNull java.lang.String getOrDefault(@NonNull java.lang.String key, @NonNull java.lang.String defaultValue)Get the value if it exists, else return the default value- Parameters:
key- KeydefaultValue- Default value- Returns:
- Value, or default value
-
getAll
public abstract @NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String> getAll()
Get a copy of the meta map- Returns:
- Copy of meta map
-
-