Interface InlineCard.UrlOrData

    • Method Detail

      • fold

        <T> T fold​(Function<? super String,​? extends T> ifUrl,
                   Function<? super Map<String,​?>,​? extends T> ifData)
        Transforms the link data into a desired resulting output form. This method provides the url value as a raw string without verifying that it is a valid URI.
        Specified by:
        fold in interface Fold2<String,​Map<String,​?>>
        Type Parameters:
        T - the inferred output data type of the mappings
        Parameters:
        ifUrl - the mapping to be applied if the link data is in the URI format.
        ifData - the mapping to be applied if the link data is in JSON-LD format.
        Returns:
        the result of applying the appropriate mapping function
      • accept

        void accept​(Consumer<? super String> ifUrl,
                    Consumer<? super Map<String,​?>> ifData)
        Do something with either the URI or JSON-LD data, as appropriate. This method provides the url value as a raw string without verifying that it is a valid URI.
        Specified by:
        accept in interface Fold2<String,​Map<String,​?>>
        Parameters:
        ifUrl - what to do with the URI if that is the form the link was provided in.
        ifData - what to do with the JSON-LD if that is the form the link was provided in.
      • url

        Optional<String> url()
        Return the url property, if that is the form that the link was provided in.
        Returns:
        the url property, if that is the form that the link was provided in; otherwise empty().
      • data

        Optional<Map<String,​?>> data()
        Return the JSON-LD data, if that is the form that the link was provided in.
        Returns:
        the JSON-LD data, if that is the form that the link was provided in; otherwise empty().