public class SimpleArgument<T> extends java.lang.Object implements MutableArgument<T>
| Modifier | Constructor and Description |
|---|---|
|
SimpleArgument(java.lang.String name,
TypeToken<T> type) |
protected |
SimpleArgument(java.lang.String name,
TypeToken<T> type,
@Nullable Argument<?> pattern) |
|
SimpleArgument(java.lang.String name,
TypeToken<T> type,
boolean nullable) |
| Modifier and Type | Method and Description |
|---|---|
<P extends ArgumentProfile<P>> |
addProfile(P profile) |
<NEW> Argument<NEW> |
child(TypeToken<NEW> type)
Create a child of the current argument.
|
boolean |
equals(java.lang.Object o) |
java.util.Optional<ParseResult<T>> |
getDefaultValue() |
ArgumentKey |
getKey() |
java.lang.String |
getName() |
<P> java.util.Optional<P> |
getProfile(ArgumentProfileNamespace<P> key) |
PrioritizedList<ArgumentProfile<?>> |
getProfiles() |
TypeToken<T> |
getType() |
boolean |
hasDefaultValue() |
int |
hashCode() |
Meta |
meta() |
@Nullable MetaHolder |
parentMeta() |
void |
setKey(ArgumentKey key) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitdefaultValue, of, of, of, of, profiled, profiledempty, metaCollectorprotected SimpleArgument(java.lang.String name,
TypeToken<T> type,
@Nullable
@Nullable Argument<?> pattern)
public java.lang.String getName()
public ArgumentKey getKey()
public void setKey(ArgumentKey key)
setKey in interface MutableArgument<T>public TypeToken<T> getType()
getType in interface Requirement<T>public Meta meta()
meta in interface MetaHolder@Nullable public @Nullable MetaHolder parentMeta()
parentMeta in interface MetaHolderpublic java.util.Optional<ParseResult<T>> getDefaultValue()
getDefaultValue in interface Argument<T>public boolean hasDefaultValue()
hasDefaultValue in interface Argument<T>@ApiStatus.Experimental public <P extends ArgumentProfile<P>> SimpleArgument<T> addProfile(P profile)
addProfile in interface MutableArgument<T>@ApiStatus.Experimental public <P> java.util.Optional<P> getProfile(ArgumentProfileNamespace<P> key)
getProfile in interface Argument<T>public PrioritizedList<ArgumentProfile<?>> getProfiles()
getProfiles in interface Argument<T>public <NEW> Argument<NEW> child(TypeToken<NEW> type)
Argumentpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object