public abstract class PropertyBuilderBase<B extends PropertyBuilderBase,P extends Property<T>,T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<Name> |
_aliases |
protected T |
_defaultValue |
protected String |
_helpText |
protected boolean |
_required |
protected String |
_shortDesc |
protected Trimmer |
_trimmer |
protected List<Validator<T>> |
_validators |
protected ValueType<T> |
_valueType |
protected B |
instance |
| Constructor and Description |
|---|
PropertyBuilderBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAlias(Name newAlias,
List<Name> addToList)
Used by public alias methods to actually add the Alias.
|
B |
aliasIn(String name)
Adds an alternate name for this property that will be recognized when a
Loader reads a property in from a source, such as JNDI or a properties file.
|
B |
aliasInAndOut(String name)
Adds an alternate name for this property that will both be recognized
when reading in properties and can be used when exporting properties.
|
B |
aliasOut(String name)
Adds an alternate name for this property that can be used if this
property is exported, such as exporting to System.properties.
|
abstract P |
build()
Build the Property instance.
|
B |
defaultValue(T defaultValue)
TODO: It would be nice to add a String version that can parse
|
B |
desc(String shortDesc)
Same as description
|
B |
description(String shortDesc) |
B |
helpText(String helpText) |
B |
required() |
protected void |
setInstance(B instance) |
B |
setRequired(boolean required) |
B |
trimmer(Trimmer trimmer)
Assigns the whitespace trimmer that is used on the raw value.
|
B |
validation(Validator<T> validator)
Adds a validation to the list of validators,
|
B |
validations(List<Validator<T>> validators)
Adds a list of Validators to the list of validators being built.
|
B |
valueType(ValueType<T> valueType)
This method should be called by subclasses.
|
protected B extends PropertyBuilderBase instance
protected Trimmer _trimmer
protected T _defaultValue
protected boolean _required
protected String _shortDesc
protected String _helpText
protected void setInstance(B instance)
public B valueType(ValueType<T> valueType)
valueType - public B trimmer(Trimmer trimmer)
trimmer - public B defaultValue(T defaultValue)
defaultValue - public B setRequired(boolean required)
public B required()
public B validation(Validator<T> validator)
validator - public B validations(List<Validator<T>> validators)
validators - public B aliasIn(String name)
;/?:@=&"<>>#%{}|\^~[]`name - public B aliasOut(String name)
;/?:@=&"<>#%{}|\^~[]`name - public B aliasInAndOut(String name)
;/?:@=&"<>#%{}|\^~[]`name - protected void addAlias(Name newAlias, List<Name> addToList)
newAlias - New alias to addaddToList - The list to add topublic abstract P build()
Copyright © 2017. All rights reserved.