private static Pair<String, String> getGivenAndFamilyNames(StructuredName structuredName) { return Pair.of(structuredName.getGiven(), structuredName.getFamily()); }
private static Pair<String, String> getGivenAndFamilyValues(Name name) { return Pair.of(name.getGivenName(), name.getFamilyName()); }
.collect(Collectors.toList()); assertThat(actualPrimaryNameValues) .containsExactly(Pair.of(primaryGivenName, primaryFamilyName)); List<String> actualPrimaryNameSourceValues = actualPrimaryNames
.collect(Collectors.toList()); assertThat(actualPrimaryNamesValues) .containsExactly(Pair.of(primaryGivenName, primaryFamilyName)); List<String> actualPrimarySourceValues = actualPrimaryNames assertThat(actualAlternateNamesValues) .containsExactly( Pair.of(alternateGivenName1, alternateFamilyName1), Pair.of(alternateGivenName2, alternateFamilyName2)); List<String> actualAlternateSourceValues = actualAlternateNames
/** * Returns the extension description for the namespace URI and local name for * the XML element based on the extension point in the extension profile. * * @param extProfile extension profile * @param extPoint extension point to use from the extension profile * @param namespaceUri namespace URI of the XML element * @param localName name of the XML element */ protected ExtensionDescription getExtensionDescription( ExtensionProfile extProfile, Class<? extends ExtensionPoint> extPoint, String namespaceUri, String localName) { // find the extension manifest ExtensionManifest profManifest = getManifest(extProfile, extPoint); if (profManifest == null) { return null; } // look for an explicit match of the namespace URI and local name ExtensionDescription extDescription = profManifest.supportedExtensions.get(Pair.of(namespaceUri, localName)); // look for a match of the namespace URI with a wildcard local name if (extDescription == null) { extDescription = profManifest.supportedExtensions.get(Pair.of(namespaceUri, "*")); } return extDescription; }
/** * Returns the extension description for the namespace URI and local name for * the XML element based on the extension point in the extension profile. * * @param extProfile extension profile * @param extPoint extension point to use from the extension profile * @param namespaceUri namespace URI of the XML element * @param localName name of the XML element */ protected ExtensionDescription getExtensionDescription( ExtensionProfile extProfile, Class<? extends ExtensionPoint> extPoint, String namespaceUri, String localName) { // find the extension manifest ExtensionManifest profManifest = getManifest(extProfile, extPoint); if (profManifest == null) { return null; } // look for an explicit match of the namespace URI and local name ExtensionDescription extDescription = profManifest.supportedExtensions.get(Pair.of(namespaceUri, localName)); // look for a match of the namespace URI with a wildcard local name if (extDescription == null) { extDescription = profManifest.supportedExtensions.get(Pair.of(namespaceUri, "*")); } return extDescription; }
/** * Returns the extension description for the namespace URI and local name for * the XML element based on the extension point in the extension profile. * * @param extProfile extension profile * @param extPoint extension point to use from the extension profile * @param namespaceUri namespace URI of the XML element * @param localName name of the XML element */ protected ExtensionDescription getExtensionDescription( ExtensionProfile extProfile, Class<? extends ExtensionPoint> extPoint, String namespaceUri, String localName) { // find the extension manifest ExtensionManifest profManifest = getManifest(extProfile, extPoint); if (profManifest == null) { return null; } // look for an explicit match of the namespace URI and local name ExtensionDescription extDescription = profManifest.supportedExtensions.get(Pair.of(namespaceUri, localName)); // look for a match of the namespace URI with a wildcard local name if (extDescription == null) { extDescription = profManifest.supportedExtensions.get(Pair.of(namespaceUri, "*")); } return extDescription; }
private CompletableFuture<WCADomainsResult> createDomainsTaskWithDeps(Contingency contingency, String baseStateId, List<SecurityRuleExpression> securityRuleExpressions, Supplier<CompletableFuture<Uncertainties>> memoizedUncertaintiesFuture, Supplier<CompletableFuture<WCAHistoLimits>> histoLimitsFuture, StringToIntMapper<AmplSubset> mapper, List<String> preventiveStateIds, List<String> preventiveActionIds, boolean activateFiltering) { return memoizedUncertaintiesFuture.get() .thenCombine(histoLimitsFuture.get(), (uncertainties, histoLimits) -> Pair.of(uncertainties, histoLimits)) .thenCompose(p -> createDomainsTask(contingency, baseStateId, securityRuleExpressions, p.getFirst(), p.getSecond(), mapper, preventiveStateIds, preventiveActionIds, activateFiltering)); }
private CompletableFuture<WCAClustersResult> createClustersTaskWithDeps(Contingency contingency, List<String> curativeActionIds, String baseStateId, String contingencyStateId, List<String> curativeStateIds, List<SecurityRuleExpression> securityRuleExpressions, Supplier<CompletableFuture<Uncertainties>> memoizedUncertaintiesFuture, Supplier<CompletableFuture<WCAHistoLimits>> histoLimitsFuture, StringToIntMapper<AmplSubset> mapper, boolean activateFiltering) { return memoizedUncertaintiesFuture.get() .thenCombine(histoLimitsFuture.get(), (uncertainties, histoLimits) -> Pair.of(uncertainties, histoLimits)) .thenCompose(p -> createClustersTask(contingency, curativeActionIds, baseStateId, contingencyStateId, curativeStateIds, securityRuleExpressions, p.getFirst(), p.getSecond(), mapper, activateFiltering)); }
private Pair<Iterator<BaseContentEntry<?>>, Integer> catchException(Exception e, int start, int num) { String message = "Error retrieving response from query."; LOGGER.log(Level.WARNING, message, e); if (num == 1) { Iterator<BaseContentEntry<?>> itr = Iterators.emptyIterator(); return Pair.of(itr, 1); } else { int num1 = num/2; int num2 = num - num1; Pair<Iterator<BaseContentEntry<?>>, Integer> pair1 = getEntries(start, num1); Pair<Iterator<BaseContentEntry<?>>, Integer> pair2 = getEntries(start + num1, num2); Iterator<BaseContentEntry<?>> itr = Iterators.concat(pair1.getFirst(), pair2.getFirst()); int numReturned = pair1.getSecond() + pair2.getSecond(); return Pair.of(itr, numReturned); } } }
/** * Returns an iterator containing the valid entries with indices between * {@code start} and {@code start}+{@code num}-1 and the number of entries * the iterator contains. */ private Pair<Iterator<BaseContentEntry<?>>, Integer> getEntries(int start, int num) { Query query = new ContentQuery(feedUrl); try { int numReturned = 0; Iterator<BaseContentEntry<?>> itr = Iterators.emptyIterator(); List<BaseContentEntry<?>> entries; do { query.setStartIndex(start + numReturned); query.setMaxResults(num - numReturned); entries = entryProvider.getEntries(query, sitesService); numReturned += entries.size(); itr = Iterators.concat(itr, entries.iterator()); } while (numReturned < num && entries.size() > 0); return Pair.of(itr, numReturned); } catch (IOException e) { return catchException(e, start, num); } catch (ServiceException e) { return catchException(e, start, num); } }
Element resolved = child.resolve(childMeta, vc); if (resolved != child) { replacements.add(Pair.of(child, resolved));
Element resolved = child.resolve(childMeta, vc); if (resolved != child) { replacements.add(Pair.of(child, resolved));
Element resolved = child.resolve(childMeta, vc); if (resolved != child) { replacements.add(Pair.of(child, resolved));