/// <summary> /// Mutates the input map by removing entries which do not have keys in the new backing data, as extracted with /// the keyExtractor. </summary> /// <param name="map"> the map to mutate. </param> /// <param name="newBackingData"> the backing data to retain. </param> /// <param name="keyExtractor"> the function to extract keys from the backing data. </param> /// @param <K> type of the key in the input map. </param> /// @param <V> type of the values in the input map. </param> /// @param <T> type of the keys in the new baking data. </param> public static void TrimToList <K, V, T>(IDictionary <K, V> map, IList <T> newBackingData, System.Func <T, K> keyExtractor) { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <K> retainedKeys = newBackingData.Select(keyExtractor).collect(Collectors.toSet()); TrimToList(map, retainedKeys); }
private ISet <ServerInfo> PossibleServers() { //JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET: //ORIGINAL LINE: java.util.stream.Stream<java.util.Map.Entry<org.neo4j.causalclustering.identity.MemberId,? extends org.neo4j.causalclustering.discovery.DiscoveryServerInfo>> infoMap = java.util.stream.Stream.of(topologyService.localReadReplicas(), topologyService.localCoreServers()).map(org.neo4j.causalclustering.discovery.Topology::members).map(java.util.Map::entrySet).flatMap(java.util.Set::stream); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: Stream <KeyValuePair <MemberId, ? extends DiscoveryServerInfo> > infoMap = Stream.of(TopologyService.localReadReplicas(), TopologyService.localCoreServers()).map(Topology::members).map(System.Collections.IDictionary.entrySet).flatMap(ISet <object> .stream); return(infoMap.map(this.toServerInfo).collect(Collectors.toSet())); }
private ISet <string> QueryForRoleNames() { ICollection <AuthorizationInfo> authorizationInfo = _authManager.getAuthorizationInfo(_shiroSubject.Principals); return(authorizationInfo.stream().flatMap(authInfo => { ICollection <string> roles = authInfo.Roles; return roles == null ? Stream.empty() : roles.stream(); }).collect(Collectors.toSet())); }
public virtual ISet <U> MutuallySupportedVersionsFor(ISet <U> requestedVersions) { if (Versions().Count == 0) { return(requestedVersions); } else { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(requestedVersions.Where(Versions().contains).collect(Collectors.toSet())); } }
internal static void RefreshGroups(HazelcastInstance hazelcastInstance, string memberId, IList <string> groups) { MultiMap <string, string> groupsMap = hazelcastInstance.getMultiMap(SERVER_GROUPS_MULTIMAP); ICollection <string> existing = groupsMap.get(memberId); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <string> superfluous = existing.Where(t => !groups.Contains(t)).collect(Collectors.toSet()); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <string> missing = groups.Where(t => !existing.Contains(t)).collect(Collectors.toSet()); missing.forEach(group => groupsMap.put(memberId, group)); superfluous.forEach(group => groupsMap.remove(memberId, group)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldListAllStoreFiles() public virtual void ShouldListAllStoreFiles() { RecordStorageEngine engine = BuildRecordStorageEngine(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.Collection<org.neo4j.storageengine.api.StoreFileMetadata> files = engine.listStorageFiles(); ICollection <StoreFileMetadata> files = engine.ListStorageFiles(); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <File> currentFiles = Files.Select(StoreFileMetadata::file).collect(Collectors.toSet()); // current engine files should contain everything except another count store file and label scan store DatabaseLayout databaseLayout = _testDirectory.databaseLayout(); ISet <File> allPossibleFiles = databaseLayout.StoreFiles(); allPossibleFiles.remove(databaseLayout.CountStoreB()); allPossibleFiles.remove(databaseLayout.LabelScanStore()); assertEquals(currentFiles, allPossibleFiles); }
/// /// <param name="transform"> </param> /// @param <T> /// @return </param> public override ICollection <T> Resolve <T>(System.Func <AdvertisedSocketAddress, T> transform) { return(_advertisedSocketAddresses.stream().flatMap(raw => _hostnameResolver.resolve(raw).stream()).map(transform).collect(Collectors.toSet())); }
public override ISet <string> tokens <T1>(IDictionary <T1> map) { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(map.Keys.Select(k => k.ToString().ToLower(Locale.ENGLISH)).collect(Collectors.toSet())); }
protected internal override bool matchesSafely(ResponseMessage t) { assertThat(t, instanceOf(typeof(SuccessMessage))); IDictionary <string, object> meta = ToRawMap((( SuccessMessage )t).meta()); assertThat(meta.ContainsKey("notifications"), @is(true)); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <Notification> notifications = ((IList <IDictionary <string, object> >)meta["notifications"]).Select(TestNotification.fromMap).collect(Collectors.toSet()); assertThat(notifications, Matchers.contains(_notification)); return(true); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldListNeostoreFiles() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldListNeostoreFiles() { DatabaseLayout layout = _neoStoreDataSource.DatabaseLayout; ISet <File> expectedFiles = layout.StoreFiles(); // there was no rotation expectedFiles.remove(layout.CountStoreB()); ResourceIterator <StoreFileMetadata> storeFiles = _neoStoreDataSource.listStoreFiles(false); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <File> listedStoreFiles = storeFiles.Select(StoreFileMetadata::file).Where(file => !file.Name.Equals(INDEX_DB_FILE_NAME)).collect(Collectors.toSet()); assertEquals(expectedFiles, listedStoreFiles); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: static Policies load(org.neo4j.kernel.configuration.Config config, String pluginName, org.neo4j.logging.Log log) throws InvalidFilterSpecification internal static Policies Load(Config config, string pluginName, Log log) { Policies policies = new Policies(log); string prefix = PolicyPrefix(pluginName); IDictionary <string, string> rawConfig = config.Raw; //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <string> configKeys = rawConfig.Keys.Where(e => e.StartsWith(prefix)).collect(Collectors.toSet()); foreach (string configKey in configKeys) { string policyName = configKey.Substring(prefix.Length); string filterSpec = rawConfig[configKey]; Filter <ServerInfo> filter = FilterConfigParser.Parse(filterSpec); policies.AddPolicy(policyName, new FilteringPolicy(filter)); } return(policies); }
private T DecodeProtocolRequest <U, T>(System.Func <string, ISet <U>, T> constructor, ByteBuf @in, System.Func <ByteBuf, U> versionDecoder) where U : IComparable <U> where T : BaseProtocolRequest <U> { string protocolName = StringMarshal.unmarshal(@in); int versionArrayLength = @in.readInt(); ISet <U> versions = Stream.generate(() => versionDecoder(@in)).limit(versionArrayLength).collect(Collectors.toSet()); return(constructor(protocolName, versions)); }
public override ISet <ServerInfo> Apply(ISet <ServerInfo> data) { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(data.Where(_matchesAnyGroup).collect(Collectors.toSet())); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void procedureCallsShouldReflectMembershipChanges() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ProcedureCallsShouldReflectMembershipChanges() { string dbName = GetFirstDbName(_dbNames); CoreClusterMember follower = _cluster.getMemberWithAnyRole(dbName, Role.FOLLOWER); int followerId = follower.ServerId(); _cluster.removeCoreMemberWithServerId(followerId); CoreGraphDatabase db = _cluster.getMemberWithAnyRole(dbName, Role.FOLLOWER, Role.LEADER).database(); System.Func <CoreGraphDatabase, ISet <Endpoint> > getResult = database => { Optional <MultiClusterRoutingResult> optResult = CallProcedure(database, GET_ROUTERS_FOR_ALL_DATABASES, java.util.Collections.emptyMap()); return(optResult.map(r => r.routers().values().stream().flatMap(System.Collections.IList.stream).collect(Collectors.toSet())).orElse(java.util.Collections.emptySet())); }; assertEventually("The procedure should return one fewer routers when a core member has been removed.", () => getResult(db).size(), @is(_numCores - 1), 15, TimeUnit.SECONDS); System.Func <ISet <Endpoint>, CoreClusterMember, bool> containsFollower = (rs, f) => rs.Any(r => r.address().ToString().Equals(f.boltAdvertisedAddress())); assertEventually("The procedure should not return a host as a router after it has been removed from the cluster", () => containsFollower(getResult(db), follower), @is(false), 15, TimeUnit.SECONDS); CoreClusterMember newFollower = _cluster.addCoreMemberWithId(followerId); newFollower.Start(); assertEventually("The procedure should return one more router when a core member has been added.", () => getResult(db).size(), @is(_numCores), 15, TimeUnit.SECONDS); assertEventually("The procedure should return a core member as a router after it has been added to the cluster", () => containsFollower(getResult(db), newFollower), @is(true), 15, TimeUnit.SECONDS); }
private ISet <string> GetFileNames(ResourceIterator <File> files) { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(Files.Select(File.getAbsolutePath).Where(this.segmentsFilePredicate).collect(Collectors.toSet())); }
internal SpecificReplicasMatcher(ServerPoliciesLoadBalancingIT outerInstance, params Integer[] replicaIds) { this._outerInstance = outerInstance; //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: this.ReplicaIds = java.util.replicaIds.collect(Collectors.toSet()); }
public override bool Matches(object item) { LoadBalancingResult result = ( LoadBalancingResult )item; //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> returnedReaders = result.ReadEndpoints().Select(Endpoint::address).collect(Collectors.toSet()); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> expectedBolts = outerInstance.cluster.ReadReplicas().Where(r => ReplicaIds.Contains(r.serverId())).Select(r => r.clientConnectorAddresses().boltAddress()).collect(Collectors.toSet()); return(expectedBolts.SetEquals(returnedReaders)); }
public override bool Matches(object item) { LoadBalancingResult result = ( LoadBalancingResult )item; if (result.RouteEndpoints().Count != NRouters || result.WriteEndpoints().Count != NWriters) { return(false); } //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> allCoreBolts = outerInstance.cluster.CoreMembers().Select(c => c.clientConnectorAddresses().boltAddress()).collect(Collectors.toSet()); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> returnedCoreReaders = result.ReadEndpoints().Select(Endpoint::address).Where(allCoreBolts.contains).collect(Collectors.toSet()); if (returnedCoreReaders.Count != NCoreReaders) { return(false); } //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> allReplicaBolts = outerInstance.cluster.ReadReplicas().Select(c => c.clientConnectorAddresses().boltAddress()).collect(Collectors.toSet()); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> returnedReplicaReaders = result.ReadEndpoints().Select(Endpoint::address).Where(allReplicaBolts.contains).collect(Collectors.toSet()); if (returnedReplicaReaders.Count != NReplicaReaders) { return(false); } HashSet <AdvertisedSocketAddress> overlap = new HashSet <AdvertisedSocketAddress>(returnedCoreReaders); //JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'retainAll' method: overlap.retainAll(returnedReplicaReaders); if (overlap.Count > 0) { return(false); } //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> returnedWriters = result.WriteEndpoints().Select(Endpoint::address).collect(Collectors.toSet()); //JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'containsAll' method: if (!allCoreBolts.containsAll(returnedWriters)) { return(false); } //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <AdvertisedSocketAddress> returnedRouters = result.RouteEndpoints().Select(Endpoint::address).collect(Collectors.toSet()); //noinspection RedundantIfStatement //JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'containsAll' method: if (!allCoreBolts.containsAll(returnedRouters)) { return(false); } return(true); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void nextAlphaNumericString() public virtual void NextAlphaNumericString() { ISet <int> seenDigits = "ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789".chars().boxed().collect(Collectors.toSet()); for (int i = 0; i < ITERATIONS; i++) { TextValue textValue = RandomValues.nextAlphaNumericTextValue(10, 20); string asString = textValue.StringValue(); for (int j = 0; j < asString.Length; j++) { int ch = asString[j]; assertTrue("Not a character nor letter: " + ch, Character.isAlphabetic(ch) || char.IsDigit(ch)); seenDigits.remove(ch); } } assertThat(seenDigits, empty()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRunDistinctTransactionsAndDiverge() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldRunDistinctTransactionsAndDiverge() { int numNodes = 1; IDictionary <CoreClusterMember, IList <CoreClusterMember> > leaderMap = new Dictionary <CoreClusterMember, IList <CoreClusterMember> >(); foreach (string dbName in _dbNames) { int i = 0; CoreClusterMember leader; do { leader = _cluster.coreTx(dbName, (db, tx) => { Node node = Db.createNode(label("database")); node.setProperty("name", dbName); tx.success(); }); i++; } while (i < numNodes); int leaderId = leader.ServerId(); IList <CoreClusterMember> notLeaders = _cluster.coreMembers().Where(m => m.dbName().Equals(dbName) && m.serverId() != leaderId).ToList(); leaderMap[leader] = notLeaders; numNodes++; } //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <long> nodesPerDb = leaderMap.Keys.Select(DataCreator.countNodes).collect(Collectors.toSet()); assertEquals("Each logical database in the multicluster should have a unique number of nodes.", nodesPerDb.Count, _dbNames.Count); foreach (KeyValuePair <CoreClusterMember, IList <CoreClusterMember> > subCluster in leaderMap.SetOfKeyValuePairs()) { dataMatchesEventually(subCluster.Key, subCluster.Value); } }
//------------------------------------------------------------------------- //JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @ImmutableConstructor private ResolvedCmsLeg(com.opengamma.strata.product.common.PayReceive payReceive, java.util.List<CmsPeriod> cmsPeriods) private ResolvedCmsLeg(PayReceive payReceive, IList <CmsPeriod> cmsPeriods) { this.payReceive = ArgChecker.notNull(payReceive, "payReceive"); this.cmsPeriods = ImmutableList.copyOf(cmsPeriods); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <Currency> currencies = this.cmsPeriods.Select(CmsPeriod::getCurrency).collect(Collectors.toSet()); ArgChecker.isTrue(currencies.Count == 1, "Leg must have a single currency, found: " + currencies); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ISet <SwapIndex> swapIndices = this.cmsPeriods.Select(CmsPeriod::getIndex).collect(Collectors.toSet()); ArgChecker.isTrue(swapIndices.Count == 1, "Leg must have a single swap index: " + swapIndices); }
internal static int CountUniqueValues(IndexEntryUpdate <IndexDescriptor>[] updates) { return(Stream.of(updates).map(update => update.values()[0]).collect(Collectors.toSet()).size()); }
public virtual ISet <CoreClusterMember> HealthyCoreMembers() { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(_coreMembers.Values.Where(db => Db.database().DependencyResolver.resolveDependency(typeof(DatabaseHealth)).Healthy).collect(Collectors.toSet())); }
private void ManuallyCountTotalMappedFileSize(File dir, MutableLong result, NativeIndexFileFilter nativeIndexFilter) { //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: ISet <string> storeFiles = Stream.of(StoreType.values()).filter(StoreType::isRecordStore).map(type => type.DatabaseFile.Name).collect(Collectors.toSet()); foreach (File file in dir.listFiles()) { if (file.Directory) { ManuallyCountTotalMappedFileSize(file, result, nativeIndexFilter); } else if (storeFiles.Contains(file.Name) || file.Name.Equals(DatabaseFile.LABEL_SCAN_STORE.Name) || nativeIndexFilter.Accept(file)) { result.add(file.length()); } } }
/// <summary> /// The par spread quotes are converted to points upfronts or quoted spreads. /// <para> /// The relevant discount curve and recovery rate curve must be stored in {@code ratesProvider}. /// The credit curve is internally calibrated to par spread values. /// </para> /// <para> /// {@code trades} must be sorted in ascending order in maturity and coherent to {@code quotes}. /// </para> /// <para> /// The resultant quote is specified by {@code targetConvention}. /// /// </para> /// </summary> /// <param name="trades"> the trades </param> /// <param name="quotes"> the quotes </param> /// <param name="ratesProvider"> the rates provider </param> /// <param name="targetConvention"> the target convention </param> /// <param name="refData"> the reference data </param> /// <returns> the quotes </returns> public virtual IList <CdsQuote> quotesFromParSpread(IList <ResolvedCdsTrade> trades, IList <CdsQuote> quotes, CreditRatesProvider ratesProvider, CdsQuoteConvention targetConvention, ReferenceData refData) { ArgChecker.noNulls(trades, "trades"); ArgChecker.noNulls(quotes, "quotes"); ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(targetConvention, "targetConvention"); ArgChecker.notNull(refData, "refData"); int nNodes = trades.Count; ArgChecker.isTrue(quotes.Count == nNodes, "trades and quotes must be the same size"); quotes.ForEach(q => ArgChecker.isTrue(q.QuoteConvention.Equals(CdsQuoteConvention.PAR_SPREAD), "quote must be par spread")); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: IEnumerator <StandardId> legalEntities = trades.Select(t => t.Product.LegalEntityId).collect(Collectors.toSet()).GetEnumerator(); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: StandardId legalEntityId = legalEntities.next(); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: ArgChecker.isFalse(legalEntities.hasNext(), "legal entity must be common to trades"); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: IEnumerator <Currency> currencies = trades.Select(t => t.Product.Currency).collect(Collectors.toSet()).GetEnumerator(); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: Currency currency = currencies.next(); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: ArgChecker.isFalse(currencies.hasNext(), "currency must be common to trades"); LocalDate valuationDate = ratesProvider.ValuationDate; CreditDiscountFactors discountFactors = ratesProvider.discountFactors(currency); RecoveryRates recoveryRates = ratesProvider.recoveryRates(legalEntityId); NodalCurve creditCurve = calibrator.calibrate(trades, DoubleArray.of(nNodes, q => quotes[q].QuotedValue), DoubleArray.filled(nNodes), CurveName.of("temp"), valuationDate, discountFactors, recoveryRates, refData); CreditRatesProvider ratesProviderNew = ratesProvider.toImmutableCreditRatesProvider().toBuilder().creditCurves(ImmutableMap.of(Pair.of(legalEntityId, currency), LegalEntitySurvivalProbabilities.of(legalEntityId, IsdaCreditDiscountFactors.of(currency, valuationDate, creditCurve)))).build(); System.Func <ResolvedCdsTrade, CdsQuote> quoteValueFunction = createQuoteValueFunction(ratesProviderNew, targetConvention, refData); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: ImmutableList <CdsQuote> result = trades.Select(c => quoteValueFunction(c)).collect(Collectors.collectingAndThen(Collectors.toList(), ImmutableList.copyOf)); return(result); }
public virtual ISet <File> IdFiles() { //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(java.util.DatabaseFile.values().Where(DatabaseFile::hasIdFile).flatMap(value => Streams.ofOptional(idFile(value))).collect(Collectors.toSet())); }
//------------------------------------------------------------------------- protected internal override ICollection <ResourceLocator> getAllResources(string subdirectoryName) { string resolvedSubdirectory = subdirectoryName + "/"; //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: return(entries.Where(e => e.StartsWith(resolvedSubdirectory) && !e.Equals(resolvedSubdirectory)).Select(e => getEntryLocator(rootPath + e)).collect(Collectors.toSet())); }
public virtual ISet <File> StoreFiles() { return(Arrays.stream(DatabaseFile.values()).flatMap(this.file).collect(Collectors.toSet())); }
// check legal entity and currency are common for all of the CDSs protected internal virtual void checkCdsBucket(ResolvedCdsTrade trade, IList <ResolvedCdsTrade> bucketCds) { //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: IEnumerator <StandardId> legalEntities = bucketCds.Select(t => t.Product.LegalEntityId).collect(Collectors.toSet()).GetEnumerator(); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: ArgChecker.isTrue(legalEntities.next().Equals(trade.Product.LegalEntityId), "legal entity must be common"); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: ArgChecker.isFalse(legalEntities.hasNext(), "legal entity must be common"); //JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter: IEnumerator <Currency> currencies = bucketCds.Select(t => t.Product.Currency).collect(Collectors.toSet()).GetEnumerator(); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: ArgChecker.isTrue(currencies.next().Equals(trade.Product.Currency), "currency must be common"); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: ArgChecker.isFalse(currencies.hasNext(), "currency must be common"); }
public override ICollection <AdvertisedSocketAddress> ResolveOnce(AdvertisedSocketAddress initialAddress) { try { ISet <AdvertisedSocketAddress> addresses = _srvRecordResolver.resolveSrvRecord(initialAddress.Hostname).map(srvRecord => new AdvertisedSocketAddress(srvRecord.host, srvRecord.port)).collect(Collectors.toSet()); _userLog.info("Resolved initial host '%s' to %s", initialAddress, addresses); if (addresses.Count == 0) { _log.error("Failed to resolve srv records for '%s'", initialAddress.Hostname); } return(addresses); } catch (NamingException e) { _log.error(string.Format("Failed to resolve srv records for '{0}'", initialAddress.Hostname), e); return(Collections.emptySet()); } }