public override IDictionary <string, Value> IndexConfig() { IDictionary <string, Value> indexConfig = new Dictionary <string, Value>(); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: InstanceSelector.transform(IndexAccessor::indexConfig).forEach(source => IndexConfigProvider.putAllNoOverwrite(indexConfig, source)); return(indexConfig); }
public override IDictionary <string, Value> IndexConfig() { IDictionary <string, Value> indexConfig = new Dictionary <string, Value>(); foreach (IndexPopulator part in this) { IndexConfigProvider.putAllNoOverwrite(indexConfig, part.IndexConfig()); } return(indexConfig); }
public override IDictionary <string, Value> IndexConfig() { IDictionary <string, Value> indexConfig = new Dictionary <string, Value>(); //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: for (NativeIndexAccessor<?,?> part : this) foreach (NativeIndexAccessor <object, ?> part in this) { IndexConfigProvider.putAllNoOverwrite(indexConfig, part.indexConfig()); } return(indexConfig); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void putAllNoOverwriteMustAddToSource() internal virtual void PutAllNoOverwriteMustAddToSource() { IDictionary <string, Value> target = new Dictionary <string, Value>(); IDictionary <string, Value> source = new Dictionary <string, Value>(); target["a"] = Values.intValue(1); source["b"] = Values.intValue(2); IndexConfigProvider.putAllNoOverwrite(target, source); assertEquals(2, target.Count); assertEquals(Values.intValue(1), target["a"]); assertEquals(Values.intValue(2), target["b"]); assertEquals(1, source.Count); assertEquals(Values.intValue(2), source["b"]); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void putAllNoOverwriteMustThrowOnConflict() internal virtual void PutAllNoOverwriteMustThrowOnConflict() { IDictionary <string, Value> target = new Dictionary <string, Value>(); IDictionary <string, Value> source = new Dictionary <string, Value>(); target["a"] = Values.intValue(1); source["a"] = Values.intValue(2); System.InvalidOperationException e = assertThrows(typeof(System.InvalidOperationException), () => IndexConfigProvider.putAllNoOverwrite(target, source)); assertEquals("Adding config would overwrite existing value: key=a, newValue=Int(2), oldValue=Int(1)", e.Message); }