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 class
SimpleCommandMeta.Builder
Builder 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 protected
SimpleCommandMeta(@NonNull java.util.Map<@NonNull java.lang.String,@NonNull java.lang.String> metaMap)
Deprecated.protected
SimpleCommandMeta(SimpleCommandMeta source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static @NonNull SimpleCommandMeta.Builder
builder()
Create a new meta builderstatic @NonNull SimpleCommandMeta
empty()
Create an empty simple command meta instanceboolean
equals(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 V
getOrDefault(@NonNull CommandMeta.Key<V> key, @NonNull V defaultValue)
Get the value if it exists, else return the default value.@NonNull java.lang.String
getOrDefault(@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.int
hashCode()
-
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:CommandMeta
Get the value associated with a key- Specified by:
getValue
in 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:CommandMeta
Get the value if it exists, else return the default value- Specified by:
getOrDefault
in 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:CommandMeta
Get the value associated with a key.- Specified by:
get
in 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:CommandMeta
Get the value if it exists, else return the default value.- Specified by:
getOrDefault
in 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:CommandMeta
Get a copy of the meta map- Specified by:
getAll
in classCommandMeta
- Returns:
- Copy of meta map
-
getAllValues
public final @NonNull java.util.Map<@NonNull java.lang.String,?> getAllValues()
Description copied from class:CommandMeta
Get a copy of the meta map, without type information.- Specified by:
getAllValues
in classCommandMeta
- Returns:
- Copy of meta map
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-