Class BlockCard.CardAttributes

    • Constructor Detail

      • CardAttributes

        public CardAttributes()
    • Method Detail

      • fold

        public abstract <T> T fold​(Function<? super String,​? extends T> ifUrl,
                                   Function<? super Map<String,​?>,​? extends T> ifData,
                                   Function<? super BlockCard.Datasource,​? extends T> ifDatasource)
        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 Fold3<String,​Map<String,​?>,​BlockCard.Datasource>
        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.
        ifDatasource - the mapping to be applied if the link data is in datasource format.
        Returns:
        the result of applying the appropriate mapping function
      • accept

        public abstract void accept​(Consumer<? super String> ifUrl,
                                    Consumer<? super Map<String,​?>> ifData,
                                    Consumer<? super BlockCard.Datasource> ifDatasource)
        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 Fold3<String,​Map<String,​?>,​BlockCard.Datasource>
        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.
        ifDatasource - what to do with the datasource if that is the form the link was provided in.