Package games.stendhal.common
Class KeyedSlotUtil
java.lang.Object
games.stendhal.common.KeyedSlotUtil
utility methods for working with keyed slots
- Author:
- hendrik
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getKeyedSlot(SlotOwner slotOwner, String name, String key)
Get a keyed string value on a named slot.static RPObject
getKeyedSlotObject(SlotOwner slotOwner, String name)
Returns the single object of a "keyed slot".static boolean
setKeyedSlot(SlotOwner slotOwner, String name, String key, String value)
Set a keyed string value on a named slot.
-
Constructor Details
-
KeyedSlotUtil
public KeyedSlotUtil()
-
-
Method Details
-
getKeyedSlotObject
Returns the single object of a "keyed slot".- Parameters:
slotOwner
- the object owning the slotname
- name of key slot- Returns:
- object or
null
it does not exist
-
getKeyedSlot
Get a keyed string value on a named slot.- Parameters:
slotOwner
- the object owning the slotname
- The slot name.key
- The value key.- Returns:
- The keyed value of the slot, or
null
if not set.
-
setKeyedSlot
Set a keyed string value on a named slot.- Parameters:
slotOwner
- the object owning the slotname
- The slot name.key
- The value key.value
- The value to assign (or remove ifnull
).- Returns:
true
if value changed,false
if there was a problem.
-