Class ResolvedContent

java.lang.Object
com.digimarc.dms.resolver.ResolvedContent

public class ResolvedContent extends Object
ResolvedContent wraps all data from the Digimarc Resolver and allows access to the fields. This class handles the majority of data returned by the resolver (both Digimarc Barcode for Audio, Digimarc Barcode for Print and a majority Digimarc Barcode for Packaging).
  • Constructor Details

    • ResolvedContent

      public ResolvedContent(@NonNull Payload payload, @Nullable String json) throws ResolvedContentException
      Constructor. In this version the Payload member within the ResolvedContent will be filled using the payload parameter.
      Parameters:
      payload - Payload used for this resolve.
      json - String containing the resolver data JSON text.
      Throws:
      ResolvedContentException - Exception thrown if the JSON is malformed.
    • ResolvedContent

      public ResolvedContent(@NonNull String json) throws ResolvedContentException
      Constructor. In this version the Payload member within the ResolvedContent will be from the PayloadPath entry in the JSON text. Note that the payload string is transformed during the resolve process and the payload string contained in the JSON text may not match what was originally sent to the resolver. In most cases we do not recommend using this method.
      Parameters:
      json - String containing the resolver data JSON text.
      Throws:
      ResolvedContentException - Exception thrown if the JSON is malformed.
    • ResolvedContent

      public ResolvedContent(@NonNull Payload payload, @Nullable String title, @Nullable String subTitle, @Nullable String thumbnailUrl, @Nullable String content)
      Constructor.
      Parameters:
      payload - The payload that this data represents.
      title - Title of the content data.
      subTitle - Subtitle of the content data.
      thumbnailUrl - URL to an image thumbnail that is associated with this content. This value may be empty.
      content - The content itself. This is generally an URL.
    • ResolvedContent

      public ResolvedContent(@NonNull Payload payload, @Nullable String title, @Nullable String subTitle, @Nullable String thumbnailUrl, @Nullable String content, @Nullable String correlationKey, boolean synthesizedContent)
      Constructor.
      Parameters:
      payload - The payload that this data represents.
      title - Title of the content data.
      subTitle - Subtitle of the content data.
      thumbnailUrl - URL to an image thumbnail that is associated with this content. This value may be empty.
      content - The content itself. This is generally an URL.
      correlationKey - The correlation key associated with this object.
      synthesizedContent - Specifies whether this result was generated locally.
  • Method Details

    • getPayload

      @NonNull public Payload getPayload()
      Gets the Payload associated with this resolver content.
      Returns:
      Payload object.
    • getCorrelationKey

      @Nullable public String getCorrelationKey()
      Get the content data's correlation key. This is a value that can be used to determine whether two sets of resolve data correspond to the same object. For instance, on product packaging with a Digimarc Barcode the Digimarc Barcode on the package and the product's 1D barcode will resolve to separate sets of content data. These two entries, however, will have the same correlation key value.
      Returns:
      The correlation key value.
    • getRawJson

      @Nullable public String getRawJson()
      Gets the JSON text from the Digimarc Resolver that produced this object. Most applications will not need to use this method.
      Returns:
      The raw JSON text received from the Digimarc Resolver.
    • getContentItems

      @NonNull public List<ContentItem> getContentItems()
      Returns the list of ContentItem objects contained within the resolve data. This list is guaranteed to contain at least one element, and the list is sorted such that the most relevant item will be first. In most cases it is sufficient to use the first element for all actions.
      Returns:
      A list of ContentItem objects. The list will always contain at least one object.
    • getContentItemsForCategory

      @Nullable public List<ContentItem> getContentItemsForCategory(@NonNull ContentItem.Category category)
      Returns a list of all the ContentItem items in the current object that match the specified category.
      Parameters:
      category - What category of ContentItems should be retrieved.
      Returns:
      Null if no items match the category, otherwise a list containing one or more items.
    • getIsProductDetailAvailable

      public boolean getIsProductDetailAvailable()
      Checks whether this resolve data contains product details.
      Returns:
      True if ProductDetail is available.
    • getProductDetail

      @Nullable public ProductDetail getProductDetail()
      Gets product details if they are available.
      Returns:
      Product detail object if it is available, null otherwise.