Android ReflectiveTypeAdapterFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ReflectiveTypeAdapterFactory class.

This code example shows how to use the following methods:
    factories.add(TypeAdapters.CLASS_FACTORY);
 
    // type adapters for composite and user-defined types 
    factories.add(new CollectionTypeAdapterFactory(constructorConstructor));
    factories.add(new MapTypeAdapterFactory(constructorConstructor, complexMapKeySerialization));
    factories.add(new ReflectiveTypeAdapterFactory(
        constructorConstructor, fieldNamingPolicy, excluder));
 
    this.factories = Collections.unmodifiableList(factories);
  } 
 
  private TypeAdapter<Number> doubleAdapter(boolean serializeSpecialFloatingPointValues) {
    if (serializeSpecialFloatingPointValues) {
      return TypeAdapters.DOUBLE;
    } 
    return new TypeAdapter<Number>() {
      @Override public Double read(JsonReader in) throws IOException {
        if (in.peek() == JsonToken.NULL) {
          in.nextNull();
          return null; 
2
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Android ReflectiveTypeAdapterFactory Methods: