java.lang.Object
de.agilecoders.wicket.jquery.CombinableConfig
de.agilecoders.wicket.jquery.AbstractConfig
- All Implemented Interfaces:
Config,Serializable,IClusterable
- Direct Known Subclasses:
MutableConfig
Base configuration class.
- Author:
- Michael Haitz
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()<T> booleanreturns true if given key is set to this configfinal <T> Treturns the value for the given key.protected final <T> Stringreturns the value as string according to given key.final booleanisEmpty()protected static <T> IKey<T>creates a new key.final <T> AbstractConfigputs a new config to the configuration map.final <T> Tremoves the given key (and its value) from configuration map.final Stringprotected ConfigModelWraps IModel<String> in ConfigModel to serialize it as simple String in the produced JSON.Methods inherited from class de.agilecoders.wicket.jquery.CombinableConfig
combine, withFallback
-
Constructor Details
-
AbstractConfig
protected AbstractConfig()Construct.
-
-
Method Details
-
toJsonString
- Returns:
- current configuration as json string
-
all
- Returns:
- an immutable view of all configurations
-
isEmpty
public final boolean isEmpty()- Returns:
- true, if no special configuration is set.
-
put
puts a new config to the configuration map. If given value is default value of key then it will be removed. This is necessary to keep the ui code small and clean. Also the given value type will be asserted byIKeyimplementation.- Parameters:
key- mandatory parametervalue- mandatory parameter- Returns:
- same instance for chaining
-
contains
Description copied from interface:Configreturns true if given key is set to this config- Parameters:
key- The key to check.- Returns:
- true if key exists.
-
remove
removes the given key (and its value) from configuration map.- Parameters:
key- the key to remove
-
getString
returns the value as string according to given key. If no value is set, the default value will be returned.- Parameters:
key- The key to read.- Returns:
- the value as string.
-
get
returns the value for the given key. If no value is set, the default value will be returned.- Parameters:
key- The key to read.- Returns:
- the value.
-
wrap
Wraps IModel<String> in ConfigModel to serialize it as simple String in the produced JSON.- Parameters:
model- The model to wrap.- Returns:
- A model that uses special Json serializer
-
newKey
creates a new key.- Parameters:
key- string representation of this keydefaultValue- The default value
-