T - the value type wrapped by this instancepublic class PropertyValue<T> extends Object
Property.determineValue(ch.jalu.configme.resource.PropertyReader). Wraps the value to associate with the property, along with a field
indicating whether the value in the resource is present and fully valid according to the property's type.
The value is the property's default value (for example, if no value is present in the resource), or it is a value
as constructed from the property resource. Note that isValidInResource may be false even if the value is
based on the resource's data, namely when a resave of the resource is desired, usually because the data in the
resource was not fully valid. In any case, the value must always pass the check from
Property.isValidValue(T).
| Constructor and Description |
|---|
PropertyValue(T value,
boolean isValidInResource)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
getValue() |
boolean |
isValidInResource()
Returns true if the data in the resource is fully valid for creating the value of the property.
|
String |
toString() |
static <T> PropertyValue<T> |
withValidValue(T value)
Creates a new instance for the given value which indicates that it is fully valid in the resource.
|
static <T> PropertyValue<T> |
withValueRequiringRewrite(T value)
Creates a new instance for the given value which indicates that its representation in the resource is NOT valid.
|
public PropertyValue(T value, boolean isValidInResource)
value - the value associated with the propertyisValidInResource - true if the value in the resource was fully validpublic static <T> PropertyValue<T> withValidValue(T value)
T - the value typevalue - the value to wrappublic static <T> PropertyValue<T> withValueRequiringRewrite(T value)
T - the value typevalue - the value to wrappublic T getValue()
public boolean isValidInResource()
Copyright © 2016–2021 The AuthMe Team. All rights reserved.