@Test public void deserializeMessageByType() { Buffer buffer = wrap(testMessageBytes); DummyMessage message = firstOf(provider.getDeserializer(typeHolder).deserialize(buffer)); assertThat(message, equalTo(testMessage)); }
@Override @SuppressWarnings("unchecked") public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { requireMessageLite(classToDeSerialize); Parser<T> parser = parsers.computeIfAbsent(classToDeSerialize, parserForClass::apply); return new ProtobufDeserializer<>(parser); }
ProtobufSerializationProvider implements SerializationProvider { @Override @SuppressWarnings("unchecked") public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { requireMessageLite(classToDeSerialize); Parser<T> parser = parsers.computeIfAbsent(classToDeSerialize, parserForClass::apply); return new ProtobufDeserializer<>(parser); } }
ProtobufSerializationProvider implements SerializationProvider { @Override @SuppressWarnings("unchecked") public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { requireMessageLite(classToDeSerialize); Parser<T> parser = parsers.computeIfAbsent(classToDeSerialize, parserForClass::apply); return new ProtobufDeserializer<>(parser); } ProtobufSerializationProvider();  ProtobufSerializationProvider(final Function<Class<?>, Parser<?>> parserForClass); }
ProtobufSerializationProvider implements SerializationProvider { @Override @SuppressWarnings("unchecked") public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { requireMessageLite(classToDeSerialize); Parser<T> parser = parsers.computeIfAbsent(classToDeSerialize, parserForClass::apply); return new ProtobufDeserializer<>(parser); } ProtobufSerializationProvider();  ProtobufSerializationProvider(final Function<Class<?>, Parser<?>> parserForClass); @Override StreamingSerializer getSerializer(final Class<T> classToSerialize); @Override StreamingSerializer getSerializer(final TypeHolder<T> typeToSerialize); @Override @SuppressWarnings("unchecked") StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize); @Override StreamingDeserializer<T> getDeserializer(final TypeHolder<T> typeToDeserialize); }
ProtobufSerializationProvider implements SerializationProvider { @Override @SuppressWarnings("unchecked") public <T> StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize) { requireMessageLite(classToDeSerialize); Parser<T> parser = parsers.computeIfAbsent(classToDeSerialize, parserForClass::apply); return new ProtobufDeserializer<>(parser); } ProtobufSerializationProvider();  ProtobufSerializationProvider(final Function<Class<?>, Parser<?>> parserForClass); @Override StreamingSerializer getSerializer(final Class<T> classToSerialize); @Override StreamingSerializer getSerializer(final TypeHolder<T> typeToSerialize); @Override @SuppressWarnings("unchecked") StreamingDeserializer<T> getDeserializer(final Class<T> classToDeSerialize); @Override StreamingDeserializer<T> getDeserializer(final TypeHolder<T> typeToDeserialize);  }