Package cloud.commandframework.meta
Class SimpleCommandMeta
- java.lang.Object
-
- cloud.commandframework.meta.CommandMeta
-
- cloud.commandframework.meta.SimpleCommandMeta
-
public class SimpleCommandMeta extends CommandMeta
A simple immutable string-string map containing command meta
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleCommandMeta.BuilderBuilder forSimpleCommandMeta-
Nested classes/interfaces inherited from class cloud.commandframework.meta.CommandMeta
CommandMeta.Key<V>
-
-
Field Summary
-
Fields inherited from class cloud.commandframework.meta.CommandMeta
DESCRIPTION, HIDDEN, LONG_DESCRIPTION
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleCommandMeta(@NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String> metaMap)Deprecated.protectedSimpleCommandMeta(SimpleCommandMeta source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static @NonNull SimpleCommandMeta.Builderbuilder()Create a new meta builderstatic @NonNull SimpleCommandMetaempty()Create an empty simple command meta instancebooleanequals(java.lang.Object other)<V> @NonNull java.util.Optional<V>get(@NonNull CommandMeta.Key<V> key)Get the value associated with a key.@NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String>getAll()Deprecated.@NonNull java.util.Map<@NonNull java.lang.String,?>getAllValues()Get a copy of the meta map, without type information.<V> @NonNull VgetOrDefault(@NonNull CommandMeta.Key<V> key, @NonNull V defaultValue)Get the value if it exists, else return the default value.@NonNull java.lang.StringgetOrDefault(@NonNull java.lang.String key, @NonNull java.lang.String defaultValue)Deprecated.@NonNull java.util.Optional<java.lang.String>getValue(@NonNull java.lang.String key)Deprecated.inthashCode()-
Methods inherited from class cloud.commandframework.meta.CommandMeta
simple, toString
-
-
-
-
Constructor Detail
-
SimpleCommandMeta
@Deprecated protected SimpleCommandMeta(@NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String> metaMap)
Deprecated.
-
SimpleCommandMeta
protected SimpleCommandMeta(SimpleCommandMeta source)
-
-
Method Detail
-
builder
public static @NonNull SimpleCommandMeta.Builder builder()
Create a new meta builder- Returns:
- Builder instance
-
empty
public static @NonNull SimpleCommandMeta empty()
Create an empty simple command meta instance- Returns:
- Empty instance
-
getValue
@Deprecated public final @NonNull java.util.Optional<java.lang.String> getValue(@NonNull java.lang.String key)
Deprecated.Description copied from class:CommandMetaGet the value associated with a key- Specified by:
getValuein classCommandMeta- Parameters:
key- Key- Returns:
- Optional that may contain the associated value
-
getOrDefault
@Deprecated public final @NonNull java.lang.String getOrDefault(@NonNull java.lang.String key, @NonNull java.lang.String defaultValue)Deprecated.Description copied from class:CommandMetaGet the value if it exists, else return the default value- Specified by:
getOrDefaultin classCommandMeta- Parameters:
key- KeydefaultValue- Default value- Returns:
- Value, or default value
-
get
public final <V> @NonNull java.util.Optional<V> get(@NonNull CommandMeta.Key<V> key)
Description copied from class:CommandMetaGet the value associated with a key.- Specified by:
getin classCommandMeta- Type Parameters:
V- Value type- Parameters:
key- Key- Returns:
- Optional that may contain the associated value
-
getOrDefault
public final <V> @NonNull V getOrDefault(@NonNull CommandMeta.Key<V> key, @NonNull V defaultValue)
Description copied from class:CommandMetaGet the value if it exists, else return the default value.- Specified by:
getOrDefaultin classCommandMeta- Type Parameters:
V- Value type- Parameters:
key- KeydefaultValue- Default value- Returns:
- Value, or default value
-
getAll
@Deprecated public final @NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String> getAll()
Deprecated.Description copied from class:CommandMetaGet a copy of the meta map- Specified by:
getAllin classCommandMeta- Returns:
- Copy of meta map
-
getAllValues
public final @NonNull java.util.Map<@NonNull java.lang.String,?> getAllValues()
Description copied from class:CommandMetaGet a copy of the meta map, without type information.- Specified by:
getAllValuesin classCommandMeta- Returns:
- Copy of meta map
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-