com.holonplatform.vaadin.navigator.internal

## Class DefaultViewParameterDefinition

- java.lang.Object
- - com.holonplatform.vaadin.navigator.internal.DefaultViewParameterDefinition

- All Implemented Interfaces:
    ViewConfiguration.ViewParameterDefinition, Serializable

      public class DefaultViewParameterDefinition
      extends Object
      implements ViewConfiguration.ViewParameterDefinition

  Default `ViewConfiguration.ViewParameterDefinition` implementation
  Since:
    4.0.0
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultViewParameterDefinition(String name, Class<?> type)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `Object` | `getDefaultValue()` Get optional parameter default value
    `Field` | `getField()` Get the view class field bound to this parameter definition
    `String` | `getName()` Get the parameter name
    `Method` | `getReadMethod()` View parameter field read method, if any
    `Class<?>` | `getType()` Get the parameter value type
    `Method` | `getWriteMethod()` View parameter field write method, if any
    `int` | `hashCode()`
    `boolean` | `isRequired()` Get whether the parameter is required
    `void` | `setDefaultValue(Object defaultValue)` Set parameter default value.
    `void` | `setField(Field field)` Set the view class field bound to this parameter definition
    `void` | `setReadMethod(Method readMethod)` Set the view parameter field read method
    `void` | `setRequired(boolean required)` Set whether the parameter is required
    `void` | `setWriteMethod(Method writeMethod)` Set the view parameter field write method
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultViewParameterDefinition

          public DefaultViewParameterDefinition(String name,
                                                Class<?> type)

      Constructor
      Parameters:
        `name` - Parameter name
        `type` - Parameter value type

  - ### Method Detail

    - #### setRequired

          public void setRequired(boolean required)

      Set whether the parameter is required
      Parameters:
        `required` - `true` if parameter is required, `false` otherwise

    - #### setDefaultValue

          public void setDefaultValue(Object defaultValue)

      Set parameter default value. According to parameter value type, a suitable String representation must be provided for default value:
      - For numeric values, `.` (dot) charachter must be used as decimal separator
      - For boolean values, only words `true` and `false` are admitted
      - For Enum values, String representation of enum ordinal index must be provided
      - For Date values, default value must be expressed using date format pattern `ViewParameter.DEFAULT_DATE_PATTERN`
      Parameters:
        `defaultValue` - Parameter default value

    - #### setField

          public void setField(Field field)

      Set the view class field bound to this parameter definition
      Parameters:
        `field` - View class field bound to this parameter definition

    - #### setReadMethod

          public void setReadMethod(Method readMethod)

      Set the view parameter field read method
      Parameters:
        `readMethod` - Field read method

    - #### setWriteMethod

          public void setWriteMethod(Method writeMethod)

      Set the view parameter field write method
      Parameters:
        `writeMethod` - Field write method

    - #### getName

          public String getName()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      Get the parameter name
      Specified by:
        `getName` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        Parameter name

    - #### getType

          public Class<?> getType()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      Get the parameter value type
      Specified by:
        `getType` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        Parameter value type

    - #### isRequired

          public boolean isRequired()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      Get whether the parameter is required
      Specified by:
        `isRequired` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        `true` if parameter is required, `false` otherwise

    - #### getDefaultValue

          public Object getDefaultValue()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      Get optional parameter default value
      Specified by:
        `getDefaultValue` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        Parameter default value, or `null` if not defined

    - #### getField

          public Field getField()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      Get the view class field bound to this parameter definition
      Specified by:
        `getField` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        View class field bound to this parameter definition

    - #### getReadMethod

          public Method getReadMethod()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      View parameter field read method, if any
      Specified by:
        `getReadMethod` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        Field read method, or `null` if not available

    - #### getWriteMethod

          public Method getWriteMethod()

      Description copied from interface: `ViewConfiguration.ViewParameterDefinition`
      View parameter field write method, if any
      Specified by:
        `getWriteMethod` in interface `ViewConfiguration.ViewParameterDefinition`
      Returns:
        Field write method, or `null` if not available

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2019 The Holon Platform. All rights reserved.