com.jscape.util.reflection.types

## Class ChoiceField

- java.lang.Object
- - com.jscape.util.reflection.FieldType
  - - com.jscape.util.reflection.types.ChoiceField

-     public class ChoiceField
      extends FieldType

  Drop-down choice field component.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `multiple`
    `boolean` | `optional`
    `java.lang.String[]` | `variants`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChoiceField(boolean optional)` Creates new instance with empty String options.
    `ChoiceField(boolean optional, boolean multiple, java.lang.String... variants)` Creates new instance of String options.
    `ChoiceField(boolean optional, java.lang.String... variants)` Creates new instance of String options.
    `ChoiceField(java.lang.String... variants)` Creates new instance of String options.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ChoiceField` | `createRangeChoice(int lowerBound, int upperBound)` Creates new instance using integer range.
    `static ChoiceField` | `createRangeChoice(int lowerBound, int upperBound, boolean optional)` Creates new instance using integer range.
    `java.lang.String[]` | `getVariants()` Returns field variants.
    `boolean` | `isMultiple()` Returns if field is multiple.
    `boolean` | `isOptional()` Returns if field is optional.
    `java.lang.String` | `toString()`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### variants

          public final java.lang.String[] variants

    - #### optional

          public final boolean optional

    - #### multiple

          public final boolean multiple

  - ### Constructor Detail

    - #### ChoiceField

          public ChoiceField(boolean optional,
                             boolean multiple,
                             java.lang.String... variants)

      Creates new instance of String options.
      Parameters:
        `optional` - if field is optional
        `multiple` - if field is multiple
        `variants` - the string variants

    - #### ChoiceField

          public ChoiceField(boolean optional,
                             java.lang.String... variants)

      Creates new instance of String options.
      Parameters:
        `variants` - the string variants
        `optional` - if field is optional

    - #### ChoiceField

          public ChoiceField(java.lang.String... variants)

      Creates new instance of String options.
      Parameters:
        `variants` - the string variants

    - #### ChoiceField

          public ChoiceField(boolean optional)

      Creates new instance with empty String options.
      Parameters:
        `optional` - if field is optional

  - ### Method Detail

    - #### createRangeChoice

          public static ChoiceField createRangeChoice(int lowerBound,
                                                      int upperBound)

      Creates new instance using integer range.
      Parameters:
        `lowerBound` - the lower bound
        `upperBound` - the upper bound
      Returns:
        a choice field

    - #### createRangeChoice

          public static ChoiceField createRangeChoice(int lowerBound,
                                                      int upperBound,
                                                      boolean optional)

      Creates new instance using integer range.
      Parameters:
        `lowerBound` - the lower bound
        `upperBound` - the upper bound
        `optional` - if field is optional
      Returns:
        a choice field

    - #### getVariants

          public java.lang.String[] getVariants()

      Returns field variants.
      Returns:
        the string variants

    - #### isMultiple

          public boolean isMultiple()

      Returns if field is multiple.
      Returns:
        `true` if field is multiple

    - #### isOptional

          public boolean isOptional()

      Returns if field is optional.
      Returns:
        `true` if field is optional

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © JSCAPE LLC. 1999-2019. All Rights Reserved