All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hl7.fhir.utilities.graphql.GraphQLResponse Maven / Gradle / Ivy

There is a newer version: 6.4.1
Show newest version
package org.hl7.fhir.utilities.graphql;

public class GraphQLResponse extends ObjectValue {
  private boolean writeWrapper = true;

  /**
   * Should the "data" wrapper br written along with the output
   */
  public void setWriteWrapper(boolean theWriteWrapper) {
    writeWrapper = theWriteWrapper;
  }

  @Override
  public void write(StringBuilder b, Integer indent, String lineSeparator) throws EGraphQLException, EGraphEngine {

    if (writeWrapper) {
      // Write the wrapper
      b.append("{ \"data\": ");
    }

    super.write(b, indent, lineSeparator);

    if (writeWrapper) {
      // Terminate the wrapper
      b.append("}");
    }

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy