Class SuggestedValuesBuilder


  • public final class SuggestedValuesBuilder
    extends Object
    Builder for instances of SuggestedValues.
    Since:
    1.5.2.0
    Author:
    Radovan Semancik
    • Constructor Detail

      • SuggestedValuesBuilder

        public SuggestedValuesBuilder()
    • Method Detail

      • build

        public static SuggestedValues build​(Object... values)
        Creates closed suggested values with the specified values.
        Parameters:
        values - variable number of arguments that are used as values for the attribute.
        Returns:
        instance of SuggestedValues with the specified values that includes the arguments provided.
      • buildOpen

        public static SuggestedValues buildOpen​(Object... values)
        Creates open suggested values with the specified values.
        Parameters:
        values - variable number of arguments that are used as values for the attribute.
        Returns:
        instance of SuggestedValues with the specified values that includes the arguments provided.
      • build

        public static SuggestedValues build​(Collection<?> collection)
        Creates closed suggested values with the specified values from a collection.
        Parameters:
        collection - a collection of objects that are used as suggested values.
        Returns:
        instance of SuggestedValues with values from the provided collection.
      • getValues

        public List<Object> getValues()
        Return current values of the SuggestedValues instance that is being built.
        Returns:
        current values of the SuggestedValues instance that is being built.
      • addValues

        public SuggestedValuesBuilder addValues​(Object... objs)
        Add each of the specified objects as a value for SuggestedValues instance that is being built.
        Parameters:
        objs - the values to add
        Throws:
        NullPointerException - if any of the values is null.
      • addValues

        public SuggestedValuesBuilder addValues​(Collection<?> obj)
        Adds each object in the collection as a value for SuggestedValues instance that is being built.
        Parameters:
        obj - the values to add
        Throws:
        NullPointerException - if any of the values is null.
      • build

        public SuggestedValues build()
        Returns:
        a new SuggestedValues instance with the values that have been provided to the builder.
      • getOpenness

        public ValueListOpenness getOpenness()
        Returns openness of value list. Closed lists (the default) can accept only specified values. Open lists can accept any value.
        See Also:
        ValueListOpenness
      • setOpenness

        public void setOpenness​(ValueListOpenness openness)
        Sets openness of value list. Closed lists (the default) can accept only specified values. Open lists can accept any value.
        See Also:
        ValueListOpenness