Interface IPropertyRules

All Known Implementing Classes:
JavaRosaPropertyRules

public interface IPropertyRules
The IPropertyRules interface is used to describe a set of rules for what properties are allowed for a given property manager, and what values are are acceptable for a given property. Essentially, individual properties should be considered to be actual persistent storage for a device's specific configuration, and a set of property rules should be considered to be the non-persistent meta-data surrounding what those configurations mean.
Author:
ctsims
  • Method Details

    • allowableValues

      List<String> allowableValues​(String propertyName)
      Identifies what values are acceptable for a given property
      Parameters:
      propertyName - The name of the property that is being identified
      Returns:
      A List containing all of the values that this property may be set to
    • checkValueAllowed

      boolean checkValueAllowed​(String propertyName, String potentialValue)
      Identifies whether the given value is an acceptable for a property.
      Parameters:
      propertyName - The name of the property that is being identified
      potentialValue - The value that is being tested
      Returns:
      True if the property specified may be set to potentialValue, False otherwise
    • allowableProperties

      List<String> allowableProperties()
      Identifies what properties are acceptable for this rules set
      Returns:
      A List containing all of the properties that may be set
    • checkPropertyAllowed

      boolean checkPropertyAllowed​(String propertyName)
      Identifies whether the given property is usable
      Parameters:
      propertyName - The name of the property that is being tested
      Returns:
      True if the property specified may used. False otherwise
    • checkPropertyUserReadOnly

      boolean checkPropertyUserReadOnly​(String propertyName)
      Identifies whether the property should be revealed to users. Note that this does not govern whether the value can be set, simply whether it should be set manually by users.
      Parameters:
      propertyName - The name of the property that is being tested
      Returns:
      True if the property specified may not be modified by the user. false otherwise
    • getHumanReadableDescription

      String getHumanReadableDescription​(String propertyName)
      Returns a human readable string representing the description of a property.
      Parameters:
      propertyName - The name of the property to be described
      Returns:
      A string that describes the meaning of the property name
    • getHumanReadableValue

      String getHumanReadableValue​(String propertyName, String value)
      Returns a human readable string representing the value of a specific property. This allows multiple choice answers to be stored in a concise format, while offering a standardized way to present those options to a user.
      Parameters:
      propertyName - The name of the property whose value is to be interpreted.
      value - The value to be interpreted as a String
      Returns:
      A string representing the passed in value that can be parsed by a user to determine what its significance is.
    • handlePropertyChanges

      void handlePropertyChanges​(String propertyName)
      Handles any state changes that would be required upon a specific value being changed.
      Parameters:
      propertyName - The name of the property that has changed