Class StringListProperty

    • Constructor Detail

      • StringListProperty

        public StringListProperty​(String name)
        The constructor.
        Parameters:
        name - the name.
    • Method Detail

      • remove

        public boolean remove​(String element)
        Parameters:
        element - the element to remove from the value as list.
        Returns:
        true if the given element was previously present and is now removed so the value actually has changed, false otherwise (if not present and no change).
        See Also:
        List.remove(Object)
      • add

        public boolean add​(String element,
                           boolean distinct)
        Parameters:
        element - the element to add to the value as list.
        distinct - true if the value should be treated as Set and this method should not change the value if the given element is already present, false otherwise.
        Returns:
        true if the value has changed, false otherwise (if distinct was true and the given element was already present).
        See Also:
        List.add(Object)
      • contains

        public boolean contains​(String element)
        Parameters:
        element - the element to check.
        Returns:
        true if the given element is contained in the value as list.
        See Also:
        List.contains(Object)
      • getValueAsList

        public List<String> getValueAsList()
        Returns:
        a List with the tokenized value.
      • getValueAsSet

        public Set<String> getValueAsSet()
        Returns:
        a Set with the tokenized value.
      • setValueAsCollection

        public void setValueAsCollection​(Collection<String> list)
        Parameters:
        list - the List of elements to set as separated string value.
      • getValueAsCsv

        public String getValueAsCsv()
        Returns:
        the value with comma as separator.
      • getValueAsCsv

        public String getValueAsCsv​(String separator)
        Parameters:
        separator - the character used as separator.
        Returns:
        the value with elements separated by the given separator.
      • setValueAsCsv

        public void setValueAsCsv​(String csv)
        Parameters:
        csv - the new value as comma separated value (e.g. "a,b,c").
      • setValueAsCsv

        public void setValueAsCsv​(String csv,
                                  char separator)
        Parameters:
        csv - the new value with elements separated by the given separator.
        separator - the character used as separator.
      • setValueAsCsv

        public void setValueAsCsv​(String csv,
                                  char separator,
                                  boolean trim)
        Parameters:
        csv - the new value with elements separated by the given separator.
        separator - the character used as separator.
        trim - if the elements from the given csv should be trimmed.