public abstract static class Property.BaseProperty<T> extends Object implements Property<T>
Property.BaseProperty<T>, Property.BooleanProperty, Property.CharsetProperty, Property.DurationInSecondsProperty, Property.DurationProperty, Property.EnumProperty<T extends Enum<T>>, Property.IntegerProperty, Property.LongProperty, Property.ObjectProperty, Property.StringProperty, Property.Validating<T>
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Modifier | Constructor and Description |
---|---|
protected |
BaseProperty(String name,
Class<T> type) |
protected |
BaseProperty(String name,
Class<T> type,
T defaultValue) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
fromStorage(Object value) |
Optional<T> |
get(PropertyResolver resolver) |
Optional<T> |
getDefault() |
String |
getName() |
T |
getOrCustomDefault(PropertyResolver resolver,
T defaultValue) |
Class<T> |
getType() |
void |
set(PropertyResolver resolver,
T value) |
protected Object |
toStorage(T value) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bool, bool, charset, charset, duration, duration, duration, durationSec, durationSec, durationSec, enum_, enum_, getOrNull, getRequired, getRequiredDefault, integer, integer, long_, long_, object, object, remove, string, string, validating
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
public String getName()
getName
in interface NamedResource
public Optional<T> getDefault()
getDefault
in interface Property<T>
Optional
pre-defined default valuepublic Optional<T> get(PropertyResolver resolver)
public T getOrCustomDefault(PropertyResolver resolver, T defaultValue)
getOrCustomDefault
in interface Property<T>
resolver
- The PropertyResolver
to query for the property value.defaultValue
- The default value to return if no specific value found in resolverpublic void set(PropertyResolver resolver, T value)
set
in interface Property<T>
resolver
- The PropertyResolver
to update with the property value.value
- The value to setCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.