/** * Instantiates a new metadata. * * @param descriptor the descriptor * @param defaultInstance the default instance * @param keyType the key type * @param valueType the value type */ public Metadata(Descriptor descriptor, MapEntry<K, V> defaultInstance, WireFormat.FieldType keyType, WireFormat.FieldType valueType) { super(keyType, defaultInstance.key, valueType, defaultInstance.value); this.descriptor = descriptor; this.parser = new AbstractParser<MapEntry<K, V>>() { @Override public MapEntry<K, V> parsePartialFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException { return new MapEntry<K, V>(Metadata.this, input, extensionRegistry); } }; }