Interface Parsable<I>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      I get()  
      default <O> O parse​(java.util.function.Function<I,​O> parsingFunction)
      Parses content of resource using parsingFunction.
      default <O> O parseChecked​(ThrowingFunction<I,​O> parsingFunction)
      Parses content of resource using parsingFunction that may throw exception.
      default void then​(java.util.function.Consumer<I> contentConsumer)
      Processes content of resource using contentConsumer.
      default void thenChecked​(ThrowingConsumer<I> contentConsumer)
      Processes content of resource using contentConsumer that may throw exception.
    • Method Detail

      • get

        I get()
        Returns:
        content of resource as type T.
      • parse

        default <O> O parse​(java.util.function.Function<I,​O> parsingFunction)
        Parses content of resource using parsingFunction.
        Type Parameters:
        O - type of parsed content
        Parameters:
        parsingFunction - parsing function
        Returns:
        parsed resource content
      • parseChecked

        default <O> O parseChecked​(ThrowingFunction<I,​O> parsingFunction)
        Parses content of resource using parsingFunction that may throw exception.

        Function converts all thrown checked exceptions to unchecked RuntimeException.

        Type Parameters:
        O - type of parsed content
        Parameters:
        parsingFunction - parsing function that may throw exception
        Returns:
        parsed resource content
      • then

        default void then​(java.util.function.Consumer<I> contentConsumer)
        Processes content of resource using contentConsumer.
        Parameters:
        contentConsumer - content consumer
      • thenChecked

        default void thenChecked​(ThrowingConsumer<I> contentConsumer)
        Processes content of resource using contentConsumer that may throw exception.
        Parameters:
        contentConsumer - content consumer that may throw exception