org.eclipse.rdf4j.sparqlbuilder.util

## Class SparqlBuilderUtils

- java.lang.Object
- - org.eclipse.rdf4j.sparqlbuilder.util.SparqlBuilderUtils

-     public class SparqlBuilderUtils
      extends Object

  Utility functions for the SparqlBuilder

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SparqlBuilderUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `appendAndNewlineIfPresent(Optional<? extends QueryElement> elementOptional, StringBuilder builder)`
    `static void` | `appendQueryElementIfPresent(Optional<? extends QueryElement> queryElementOptional, StringBuilder builder, String prefix, String suffix)`
    `static void` | `appendStringIfPresent(Optional<String> stringOptional, StringBuilder builder, String prefix, String suffix)`
    `static String` | `getBracedString(String contents)`
    `static String` | `getBracketedString(String contents)`
    `static String` | `getLongQuotedString(String contents)` For string literals that contain single- or double-quotes
    `static <O> Optional<O>` | `getOrCreateAndModifyOptional(Optional<O> optional, java.util.function.Supplier<O> getter, java.util.function.UnaryOperator<O> operator)`
    `static String` | `getParenthesizedString(String contents)`
    `static String` | `getQuotedString(String contents)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SparqlBuilderUtils

          public SparqlBuilderUtils()

  - ### Method Detail

    - #### getOrCreateAndModifyOptional

          public static <O> Optional<O> getOrCreateAndModifyOptional(Optional<O> optional,
                                                                     java.util.function.Supplier<O> getter,
                                                                     java.util.function.UnaryOperator<O> operator)

    - #### appendAndNewlineIfPresent

          public static void appendAndNewlineIfPresent(Optional<? extends QueryElement> elementOptional,
                                                       StringBuilder builder)

    - #### appendQueryElementIfPresent

          public static void appendQueryElementIfPresent(Optional<? extends QueryElement> queryElementOptional,
                                                         StringBuilder builder,
                                                         String prefix,
                                                         String suffix)

    - #### appendStringIfPresent

          public static void appendStringIfPresent(Optional<String> stringOptional,
                                                   StringBuilder builder,
                                                   String prefix,
                                                   String suffix)

    - #### getBracedString

          public static String getBracedString(String contents)

    - #### getBracketedString

          public static String getBracketedString(String contents)

    - #### getParenthesizedString

          public static String getParenthesizedString(String contents)

    - #### getQuotedString

          public static String getQuotedString(String contents)

    - #### getLongQuotedString

          public static String getLongQuotedString(String contents)

      For string literals that contain single- or double-quotes
      Parameters:
        `contents` -
      Returns:
        a "long quoted" string
      See Also:
        RDF Literal Syntax

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.