private VPack( IDictionary <Type, IVPackSerializer> serializers, IDictionary <Type, IVPackDeserializer> deserializers, IDictionary <Type, IVPackInstanceCreator> instanceCreators, VPackBuilder.IBuilderOptions builderOptions, bool serializeNullValues, IVPackFieldNamingStrategy fieldNamingStrategy, IDictionary <string, IDictionary <Type, IVPackDeserializer> > deserializersByName) { this.serializers = serializers; this.deserializers = deserializers; this.instanceCreators = instanceCreators; this.builderOptions = builderOptions; this.serializeNullValues = serializeNullValues; this.deserializersByName = deserializersByName; this.keyMapAdapters = new Dictionary <Type, IVPackKeyMapAdapter>(); this.cache = new VPackCache(fieldNamingStrategy); this.serializationContext = new _VPackSerializationContext_209(this); this.deserializationContext = new _VPackDeserializationContext_216(this); this.keyMapAdapters[typeof(string)] = VPackKeyMapAdapters.STRING; this.keyMapAdapters[typeof(bool)] = VPackKeyMapAdapters.BOOLEAN; this.keyMapAdapters[typeof(int)] = VPackKeyMapAdapters.INTEGER; this.keyMapAdapters[typeof(long)] = VPackKeyMapAdapters.LONG; this.keyMapAdapters[typeof(short)] = VPackKeyMapAdapters.SHORT; this.keyMapAdapters[typeof(double)] = VPackKeyMapAdapters.DOUBLE; this.keyMapAdapters[typeof(float)] = VPackKeyMapAdapters.FLOAT; this.keyMapAdapters[typeof(BigInteger)] = VPackKeyMapAdapters.BIG_INTEGER; this.keyMapAdapters[typeof(decimal)] = VPackKeyMapAdapters.NUMBER; this.keyMapAdapters[typeof(char)] = VPackKeyMapAdapters.CHARACTER; }
public Builder() { this.serializers = new Dictionary <Type, IVPackSerializer>(); this.deserializers = new Dictionary <Type, IVPackDeserializer>(); this.deserializersByName = new Dictionary <string, IDictionary <Type, IVPackDeserializer> >(); this.instanceCreators = new Dictionary <Type, IVPackInstanceCreator>(); this.builderOptions = new DefaultVPackBuilderOptions(); this.serializeNullValues = false; this.instanceCreators[typeof(IEnumerable)] = VPackInstanceCreators.COLLECTION; this.instanceCreators[typeof(IList)] = VPackInstanceCreators.LIST; this.instanceCreators[typeof(IDictionary)] = VPackInstanceCreators.MAP; this.serializers[typeof(string)] = VPackSerializers.STRING; this.serializers[typeof(bool)] = VPackSerializers.BOOLEAN; this.serializers[typeof(int)] = VPackSerializers.INTEGER; this.serializers[typeof(long)] = VPackSerializers.LONG; this.serializers[typeof(short)] = VPackSerializers.SHORT; this.serializers[typeof(double)] = VPackSerializers.DOUBLE; this.serializers[typeof(float)] = VPackSerializers.FLOAT; this.serializers[typeof(BigInteger)] = VPackSerializers.BIG_INTEGER; this.serializers[typeof(decimal)] = VPackSerializers.NUMBER; this.serializers[typeof(char)] = VPackSerializers.CHARACTER; this.serializers[typeof(DateTime)] = VPackSerializers.DATE; this.serializers[typeof(VPackSlice)] = VPackSerializers.VPACK; this.deserializers[typeof(string)] = VPackDeserializers.STRING; this.deserializers[typeof(bool)] = VPackDeserializers.BOOLEAN; this.deserializers[typeof(int)] = VPackDeserializers.INTEGER; this.deserializers[typeof(long)] = VPackDeserializers.LONG; this.deserializers[typeof(short)] = VPackDeserializers.SHORT; this.deserializers[typeof(double)] = VPackDeserializers.DOUBLE; this.deserializers[typeof(float)] = VPackDeserializers.FLOAT; this.deserializers[typeof(BigInteger)] = VPackDeserializers.BIG_INTEGER; this.deserializers[typeof(decimal)] = VPackDeserializers.NUMBER; this.deserializers[typeof(char)] = VPackDeserializers.CHARACTER; this.deserializers[typeof(DateTime)] = VPackDeserializers.DATE; this.deserializers[typeof(VPackSlice)] = VPackDeserializers.VPACK; }