Class EngineProperty<T>

  • Type Parameters:
    T - the type of the engine property

    public class EngineProperty<T>
    extends Object
    Defined configuration properties for the DataRush engine.
    • Method Detail

      • defineProperty

        public static <T> EngineProperty<T> defineProperty​(String propertyName,
                                                           String description,
                                                           Class<T> propertyClass,
                                                           T defaultValue)
        Creates a new engine property
        Type Parameters:
        T - the type of property
        Parameters:
        propertyName - the name of the property
        description - the description of the property
        propertyClass - the type of the property
        defaultValue - the default value of the property
        Returns:
        a new engine property
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • parseValue

        public T parseValue​(String value)
                     throws com.pervasive.datarush.graphs.physical.InvalidPropertyValueException
        Parses the given value from its text representation to the type of the property
        Parameters:
        value - the next value
        Returns:
        the property value
        Throws:
        com.pervasive.datarush.graphs.physical.InvalidPropertyValueException - if a parse error occurs
      • getProperty

        public final String getProperty()
        Gets the property key for use in properties files.
        Returns:
        the property's key name
      • getDescription

        public final String getDescription()
        Gets a description of the property.
        Returns:
        the property's description
      • getDefaultValue

        public T getDefaultValue()
        Gets the default value for the property.
        Returns:
        the property's default
      • getPropertyClass

        public final Class<T> getPropertyClass()
        Returns the class of values of this property
        Returns:
        the class of values of this property
      • discoverProperties

        public static List<EngineProperty<?>> discoverProperties​(Class<?> clazz)
        Finds all public static final EngineProperty declarations of the given class and its inner classes.
        Parameters:
        clazz - the class, usually EngineConfig
        Returns:
        all property declarations in the given class and inner classes
      • discoverProperty

        public static EngineProperty<?> discoverProperty​(Class<?> clazz,
                                                         String name)
        Looks up engine properties by their property file keys.
        Parameters:
        clazz - the class containing property declarations
        name - the key from the property file
        Returns:
        the associated engine property. null if no such property can be found.