Class FileFormatItemDTOMapper

java.lang.Object
org.openhab.core.io.rest.core.fileformat.FileFormatItemDTOMapper

@NonNullByDefault public class FileFormatItemDTOMapper extends Object
The FileFormatItemDTOMapper is a utility class to map items into file format item data transfer objects (DTOs).
Author:
Laurent Garnier - Initial contribution
  • Constructor Details

    • FileFormatItemDTOMapper

      public FileFormatItemDTOMapper()
  • Method Details

    • map

      public static FileFormatItemDTO map(Item item, Collection<Metadata> metadata, @Nullable String format, Collection<ItemChannelLink> channelLinks)
      Maps item into file format item DTO object.
      Parameters:
      item - the item
      metadata - some metadata
      format - the format to be used to format the item state, can be NULL
      channelLinks - some items channel links
      Returns:
      file format item DTO object
    • map

      public static @Nullable Item map(FileFormatItemDTO dto, ItemBuilderFactory itemBuilderFactory)
      Maps file format item DTO object into item.
      Parameters:
      dto - the file format item DTO object
      itemBuilderFactory - the item builder factory
      Returns:
      item
    • mapMetadata

      public static Collection<Metadata> mapMetadata(FileFormatItemDTO dto)
      Maps file format item DTO object into a collection of metadata including channels links provided through the "channel" namespace.
      Parameters:
      dto - the file format item DTO object
      Returns:
      the collection of metadata