public class PropertyInitializer extends Object
Property objects. You can use
a static import for the methods for a short, convenient way to declare properties.
If you use additional property types, it may make the most sense to write your own property initializer class similar to this one, or extend this class to keep the default methods.
| Modifier | Constructor and Description |
|---|---|
protected |
PropertyInitializer() |
| Modifier and Type | Method and Description |
|---|---|
static <B> Property<B> |
newBeanProperty(Class<B> beanClass,
String path,
B defaultValue)
Creates a new bean property.
|
static Property<List<String>> |
newListProperty(String path,
String... defaultValues)
Creates a new String list property.
|
static Property<List<String>> |
newLowercaseListProperty(String path,
String... defaultValues)
Creates a new String list property where all values are lowercase.
|
static <E extends Enum<E>> |
newProperty(Class<E> clazz,
String path,
E defaultValue)
Creates a new enum property.
|
static Property<Boolean> |
newProperty(String path,
boolean defaultValue)
Creates a new boolean property.
|
static Property<Integer> |
newProperty(String path,
int defaultValue)
Creates a new integer property.
|
static Property<String> |
newProperty(String path,
String defaultValue)
Creates a new String property.
|
static Property<Optional<Boolean>> |
optionalBooleanProperty(String path) |
static <E extends Enum<E>> |
optionalEnumProperty(Class<E> clazz,
String path) |
static Property<Optional<Integer>> |
optionalIntegerProperty(String path) |
static Property<Optional<String>> |
optionalStringProperty(String path) |
public static Property<Boolean> newProperty(String path, boolean defaultValue)
path - the property's pathdefaultValue - the default valuepublic static Property<Integer> newProperty(String path, int defaultValue)
path - the property's pathdefaultValue - the default valuepublic static Property<String> newProperty(String path, String defaultValue)
path - the property's pathdefaultValue - the default valuepublic static <E extends Enum<E>> Property<E> newProperty(Class<E> clazz, String path, E defaultValue)
E - the enum typeclazz - the enum classpath - the property's pathdefaultValue - the default valuepublic static Property<List<String>> newListProperty(String path, String... defaultValues)
path - the property's pathdefaultValues - the items in the default listpublic static Property<List<String>> newLowercaseListProperty(String path, String... defaultValues)
path - the property's pathdefaultValues - the items in the default listpublic static <B> Property<B> newBeanProperty(Class<B> beanClass, String path, B defaultValue)
B - the bean typebeanClass - the JavaBean classpath - the property's pathdefaultValue - default valuepublic static Property<Optional<Boolean>> optionalBooleanProperty(String path)
public static Property<Optional<Integer>> optionalIntegerProperty(String path)
Copyright © 2016–2018 The AuthMe Team. All rights reserved.