Interface IOptions
- All Known Implementing Classes:
Options
public interface IOptions
Allows getting and setting options.
An attempt to reduce the God-class nature of Client.
- Author:
- David Ripton
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA callback interface for changes to the options. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(String optname, IOptions.Listener listener) Adds a listener to get callbacks for changes on the specified option.intgetIntOption(String optname) booleanbooleangetStringOption(String optname) voidremoveListener(IOptions.Listener listener) Removes the listener from all options it is subscribed to.voidvoidvoid
-
Method Details
-
addListener
Adds a listener to get callbacks for changes on the specified option. The listener should be called only on true changes, not if an option gets set to the value it has anyway. -
removeListener
Removes the listener from all options it is subscribed to. TODO there is a chance of leakage if classes subscribe to the options but never remove their listeners. -
getOption
-
getOption
-
getStringOption
-
getIntOption
-
setOption
-
setOption
-
setOption
-