Tabnine Logo
InputFieldJsonWriter.writeNumber
Code IndexAdd Tabnine to your IDE (free)

How to use
writeNumber
method
in
com.apollographql.apollo.internal.json.InputFieldJsonWriter

Best Java code snippets using com.apollographql.apollo.internal.json.InputFieldJsonWriter.writeNumber (Showing top 2 results out of 315)

origin: apollographql/apollo-android

@Test
public void writeNumber() throws IOException {
 inputFieldJsonWriter.writeNumber("someField", BigDecimal.valueOf(1.001));
 inputFieldJsonWriter.writeNumber("someNullField", null);
 assertThat(jsonBuffer.readUtf8()).isEqualTo("{\"someField\":1.001,\"someNullField\":null");
}
origin: apollographql/apollo-android

@SuppressWarnings("unchecked")
@Override public void writeCustom(@NotNull String fieldName, ScalarType scalarType, Object value) throws IOException {
 checkNotNull(fieldName, "fieldName == null");
 if (value != null) {
  CustomTypeAdapter customTypeAdapter = scalarTypeAdapters.adapterFor(scalarType);
  CustomTypeValue customTypeValue = customTypeAdapter.encode(value);
  if (customTypeValue instanceof CustomTypeValue.GraphQLString) {
   writeString(fieldName, ((CustomTypeValue.GraphQLString) customTypeValue).value);
  } else if (customTypeValue instanceof CustomTypeValue.GraphQLBoolean) {
   writeBoolean(fieldName, ((CustomTypeValue.GraphQLBoolean) customTypeValue).value);
  } else if (customTypeValue instanceof CustomTypeValue.GraphQLNumber) {
   writeNumber(fieldName, ((CustomTypeValue.GraphQLNumber) customTypeValue).value);
  } else if (customTypeValue instanceof CustomTypeValue.GraphQLJsonString) {
   writeString(fieldName, ((CustomTypeValue.GraphQLJsonString) customTypeValue).value);
  } else if (customTypeValue instanceof CustomTypeValue.GraphQLJson) {
   writeMap(fieldName, ((CustomTypeValue.GraphQLJson) customTypeValue).value);
  } else {
   throw new IllegalArgumentException("Unsupported custom value type: " + customTypeValue);
  }
 } else {
  jsonWriter.name(fieldName).nullValue();
 }
}
com.apollographql.apollo.internal.jsonInputFieldJsonWriterwriteNumber

Popular methods of InputFieldJsonWriter

  • <init>
  • writeString
  • writeBoolean
  • writeCustom
  • writeDouble
  • writeInt
  • writeList
  • writeLong
  • writeMap
  • writeObject

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • JCheckBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now