Interface Item<T>

    • Method Detail

      • caption

        String caption()
        Returns:
        the caption
      • value

        T value()
        Returns:
        the value
      • item

        static <T> Item<T> item​(T value)
        Returns an Item, with the caption as item.toString() or an empty string in case of a null value
        Type Parameters:
        T - the value type
        Parameters:
        value - the value, may be null
        Returns:
        an Item based on the given value
      • item

        static <T> Item<T> item​(T value,
                                String caption)
        Creates a new Item.
        Type Parameters:
        T - the value type
        Parameters:
        value - the value, may be null
        caption - the caption
        Returns:
        an Item based on the given value and caption
        Throws:
        NullPointerException - if caption is null
      • itemI18n

        static <T> Item<T> itemI18n​(T value,
                                    String resourceBundleName,
                                    String resourceBundleKey)
        Creates a new Item, which gets its caption from a resource bundle. Note that the caption is cached, so that changing the Locale after the first time caption() is called will not change the caption.
        Type Parameters:
        T - the value type
        Parameters:
        value - the value, may be null
        resourceBundleName - the resource bundle name
        resourceBundleKey - the resource bundle key for the item caption
        Returns:
        an Item based on the given value and resource bundle