public abstract class Property<T> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Property(String path,
T defaultValue) |
| Modifier and Type | Method and Description |
|---|---|
T |
getDefaultValue()
Returns the default value of the property.
|
protected abstract T |
getFromResource(PropertyResource resource) |
String |
getPath()
Returns the property path.
|
T |
getValue(PropertyResource resource)
Gets the property value from the given resource and falls back to the default value if not present.
|
boolean |
isPresent(PropertyResource resource)
Returns whether or not the given resource contains the property.
|
String |
toString() |
public T getValue(PropertyResource resource)
resource - the property resource@Nullable protected abstract T getFromResource(PropertyResource resource)
public boolean isPresent(PropertyResource resource)
resource - the property resource to checkpublic T getDefaultValue()
public String getPath()
Copyright © 2016–2018 The AuthMe Team. All rights reserved.