Exemple #1
0
        public virtual VariableSerializers join(VariableSerializers other)
        {
            DefaultVariableSerializers copy = new DefaultVariableSerializers();

            // "other" serializers override existing ones if their names match
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (TypedValueSerializer<?> thisSerializer : serializerList)
            foreach (TypedValueSerializer <object> thisSerializer in serializerList)
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: TypedValueSerializer<?> serializer = other.getSerializerByName(thisSerializer.getName());
                TypedValueSerializer <object> serializer = other.getSerializerByName(thisSerializer.Name);

                if (serializer == null)
                {
                    serializer = thisSerializer;
                }

                copy.addSerializer(serializer);
            }

            // add all "other" serializers that did not exist before to the end of the list
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (TypedValueSerializer<?> otherSerializer : other.getSerializers())
            foreach (TypedValueSerializer <object> otherSerializer in other.Serializers)
            {
                if (!copy.serializerMap.ContainsKey(otherSerializer.Name))
                {
                    copy.addSerializer(otherSerializer);
                }
            }


            return(copy);
        }
Exemple #2
0
        public DefaultVariableSerializers(DefaultVariableSerializers serializers)
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: this.serializerList.addAll(serializers.serializerList);
            ((IList <TypedValueSerializer <object> >) this.serializerList).AddRange(serializers.serializerList);
//JAVA TO C# CONVERTER TODO TASK: There is no .NET Dictionary equivalent to the Java 'putAll' method:
            this.serializerMap.putAll(serializers.serializerMap);
        }