A
- the kind of value this factory handlespublic class ConstantPropertyFactory<A> extends Object implements PropertyFactory<A>
PropertyFactory
that always returns the same value.Constructor and Description |
---|
ConstantPropertyFactory(A value)
Creates a new factory.
|
Modifier and Type | Method and Description |
---|---|
A |
getDefault(PropertyKey<A> key)
Asks for the default value that should be used if no
DockProperties
are available. |
A |
getDefault(PropertyKey<A> key,
DockProperties properties)
Gets the default value for
key . |
public ConstantPropertyFactory(A value)
value
- the value this factory returns, can be null
public A getDefault(PropertyKey<A> key, DockProperties properties)
PropertyFactory
key
. This method is called
only once for the combination of key
and properties
,
it can either always return the same object or create a new one every
time. The results gets stored as default value in properties
.getDefault
in interface PropertyFactory<A>
key
- the key for which to get the defaultproperties
- the map in which the default will be storednull
is validpublic A getDefault(PropertyKey<A> key)
PropertyFactory
DockProperties
are available.getDefault
in interface PropertyFactory<A>
key
- the key of the propertynull