@Nonnull @ReturnsMutableCopy public ICommonsSortedMap <Integer, UAProfileDiff> getProfileDiffData () { // May be null return new CommonsTreeMap <> (m_aProfileDiffData); }
@Nonnull @ReturnsMutableCopy private static ICommonsNavigableMap <String, String> _createMap () { return new CommonsTreeMap <> (IComparator.getComparatorStringLongestFirst ()); }
@Nonnull @ReturnsMutableCopy private static ICommonsNavigableMap <String, String> _createMap () { return new CommonsTreeMap <> (IComparator.getComparatorStringLongestFirst ()); }
public UAProfile (@Nullable final List <String> aProfileUrls, @Nullable final Map <Integer, UAProfileDiff> aProfileDiffData) { final int nUrls = CollectionHelper.getSize (aProfileUrls); final int nDiffs = CollectionHelper.getSize (aProfileDiffData); if (nUrls == 0 && nDiffs == 0) throw new IllegalArgumentException ("Neither profile nor diff data found!"); if (nUrls > 1) if (LOGGER.isWarnEnabled ()) LOGGER.warn ("Found more than one profile URL: " + aProfileUrls); m_sProfileUrl = CollectionHelper.getFirstElement (aProfileUrls); m_aProfileDiffData = CollectionHelper.isEmpty (aProfileDiffData) ? null : new CommonsTreeMap <> (aProfileDiffData); }
protected final void logInitParameters (@Nonnull final ServletContext aSC) { // Put them in a sorted map final ICommonsNavigableMap <String, String> aParams = new CommonsTreeMap <> (); final Enumeration <?> aEnum = aSC.getInitParameterNames (); while (aEnum.hasMoreElements ()) { final String sName = (String) aEnum.nextElement (); final String sValue = aSC.getInitParameter (sName); aParams.put (sName, sValue); } if (aParams.isEmpty ()) LOGGER.info ("No servlet context init-parameters present"); else { // Emit them LOGGER.info ("Servlet context init-parameters:"); for (final Map.Entry <String, String> aEntry : aParams.entrySet ()) LOGGER.info (" " + aEntry.getKey () + "=" + aEntry.getValue ()); } }
@Nonnull @ReturnsMutableCopy public ICommonsNavigableMap <String, String> getStringReplacementMap (@Nonnull final List <PSParam> aParams) { final ICommonsNavigableMap <String, String> ret = new CommonsTreeMap <> (IComparator.getComparatorStringLongestFirst ()); for (final PSParam aParam : aParams) ret.put (PARAM_VARIABLE_PREFIX + aParam.getName (), aParam.getValue ()); return ret; }
@Nonnull @ReturnsMutableCopy public ICommonsNavigableMap <String, String> getStringReplacementMap (@Nonnull final List <PSParam> aParams) { final ICommonsNavigableMap <String, String> ret = new CommonsTreeMap <> (IComparator.getComparatorStringLongestFirst ()); for (final PSParam aParam : aParams) ret.put (PARAM_VARIABLE_PREFIX + aParam.getName (), aParam.getValue ()); return ret; }
final ICommonsSortedMap <QName, String> aNamespaceAttrs = new CommonsTreeMap <> (CXML.getComparatorQNameForNamespacePrefix ()); final ICommonsSortedMap <QName, String> aNonNamespaceAttrs = new CommonsTreeMap <> (CXML.getComparatorQNameNamespaceURIBeforeLocalPart ()); for (final Map.Entry <QName, String> aEntry : aAttrs.entrySet ())
@Nonnull @ReturnsMutableCopy public ICommonsSortedMap <IParticipantIdentifier, MutableInt> getAllContainedParticipantIDs (@Nonnull final EQueryMode eQueryMode) { // Map from ID to entity count final ICommonsSortedMap <IParticipantIdentifier, MutableInt> aTargetSet = new CommonsTreeMap <> (); final Query aQuery = eQueryMode.getEffectiveQuery (new MatchAllDocsQuery ()); try { final ObjIntConsumer <Document> aConsumer = (aDoc, nDocID) -> { final IParticipantIdentifier aResolvedParticipantID = PDField.PARTICIPANT_ID.getDocValue (aDoc); aTargetSet.computeIfAbsent (aResolvedParticipantID, k -> new MutableInt (0)).inc (); }; final Collector aCollector = new AllDocumentsCollector (m_aLucene, aConsumer); searchAtomic (aQuery, aCollector); } catch (final IOException ex) { LOGGER.error ("Error searching for documents with query " + aQuery, ex); } return aTargetSet; }