public class BasicConfigurationPropertyModel extends java.lang.Object implements ConfigurationPropertyModel
Modifier and Type | Class and Description |
---|---|
protected class |
BasicConfigurationPropertyModel.DefaultRankedProperty |
protected class |
BasicConfigurationPropertyModel.InternalProperty<T> |
protected static interface |
BasicConfigurationPropertyModel.RankedProperty |
EMPTY_MODEL
Modifier | Constructor and Description |
---|---|
|
BasicConfigurationPropertyModel(long version) |
protected |
BasicConfigurationPropertyModel(long version,
java.util.Map<Property<?>,BasicConfigurationPropertyModel.InternalProperty> properties)
Used for cloning
|
|
BasicConfigurationPropertyModel(PropertySet propertySet)
Creates a simple model off of the properties contained in the propertyset.
|
Modifier and Type | Method and Description |
---|---|
protected int |
compareRankedProperties(BasicConfigurationPropertyModel.RankedProperty a,
BasicConfigurationPropertyModel.RankedProperty b) |
protected <T> void |
connectDependency(BasicConfigurationPropertyModel.InternalProperty<T> owner,
T value,
BasicConfigurationPropertyModel.InternalProperty<?> child) |
boolean |
contains(Property<?> property)
Returns whether this property is contained in the model at all.
|
java.util.Set<Property<?>> |
getAffectedProperties(Property<?> p)
Called after editing the given property, this returns the props whose isRelevant/isEditable should be called.
|
<T> java.util.Optional<java.util.Collection<T>> |
getAllowedValues(Property<T> p)
If the range of allowed properties is restricted, this will return the valid values.
|
java.util.List<Property<?>> |
getApplicableProperties(PropertySet config)
Given the current config, returns the properties that should be displayed.
|
long |
getCurrentModelVersion()
Returns the current model version, incremented when the model is changed.
|
java.util.Set<Property<?>> |
getModelProperties()
Returns properties that are in some way registered with the model.
|
boolean |
isApplicable(PropertySet config,
Property<?> property)
Returns whether a property is relevant given the current configuration.
|
boolean |
isModelProperty(Property<?> property)
Returns true if this is a property that is contained in the Model Properties.
|
void |
mergeTo(MutableConfigurationPropertyModel target)
Takes the traits of this configuration prop model and puts them in the target model.
|
protected <T> BasicConfigurationPropertyModel.InternalProperty<T> |
p(Property<T> prop) |
Property<?> |
resolve(java.lang.String id)
Returns the property represented by the id, or null if the property cannot be found.
|
public BasicConfigurationPropertyModel(long version)
public BasicConfigurationPropertyModel(PropertySet propertySet)
propertySet
- the collection of properties to register.protected BasicConfigurationPropertyModel(long version, java.util.Map<Property<?>,BasicConfigurationPropertyModel.InternalProperty> properties)
public long getCurrentModelVersion()
ConfigurationPropertyModel
getCurrentModelVersion
in interface ConfigurationPropertyModel
protected <T> BasicConfigurationPropertyModel.InternalProperty<T> p(Property<T> prop)
public java.util.List<Property<?>> getApplicableProperties(PropertySet config)
ConfigurationPropertyModel
getApplicableProperties
in interface ConfigurationPropertyModel
public boolean isApplicable(PropertySet config, Property<?> property)
ConfigurationPropertyModel
isApplicable
in interface ConfigurationPropertyModel
public java.util.Set<Property<?>> getAffectedProperties(Property<?> p)
ConfigurationPropertyModel
getAffectedProperties
in interface ConfigurationPropertyModel
public <T> java.util.Optional<java.util.Collection<T>> getAllowedValues(Property<T> p)
ConfigurationPropertyModel
getAllowedValues
in interface ConfigurationPropertyModel
public Property<?> resolve(java.lang.String id)
PropertyResolver
resolve
in interface PropertyResolver
public boolean contains(Property<?> property)
ConfigurationPropertyModel
contains
in interface ConfigurationPropertyModel
public java.util.Set<Property<?>> getModelProperties()
ConfigurationPropertyModel
getModelProperties
in interface ConfigurationPropertyModel
public boolean isModelProperty(Property<?> property)
ConfigurationPropertyModel
isModelProperty
in interface ConfigurationPropertyModel
public void mergeTo(MutableConfigurationPropertyModel target)
ConfigurationPropertyModel
mergeTo
in interface ConfigurationPropertyModel
protected <T> void connectDependency(BasicConfigurationPropertyModel.InternalProperty<T> owner, T value, BasicConfigurationPropertyModel.InternalProperty<?> child)
protected int compareRankedProperties(BasicConfigurationPropertyModel.RankedProperty a, BasicConfigurationPropertyModel.RankedProperty b)