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 <T> PropertyBuilder.ArrayPropertyBuilder<T> |
arrayProperty(@NotNull PropertyType<T> type,
@NotNull IntFunction<T[]> arrayProducer) |
static <T> PropertyBuilder.InlineArrayPropertyBuilder<T> |
inlineArrayProperty(@NotNull InlineArrayConverter<T> inlineConverter) |
static <T> PropertyBuilder.ListPropertyBuilder<T> |
listProperty(@NotNull PropertyType<T> type) |
static <T> PropertyBuilder.MapPropertyBuilder<T> |
mapProperty(@NotNull PropertyType<T> type) |
static <B> @NotNull BeanProperty<B> |
newBeanProperty(@NotNull Class<B> beanClass,
@NotNull String path,
B defaultValue)
Creates a new bean property.
|
static @NotNull StringListProperty |
newListProperty(@NotNull String path,
@NotNull List<String> defaultValues)
Creates a new String list property.
|
static @NotNull StringListProperty |
newListProperty(@NotNull String path,
String... defaultValues)
Creates a new String list property.
|
static @NotNull LowercaseStringSetProperty |
newLowercaseStringSetProperty(@NotNull String path,
@NotNull Collection<String> defaultValues)
Creates a new String set property where all values are lowercase.
|
static @NotNull LowercaseStringSetProperty |
newLowercaseStringSetProperty(@NotNull String path,
String... defaultValues)
Creates a new String set property where all values are lowercase.
|
static <E extends Enum<E>> |
newProperty(@NotNull Class<E> clazz,
@NotNull String path,
E defaultValue)
Creates a new enum property.
|
static @NotNull BooleanProperty |
newProperty(@NotNull String path,
boolean defaultValue)
Creates a new boolean property.
|
static @NotNull DoubleProperty |
newProperty(@NotNull String path,
double defaultValue)
Creates a new double property.
|
static @NotNull FloatProperty |
newProperty(@NotNull String path,
float defaultValue)
Creates a new float property.
|
static @NotNull IntegerProperty |
newProperty(@NotNull String path,
int defaultValue)
Creates a new integer property.
|
static @NotNull LongProperty |
newProperty(@NotNull String path,
long defaultValue)
Creates a new long property.
|
static @NotNull ShortProperty |
newProperty(@NotNull String path,
short defaultValue)
Creates a new short property.
|
static @NotNull StringProperty |
newProperty(@NotNull String path,
@NotNull String defaultValue)
Creates a new String property.
|
static @NotNull RegexProperty |
newRegexProperty(@NotNull String path,
@NotNull Pattern defaultRegexValue)
Creates a new regex pattern property.
|
static @NotNull RegexProperty |
newRegexProperty(@NotNull String path,
@NotNull String defaultRegexValue)
Creates a new regex pattern property.
|
static @NotNull StringSetProperty |
newSetProperty(@NotNull String path,
@NotNull Set<String> defaultValues)
Creates a new String set property.
|
static @NotNull StringSetProperty |
newSetProperty(@NotNull String path,
String... defaultValues)
Creates a new String set property.
|
static @NotNull OptionalProperty<Boolean> |
optionalBooleanProperty(@NotNull String path) |
static @NotNull OptionalProperty<Double> |
optionalDoubleProperty(@NotNull String path) |
static <E extends Enum<E>> |
optionalEnumProperty(@NotNull Class<E> clazz,
@NotNull String path) |
static @NotNull OptionalProperty<Float> |
optionalFloatProperty(@NotNull String path) |
static @NotNull OptionalProperty<Integer> |
optionalIntegerProperty(@NotNull String path) |
static @NotNull OptionalProperty<List<String>> |
optionalListProperty(@NotNull String path) |
static @NotNull OptionalProperty<Long> |
optionalLongProperty(@NotNull String path) |
static @NotNull OptionalProperty<Pattern> |
optionalRegexProperty(@NotNull String path) |
static @NotNull OptionalProperty<Set<String>> |
optionalSetProperty(@NotNull String path) |
static @NotNull OptionalProperty<Short> |
optionalShortProperty(@NotNull String path) |
static @NotNull OptionalProperty<String> |
optionalStringProperty(@NotNull String path) |
static <T> PropertyBuilder.SetPropertyBuilder<T> |
setProperty(@NotNull PropertyType<T> type) |
static <T> PropertyBuilder.TypeBasedPropertyBuilder<T> |
typeBasedProperty(@NotNull PropertyType<T> type) |
@NotNull public static @NotNull BooleanProperty newProperty(@NotNull @NotNull String path, boolean defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static @NotNull ShortProperty newProperty(@NotNull @NotNull String path, short defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static @NotNull IntegerProperty newProperty(@NotNull @NotNull String path, int defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static @NotNull LongProperty newProperty(@NotNull @NotNull String path, long defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static @NotNull FloatProperty newProperty(@NotNull @NotNull String path, float defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static @NotNull DoubleProperty newProperty(@NotNull @NotNull String path, double defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static @NotNull StringProperty newProperty(@NotNull @NotNull String path, @NotNull @NotNull String defaultValue)
path - the property's pathdefaultValue - the default value@NotNull public static <E extends Enum<E>> @NotNull EnumProperty<E> newProperty(@NotNull @NotNull Class<E> clazz, @NotNull @NotNull String path, @NotNull E defaultValue)
E - the enum typeclazz - the enum classpath - the property's pathdefaultValue - the default value@NotNull public static @NotNull RegexProperty newRegexProperty(@NotNull @NotNull String path, @NotNull @NotNull String defaultRegexValue)
path - the property's pathdefaultRegexValue - the default pattern of the property@NotNull public static @NotNull RegexProperty newRegexProperty(@NotNull @NotNull String path, @NotNull @NotNull Pattern defaultRegexValue)
path - the property's pathdefaultRegexValue - the default pattern of the property@NotNull public static @NotNull StringListProperty newListProperty(@NotNull @NotNull String path, @NotNull String... defaultValues)
path - the property's pathdefaultValues - the items in the default list@NotNull public static @NotNull StringListProperty newListProperty(@NotNull @NotNull String path, @NotNull @NotNull List<String> defaultValues)
path - the property's pathdefaultValues - the default value of the property@NotNull public static @NotNull StringSetProperty newSetProperty(@NotNull @NotNull String path, @NotNull String... defaultValues)
path - the property's pathdefaultValues - the items in the default set@NotNull public static @NotNull StringSetProperty newSetProperty(@NotNull @NotNull String path, @NotNull @NotNull Set<String> defaultValues)
path - the property's pathdefaultValues - the default value of the property@NotNull public static @NotNull LowercaseStringSetProperty newLowercaseStringSetProperty(@NotNull @NotNull String path, @NotNull String... defaultValues)
path - the property's pathdefaultValues - the items in the default set@NotNull public static @NotNull LowercaseStringSetProperty newLowercaseStringSetProperty(@NotNull @NotNull String path, @NotNull @NotNull Collection<String> defaultValues)
path - the property's pathdefaultValues - the default value of the property@NotNull public static <B> @NotNull BeanProperty<B> newBeanProperty(@NotNull @NotNull Class<B> beanClass, @NotNull @NotNull String path, @NotNull B defaultValue)
B - the bean typebeanClass - the JavaBean classpath - the property's pathdefaultValue - default value@NotNull public static <T> PropertyBuilder.TypeBasedPropertyBuilder<T> typeBasedProperty(@NotNull @NotNull PropertyType<T> type)
@NotNull public static <T> PropertyBuilder.ListPropertyBuilder<T> listProperty(@NotNull @NotNull PropertyType<T> type)
@NotNull public static <T> PropertyBuilder.SetPropertyBuilder<T> setProperty(@NotNull @NotNull PropertyType<T> type)
@NotNull public static <T> PropertyBuilder.MapPropertyBuilder<T> mapProperty(@NotNull @NotNull PropertyType<T> type)
@NotNull public static <T> PropertyBuilder.ArrayPropertyBuilder<T> arrayProperty(@NotNull @NotNull PropertyType<T> type, @NotNull @NotNull IntFunction<T[]> arrayProducer)
@NotNull public static <T> PropertyBuilder.InlineArrayPropertyBuilder<T> inlineArrayProperty(@NotNull @NotNull InlineArrayConverter<T> inlineConverter)
@NotNull public static @NotNull OptionalProperty<Boolean> optionalBooleanProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Short> optionalShortProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Integer> optionalIntegerProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Long> optionalLongProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Float> optionalFloatProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Double> optionalDoubleProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<String> optionalStringProperty(@NotNull @NotNull String path)
@NotNull public static <E extends Enum<E>> @NotNull OptionalProperty<E> optionalEnumProperty(@NotNull @NotNull Class<E> clazz, @NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Pattern> optionalRegexProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<List<String>> optionalListProperty(@NotNull @NotNull String path)
@NotNull public static @NotNull OptionalProperty<Set<String>> optionalSetProperty(@NotNull @NotNull String path)
Copyright © 2016–2023 The AuthMe Team. All rights reserved.