Class Choice


  • public class Choice
    extends Object
    Record class to hold the data describing one option, or choice, for an authority-controlled metadata value.
    Author:
    Larry Stone
    See Also:
    Choices
    • Field Detail

      • authority

        public String authority
        Authority key for this value
      • label

        public String label
        Label to display for this value (e.g. to present in UI menu)
      • value

        public String value
        The canonical text value to insert into MetadataValue's text field
      • selectable

        public boolean selectable
        A boolean representing if choice entry value can selected (usually true). Hierarchical authority can flag some choice as not selectable to force the use to choice a more detailed terms in the tree, such a leaf or a deeper branch
    • Constructor Detail

      • Choice

        public Choice()
      • Choice

        public Choice​(String authority,
                      String value,
                      String label)
        Minimal constructor for this data object. It assumes an empty map of extras information and a selected choice
        Parameters:
        authority - the authority key
        value - the text value to store in the metadata
        label - the value to display to the user
      • Choice

        public Choice​(String authority,
                      String label,
                      String value,
                      Map<String,​String> extras)
        Constructor to quickly setup the data object for basic authorities. The choice is assumed to be selectable.
        Parameters:
        authority - the authority key
        value - the text value to store in the metadata
        label - the value to display to the user
        extras - a key value map of extra information related to this choice
      • Choice

        public Choice​(String authority,
                      String label,
                      String value,
                      boolean selectable)
        Constructor for common need of Hierarchical authorities that want to explicitely set the selectable flag
        Parameters:
        authority - the authority key
        value - the text value to store in the metadata
        label - the value to display to the user
        selectable - true if the choice can be selected, false if the a more accurate choice should be preferred