private static class FieldWrapper.MapWrapper extends FieldWrapper
FieldWrapper.BeanEntry<K,V>
Modifier and Type | Field and Description |
---|---|
(package private) ITypeAdapter |
adapter |
private java.lang.String |
baseName |
private java.lang.reflect.Type |
mType |
private java.util.Map<java.lang.String,java.lang.Object> |
theMap |
category, field, instance, name
Modifier | Constructor and Description |
---|---|
private |
MapWrapper(java.lang.String category,
java.lang.reflect.Field field,
java.lang.Object instance) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCategory()
i.e.
|
java.lang.String[] |
getKeys() |
private java.lang.String |
getSuffix(java.lang.String key)
Removes the
this.baseName prefix from the key |
ITypeAdapter |
getTypeAdapter() |
java.lang.Object |
getValue(java.lang.String key) |
boolean |
handlesKey(java.lang.String key) |
boolean |
hasKey(java.lang.String key) |
void |
setupConfiguration(Configuration cfg,
java.lang.String desc,
java.lang.String langKey,
boolean reqMCRestart,
boolean reqWorldRestart) |
void |
setupConfiguration(Configuration cfg,
java.lang.String desc,
java.lang.String langKey,
boolean reqMCRestart,
boolean reqWorldRestart,
boolean hasSlidingControl) |
void |
setValue(java.lang.String key,
java.lang.Object value) |
get, hasWrapperFor
private java.util.Map<java.lang.String,java.lang.Object> theMap
private java.lang.reflect.Type mType
private final java.lang.String baseName
ITypeAdapter adapter
private MapWrapper(java.lang.String category, java.lang.reflect.Field field, java.lang.Object instance)
public ITypeAdapter getTypeAdapter()
public java.lang.String[] getKeys()
public java.lang.Object getValue(java.lang.String key)
key
- the fully qualified property keypublic void setValue(java.lang.String key, java.lang.Object value)
key
- the fully qualified property keyvalue
- the target value of the property associated with the keypublic boolean hasKey(java.lang.String key)
key
- a fully qualified property keypublic boolean handlesKey(java.lang.String key)
key
- a fully qualified property keypublic void setupConfiguration(Configuration cfg, java.lang.String desc, java.lang.String langKey, boolean reqMCRestart, boolean reqWorldRestart)
public void setupConfiguration(Configuration cfg, java.lang.String desc, java.lang.String langKey, boolean reqMCRestart, boolean reqWorldRestart, boolean hasSlidingControl)
cfg
- The configuration object holding the propertiesdesc
- The properties descriptionlangKey
- The languageKey of the property, used in GUIreqMCRestart
- True, if a change in this property requires a restart of MinecraftreqWorldRestart
- True, if the world needs to be reloaded after changes to this propertyhasSlidingControl
- true if the property is going to have a slider control attached in the configuration UI;
works in conjunction with Config.RangeInt
and Config.RangeDouble
public java.lang.String getCategory()
IFieldWrapper
private java.lang.String getSuffix(java.lang.String key)
this.baseName
prefix from the keykey
- the key to be edited