K - the PropertyType type the builder makes use ofT - the type of Property the builder producesB - builder extension (concrete class extending this builder)public abstract class PropertyBuilder<K,T,B extends PropertyBuilder<K,T,B>> extends Object
PropertyInitializer| Modifier and Type | Class and Description |
|---|---|
static class |
PropertyBuilder.ArrayPropertyBuilder<T>
Builder for
ArrayProperty. |
static interface |
PropertyBuilder.CreateFunction<K,T>
Function taking three arguments, which returns a property of the given type.
|
static class |
PropertyBuilder.InlineArrayPropertyBuilder<T>
Builder for
InlineArrayProperty. |
static class |
PropertyBuilder.ListPropertyBuilder<T>
Builder for
ListProperty. |
static class |
PropertyBuilder.MapPropertyBuilder<T>
Builder for
MapProperty. |
static class |
PropertyBuilder.SetPropertyBuilder<T>
Builder for
SetProperty. |
static class |
PropertyBuilder.TypeBasedPropertyBuilder<T>
Builder for
TypeBasedProperty. |
| Constructor and Description |
|---|
PropertyBuilder(@Nullable PropertyType<K> type)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract @NotNull Property<T> |
build()
Creates a property with the configured details.
|
B |
defaultValue(T defaultValue)
Sets the default of the property.
|
protected T |
getDefaultValue() |
protected @Nullable String |
getPath() |
protected @Nullable PropertyType<K> |
getType() |
B |
path(@NotNull String path)
Sets the path of the property.
|
public PropertyBuilder(@Nullable
@Nullable PropertyType<K> type)
type - the property type@NotNull public B path(@NotNull @NotNull String path)
path - the path@NotNull public B defaultValue(@NotNull T defaultValue)
defaultValue - the default value to set@NotNull public abstract @NotNull Property<T> build()
@Nullable protected final @Nullable String getPath()
@Nullable protected final T getDefaultValue()
@Nullable protected final @Nullable PropertyType<K> getType()
Copyright © 2016–2023 The AuthMe Team. All rights reserved.