congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ResponseField$CustomTypeField
Code IndexAdd Tabnine to your IDE (free)

How to use
ResponseField$CustomTypeField
in
com.apollographql.apollo.api

Best Java code snippets using com.apollographql.apollo.api.ResponseField$CustomTypeField (Showing top 10 results out of 315)

origin: apollographql/apollo-android

@SuppressWarnings("unchecked")
@Override public void writeCustom(@NotNull ResponseField.CustomTypeField field, @Nullable Object value) {
 CustomTypeAdapter typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
 writeScalarFieldValue(field, value != null ? typeAdapter.encode(value).value : null);
}
origin: apollographql/apollo-android

recordSet.put(stringField.responseName(), "string");
recordSet.put(booleanField.responseName(), true);
recordSet.put(integerField.responseName(), BigDecimal.valueOf(1));
recordSet.put(longField.responseName(), BigDecimal.valueOf(2));
recordSet.put(floatField.responseName(), BigDecimal.valueOf(3.99));
recordSet.put(doubleField.responseName(), BigDecimal.valueOf(4.99));
recordSet.put(unsupportedField.responseName(), "smth");
origin: com.amazonaws/aws-android-sdk-appsync-runtime

@SuppressWarnings("unchecked") @Override public <T> T readCustomType(ResponseField.CustomTypeField field) {
 if (shouldSkip(field)) {
  return null;
 }
 willResolve(field);
 Object value = fieldValueResolver.valueFor(recordSet, field);
 checkValue(field, value);
 final T result;
 if (value == null) {
  readerShadow.didResolveNull();
  result = null;
 } else {
  CustomTypeAdapter<T> typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
  readerShadow.didResolveScalar(value);
  result = typeAdapter.decode(value.toString());
 }
 didResolve(field);
 return result;
}
origin: awslabs/aws-mobile-appsync-sdk-android

@SuppressWarnings("unchecked") @Override public <T> T readCustomType(ResponseField.CustomTypeField field) {
 if (shouldSkip(field)) {
  return null;
 }
 willResolve(field);
 Object value = fieldValueResolver.valueFor(recordSet, field);
 checkValue(field, value);
 final T result;
 if (value == null) {
  readerShadow.didResolveNull();
  result = null;
 } else {
  CustomTypeAdapter<T> typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
  readerShadow.didResolveScalar(value);
  result = typeAdapter.decode(value.toString());
 }
 didResolve(field);
 return result;
}
origin: com.amazonaws/aws-android-sdk-appsync-api

/**
 * Factory method for creating a Field instance representing a custom GraphQL Scalar type, {@link Type#CUSTOM}
 *
 * @param responseName alias for the result of a field
 * @param fieldName    name of the field in the GraphQL operation
 * @param arguments    arguments to be passed along with the field
 * @param optional     whether the arguments passed along are optional or required
 * @param scalarType   the custom scalar type of the field
 * @param conditions   list of conditions for this field
 * @return Field instance representing {@link Type#CUSTOM}
 */
public static CustomTypeField forCustomType(String responseName, String fieldName, Map<String, Object> arguments,
                      boolean optional, ScalarType scalarType, List<Condition> conditions) {
 return new CustomTypeField(responseName, fieldName, arguments, optional, scalarType, conditions);
}
origin: awslabs/aws-mobile-appsync-sdk-android

/**
 * Factory method for creating a Field instance representing a custom GraphQL Scalar type, {@link Type#CUSTOM}
 *
 * @param responseName alias for the result of a field
 * @param fieldName    name of the field in the GraphQL operation
 * @param arguments    arguments to be passed along with the field
 * @param optional     whether the arguments passed along are optional or required
 * @param scalarType   the custom scalar type of the field
 * @param conditions   list of conditions for this field
 * @return Field instance representing {@link Type#CUSTOM}
 */
public static CustomTypeField forCustomType(String responseName, String fieldName, Map<String, Object> arguments,
                      boolean optional, ScalarType scalarType, List<Condition> conditions) {
 return new CustomTypeField(responseName, fieldName, arguments, optional, scalarType, conditions);
}
origin: awslabs/aws-mobile-appsync-sdk-android

@Override public void writeCustom(@Nonnull ResponseField.CustomTypeField field, @Nullable Object value) {
 CustomTypeAdapter typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
 writeScalarFieldValue(field, value != null ? typeAdapter.encode(value) : null);
}
origin: com.amazonaws/aws-android-sdk-appsync-runtime

@Override public void writeCustom(@Nonnull ResponseField.CustomTypeField field, @Nullable Object value) {
 CustomTypeAdapter typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
 writeScalarFieldValue(field, value != null ? typeAdapter.encode(value) : null);
}
origin: apollographql/apollo-android

@SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
@Override public <T> T readCustomType(ResponseField.CustomTypeField field) {
 if (shouldSkip(field)) {
  return null;
 }
 willResolve(field);
 Object value = fieldValueResolver.valueFor(recordSet, field);
 checkValue(field, value);
 final T result;
 if (value == null) {
  resolveDelegate.didResolveNull();
  result = null;
 } else {
  CustomTypeAdapter<T> typeAdapter = scalarTypeAdapters.adapterFor(field.scalarType());
  result = typeAdapter.decode(CustomTypeValue.fromRawValue(value));
  checkValue(field, result);
  resolveDelegate.didResolveScalar(value);
 }
 didResolve(field);
 return result;
}
origin: apollographql/apollo-android

/**
 * Factory method for creating a Field instance representing a custom GraphQL Scalar type, {@link Type#CUSTOM}
 *
 * @param responseName alias for the result of a field
 * @param fieldName    name of the field in the GraphQL operation
 * @param arguments    arguments to be passed along with the field
 * @param optional     whether the arguments passed along are optional or required
 * @param scalarType   the custom scalar type of the field
 * @param conditions   list of conditions for this field
 * @return Field instance representing {@link Type#CUSTOM}
 */
public static CustomTypeField forCustomType(String responseName, String fieldName, Map<String, Object> arguments,
  boolean optional, ScalarType scalarType, List<Condition> conditions) {
 return new CustomTypeField(responseName, fieldName, arguments, optional, scalarType, conditions);
}
com.apollographql.apollo.apiResponseField$CustomTypeField

Javadoc

Abstraction for a Field representing a custom GraphQL scalar type.

Most used methods

  • <init>
  • scalarType
  • responseName

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Kernel (java.awt.image)
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Best IntelliJ plugins
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