Package org.ec4j.core.model
Class Property
java.lang.Object
org.ec4j.core.model.Adaptable.DefaultAdaptable
org.ec4j.core.model.Property
- All Implemented Interfaces:
Adaptable
A key value pair in a
Section.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.ec4j.core.model.Adaptable
Adaptable.DefaultAdaptable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final PropertyType<?> private final PropertyType.PropertyValue<?> -
Constructor Summary
ConstructorsConstructorDescriptionProperty(List<Object> adapters, PropertyType<?> type, String name, PropertyType.PropertyValue<?> value) Use theProperty.Builderif you cannot access this constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic Property.Builderbuilder()booleangetName()PropertyType<?> getType()<T> TinthashCode()booleanisUnset()booleanisValid()toString()Methods inherited from class org.ec4j.core.model.Adaptable.DefaultAdaptable
getAdapter
-
Field Details
-
name
-
type
-
value
-
-
Constructor Details
-
Property
Property(List<Object> adapters, PropertyType<?> type, String name, PropertyType.PropertyValue<?> value) Use theProperty.Builderif you cannot access this constructor- Parameters:
adapters-type-name-value-
-
-
Method Details
-
builder
- Returns:
- a new
Property.Builderwith no parent bulder set
-
equals
-
getName
- Returns:
- the key of this key value pair
-
getSourceValue
- Returns:
- the string value of this key value pair
-
getType
- Returns:
- the
PropertyTypeassociated with thenameornullif noPropertyTypeis associated with thegetName()
-
getValueAs
public <T> T getValueAs()- Type Parameters:
T- the type of the value- Returns:
- the parsed value
- Throws:
RuntimeException- if thevalueis not a valid value for the associatedPropertyType
-
hashCode
public int hashCode() -
isUnset
public boolean isUnset()- Returns:
trueif the source value is"unset"; otherwisefalse
-
isValid
public boolean isValid()- Returns:
trueiftypeisnullorvalueis a valid value for the associatedPropertyType;falseotherwise
-
toString
-