public AbstractTreeItemWithUniqueIDFactory () { this (new CommonsHashMap <> ()); }
/** * Ctor taking another map. * * @param aVars * Variables to re-use. May be <code>null</code>. */ public MapBasedXPathVariableResolverQName (@Nullable final Map <QName, ?> aVars) { m_aMap = new CommonsHashMap <> (aVars); }
/** * Ctor taking another map. * * @param aVars * Variables to re-use. May be <code>null</code>. */ public MapBasedXPathVariableResolver (@Nullable final Map <String, ?> aVars) { m_aMap = new CommonsHashMap <> (aVars); }
@Nonnull public final EChange setAdditionalParams (@Nullable final Map <String, String> aAdditionalParams) { // Ensure same type final ICommonsMap <String, String> aRealAdditionalParams = new CommonsHashMap <> (aAdditionalParams); if (aRealAdditionalParams.equals (m_aAdditionalParams)) return EChange.UNCHANGED; m_aAdditionalParams = aRealAdditionalParams; return EChange.CHANGED; }
public boolean hasSameContent (@Nullable final String sAppID, @Nullable final String sMenuItemID, @Nullable final Map <String, String> aAdditionalParams) { // Ensure same type final ICommonsMap <String, String> aRealAdditionalParams = new CommonsHashMap <> (aAdditionalParams); return m_sApplicationID.equals (sAppID) && m_sMenuItemID.equals (sMenuItemID) && m_aAdditionalParams.equals (aRealAdditionalParams); }
@Nonnull @ReturnsMutableCopy public final ICommonsMap <String, String> getServletContextInitParameters () { return new CommonsHashMap<> (m_aServletContextInitParameters); }
@Nonnull @ReturnsMutableObject public ICommonsMap <String, Long> trackedFiles () { if (m_aTrackedFiles == null) m_aTrackedFiles = new CommonsHashMap <> (); return m_aTrackedFiles; } }
@Nonnull @ReturnsMutableCopy @VisibleForTesting ICommonsMap <String, String> getParameters () { return new CommonsHashMap <> (m_aCustomParameters); }
public NoModuleException (@Nullable final String sAction, @Nullable final IMessage aMsg, @Nullable final Map <String, Object> aOptions) { super (getAsString (sAction, aMsg, aOptions)); m_sAction = sAction; m_aMsg = aMsg; m_aOptions = new CommonsHashMap <> (aOptions); }
@Nonnull @ReturnsMutableCopy @VisibleForTesting ICommonsMap <String, String> getParameters () { return new CommonsHashMap <> (m_aCustomParameters); }
@Nonnull @ReturnsMutableObject ("by design") protected final ICommonsMap <String, AbstractParameterParser> getParameterParsers () { if (m_aParameterParsers == null) m_aParameterParsers = new CommonsHashMap <> (); return m_aParameterParsers; } }
@Nonnull private static WebappContext _createContext (final String sURI) { final ICommonsMap <String, String> aInitParams = new CommonsHashMap<> (); aInitParams.put ("jersey.config.server.provider.packages", com.helger.peppol.smpserver.rest.ServiceGroupInterface.class.getPackage ().getName () + "," + com.helger.peppol.smpserver.exceptionmapper.RuntimeExceptionMapper.class.getPackage () .getName ()); return _createContext (URI.create (sURI), ServletContainer.class, null, aInitParams, null); }
@Nonnull private static WebappContext _createContext (final String sURI) { final ICommonsMap <String, String> aInitParams = new CommonsHashMap<> (); aInitParams.put ("jersey.config.server.provider.packages", com.helger.peppol.smpserver.rest.ServiceGroupInterface.class.getPackage ().getName () + "," + com.helger.peppol.smpserver.exceptionmapper.RuntimeExceptionMapper.class.getPackage () .getName ()); return _createContext (URI.create (sURI), ServletContainer.class, null, aInitParams, null); }
/** * @return A non-<code>null</code> but maybe empty map with all contained * {@link IFileItem} objects from file uploads. The key of the map is * the field name. Important: if the value is an array of * {@link IFileItem} it is not considered in the returned map! */ @Nonnull default ICommonsMap <String, IFileItem> getAllUploadedFileItems () { final ICommonsMap <String, IFileItem> ret = new CommonsHashMap <> (); for (final Map.Entry <String, Object> aEntry : entrySet ()) { final Object aAttrValue = aEntry.getValue (); if (aAttrValue instanceof IFileItem) ret.put (aEntry.getKey (), (IFileItem) aAttrValue); } return ret; }
public void scheduleJob (final IJobDetail jobDetail, final Set <? extends ITrigger> triggersForJob, final boolean replace) throws SchedulerException { final ICommonsMap <IJobDetail, Set <? extends ITrigger>> triggersAndJobs = new CommonsHashMap <> (); triggersAndJobs.put (jobDetail, triggersForJob); scheduleJobs (triggersAndJobs, replace); }
@Nonnull public ICommonsMap <String, String> getParameters () { final ICommonsMap <String, String> ret = new CommonsHashMap <> (); for (final Map.Entry <String, String []> aEntry : getParameterMap ().entrySet ()) { final String sKey = aEntry.getKey (); final String [] aValues = aEntry.getValue (); if (aValues.length == 0) ret.put (sKey, "[EMPTY]"); else if (aValues.length == 1) ret.put (sKey, aValues[0]); else ret.put (sKey, Arrays.toString (aValues)); } return ret; }
/** * Read a mapping from the passed input stream. * * @param aIS * The input stream to read from. May not be <code>null</code>. * @return <code>null</code> if reading the map failed */ @Nullable @ReturnsMutableCopy public static ICommonsMap <String, String> readMap (@Nonnull @WillClose final InputStream aIS) { final ICommonsMap <String, String> ret = new CommonsHashMap <> (); if (readMap (aIS, ret).isFailure ()) return null; return ret; }
@Nonnull @ReturnsMutableCopy public static ICommonsMap <String, String> getAppIDToServletPathMap () { final ICommonsMap <String, String> ret = new CommonsHashMap <> (); getInstance ().m_aStateMap.forEach ( (sAppID, aState) -> ret.put (sAppID, aState.getServletPath ())); return ret; } }
/** * @return The non-<code>null</code> map with all contained attributes that * implement the {@link IScopeRenewalAware} interface. May be empty. */ @Nonnull @ReturnsMutableCopy default ICommonsMap <String, IScopeRenewalAware> getAllScopeRenewalAwareAttributes () { final ICommonsMap <String, IScopeRenewalAware> ret = new CommonsHashMap <> (); attrs ().forEach ( (n, v) -> { if (v instanceof IScopeRenewalAware) ret.put (n, (IScopeRenewalAware) v); }); return ret; } }
/** * @param aScheduleBuilder * The schedule builder to be used. May not be <code>null</code>. * Example: * <code>SimpleScheduleBuilder.repeatMinutelyForever (60)</code> * @return The created trigger key for further usage. Never <code>null</code>. */ @Nonnull public static TriggerKey schedule (@Nonnull final SimpleScheduleBuilder aScheduleBuilder) { ValueEnforcer.notNull (aScheduleBuilder, "ScheduleBuilder"); final ICommonsMap <String, Object> aJobDataMap = new CommonsHashMap <> (); return GlobalQuartzScheduler.getInstance ().scheduleJob (FailedMailResendJob.class.getName (), JDK8TriggerBuilder.newTrigger () .startNow () .withSchedule (aScheduleBuilder), FailedMailResendJob.class, aJobDataMap); } }