Class PepperModuleProperty<T>

  • All Implemented Interfaces:
    Serializable, Comparable<PepperModuleProperty<?>>

    public class PepperModuleProperty<T>
    extends Object
    implements Comparable<PepperModuleProperty<?>>, Serializable
    With properties, the conversion process done by a Pepper module can be customized. A property in general is an attribute value pair, with a unique name and a value influencing the module's behavior. It is possible to add a default value in case the value was not initialized by the Pepper workflow file. A further flag can be used to set the property as required, which means, the property must be set to run the container module. Each property should contain a description, to help the user understanding how to use this property. A property is created in a fluent way. See the following sample:
     PepperModuleProperty.create().withName("MyProp").withType(String.class)
                    .withDescription("Please describe the property for the user. ")
                    .withDefaultValue("theDefaultWhenNoValueIsSet").isRequired(false).build();
     
    See Also:
    Serialized Form
    • Constructor Detail

      • PepperModuleProperty

        @Deprecated
        public PepperModuleProperty​(String name,
                                    Class<T> clazz,
                                    String description)
        Deprecated.
        will be removed with Pepper 4.0
      • PepperModuleProperty

        @Deprecated
        public PepperModuleProperty​(String name,
                                    Class<T> clazz,
                                    String description,
                                    T defaultValue)
        Deprecated.
        will be removed with Pepper 4.0
      • PepperModuleProperty

        @Deprecated
        public PepperModuleProperty​(String name,
                                    Class<T> clazz,
                                    String description,
                                    boolean required)
        Deprecated.
        will be removed with Pepper 4.0
      • PepperModuleProperty

        @Deprecated
        public PepperModuleProperty​(String name,
                                    Class<T> clazz,
                                    String description,
                                    T defaultValue,
                                    boolean required)
        Deprecated.
        the visibility of this method will be set to private
        Creates a PepperModuleProperty instance and sets its values to the given ones.
        Parameters:
        name - name of the property
        clazz - the propertys class
        description - a description to the property
        defaultValue - sets a default value if no one is set
        required - determines if the property is required (true means property is required)
    • Method Detail

      • getName

        public String getName()
      • getType

        public Class<T> getType()
      • getDescription

        public String getDescription()
      • isRequired

        public boolean isRequired()
      • setValue

        public void setValue​(T value)
      • getValue

        public T getValue()
      • getDefaultValue

        public final T getDefaultValue()
      • setValueString

        public void setValueString​(String value)
        Sets the given value to the internal one. In case of the type of this property is not a String, this method will try to cast the given value. Please note, that only supported types can be casted. The following types are provide by a type cast:
        Parameters:
        value - consumes the given String parameter and transforms it
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object