public class PropertyBuilder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
PropertyBuilder |
blankIfUnexpandable(boolean blankIfUnexpandable)
Set blankIfUnexpandable
|
PropertyBuilder |
booleanType(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#Boolean |
Property |
build()
Build the Property object
|
static PropertyBuilder |
builder() |
static PropertyBuilder |
builder(Property orig)
Return a new instance preconfigured with a previously defined Property
|
PropertyBuilder |
defaultValue(java.lang.String value)
Set the default value
|
PropertyBuilder |
description(java.lang.String description)
Set the description
|
PropertyBuilder |
dynamicValues(boolean dynamicValues) |
PropertyBuilder |
freeSelect(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#FreeSelect |
Property.Type |
getType() |
PropertyBuilder |
integer(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#Integer |
PropertyBuilder |
labels(java.util.Map<java.lang.String,java.lang.String> labels)
Set the select labels
|
PropertyBuilder |
longType(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#Long |
PropertyBuilder |
name(java.lang.String name)
Set the name (identifier)
|
PropertyBuilder |
options(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#Select |
PropertyBuilder |
renderingAsPassword()
Set the string property to display as a Password.
|
PropertyBuilder |
renderingAsTextarea()
Set the string property to display as a Multi-line Text area.
|
PropertyBuilder |
renderingOption(java.lang.String optionKey,
java.lang.Object optionValue)
Adds the given renderingOption
|
PropertyBuilder |
renderingOptions(java.util.Map<java.lang.String,java.lang.Object> renderingOptions)
Adds all rendering options from the given renderingOptions
|
PropertyBuilder |
required(boolean required)
Set required
|
PropertyBuilder |
scope(PropertyScope scope)
Set the property scope
|
PropertyBuilder |
select(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#Select |
PropertyBuilder |
string(java.lang.String name)
Return a new PropertyBuilder of type
Property.Type#String |
PropertyBuilder |
title(java.lang.String title)
Set the title (display name)
|
PropertyBuilder |
type(Property.Type type)
Set the type
|
PropertyBuilder |
validator(PropertyValidator validator)
Set the property validator, only applies to String, Integer, Long, and FreeSelect types
|
PropertyBuilder |
values(java.util.List<java.lang.String> values)
Set the select values
|
PropertyBuilder |
values(java.lang.String... values)
Set the select values
|
public static PropertyBuilder builder()
public static PropertyBuilder builder(Property orig)
orig
- original propertypublic PropertyBuilder string(java.lang.String name)
Property.Type#String
name
- namepublic PropertyBuilder booleanType(java.lang.String name)
Property.Type#Boolean
name
- namepublic PropertyBuilder integer(java.lang.String name)
Property.Type#Integer
name
- namepublic PropertyBuilder longType(java.lang.String name)
Property.Type#Long
name
- namepublic PropertyBuilder select(java.lang.String name)
Property.Type#Select
name
- namepublic PropertyBuilder options(java.lang.String name)
Property.Type#Select
name
- namepublic PropertyBuilder freeSelect(java.lang.String name)
Property.Type#FreeSelect
name
- namepublic PropertyBuilder type(Property.Type type)
type
- typepublic PropertyBuilder name(java.lang.String name)
name
- namepublic PropertyBuilder title(java.lang.String title)
title
- titlepublic PropertyBuilder description(java.lang.String description)
description
- descriptionpublic PropertyBuilder required(boolean required)
required
- true if requiredpublic PropertyBuilder blankIfUnexpandable(boolean blankIfUnexpandable)
blankIfUnexpandable
- true if unexpanded variables get replaced with blankspublic PropertyBuilder defaultValue(java.lang.String value)
value
- valuepublic PropertyBuilder values(java.util.List<java.lang.String> values)
values
- valuespublic PropertyBuilder labels(java.util.Map<java.lang.String,java.lang.String> labels)
labels
- map of value to labelpublic PropertyBuilder values(java.lang.String... values)
values
- valuespublic PropertyBuilder validator(PropertyValidator validator)
validator
- validatorpublic PropertyBuilder scope(PropertyScope scope)
scope
- scopepublic PropertyBuilder renderingOptions(java.util.Map<java.lang.String,java.lang.Object> renderingOptions)
renderingOptions
- optionsStringRenderingConstants
public PropertyBuilder dynamicValues(boolean dynamicValues)
public PropertyBuilder renderingOption(java.lang.String optionKey, java.lang.Object optionValue)
optionKey
- keyoptionValue
- valueStringRenderingConstants
public PropertyBuilder renderingAsTextarea()
java.lang.IllegalStateException
- if the property type is not Property.Type#String
public PropertyBuilder renderingAsPassword()
java.lang.IllegalStateException
- if the property type is not Property.Type#String
public Property build()
java.lang.IllegalStateException
- if type or name is not setpublic Property.Type getType()