public static class PacketContent.ContentModifier<T> extends Object
| Constructor and Description |
|---|
ContentModifier(Object obj,
@Nullable Class<?> clazz) |
| Modifier and Type | Method and Description |
|---|---|
HashMap<Field,T> |
getContent()
Get field which her value
|
T |
read(int i)
Read the specified value.
|
T |
read(String fieldName)
Get the value of the field which is named by the given one
|
T |
read(String fieldName,
T defaultValue)
Get the value of the field which is named by the given one
|
T |
readSafely(int i)
Read the specified value.
|
T |
readSafely(int i,
T defaultValue)
Read the specified value.
|
int |
size()
Get the size of the Map of content
|
void |
write(int i,
T value)
Set the value in the specified object.
|
public int size()
public T read(String fieldName)
fieldName - the name of the needed fieldpublic T read(String fieldName, T defaultValue)
fieldName - the name of the needed fielddefaultValue - the returned value if there is no valuepublic T read(int i)
i - the number of the value to get getted. Start at 0.NoSuchElementException - if the value doesn't existpublic T readSafely(int i)
i - the number of the value to get getted. Start at 0.public T readSafely(int i, T defaultValue)
i - the number of the value to get getted. Start at 0.defaultValue - the value which is return if the key doesn't existpublic void write(int i,
T value)
i - the key of the value to setvalue - the new value which will be set