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; }
/** * add an xdoclet. * * @param sName * xdoclet name * @return XDoclect to be filled */ @Nonnull public ICommonsMap <String, String> addXdoclet (@Nonnull final String sName) { ValueEnforcer.notNull (sName, "Name"); ICommonsMap <String, String> aMap = m_aXDoclets.get (sName); if (aMap == null) { aMap = new CommonsHashMap<> (); m_aXDoclets.put (sName, aMap); } return aMap; }
/** * A final overload of "init". Overload "init" instead. */ @Override public final void init (@Nonnull final ServletConfig aSC) throws ServletException { super.init (aSC); m_aStatusMgr.onServletInit (getClass ()); try { // Build init parameter map final ICommonsMap <String, String> aInitParams = new CommonsHashMap <> (); final Enumeration <String> aEnum = aSC.getInitParameterNames (); while (aEnum.hasMoreElements ()) { final String sName = aEnum.nextElement (); aInitParams.put (sName, aSC.getInitParameter (sName)); } // Invoke each handler for potential initialization m_aHandlerRegistry.forEachHandlerThrowing (x -> x.onServletInit (aInitParams)); } catch (final ServletException ex) { m_aStatusMgr.onServletInitFailed (ex, getClass ()); throw ex; } }
/** * 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; }
/** * @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. */ @Nonnull default ICommonsMap <String, IFileItem []> getAllUploadedFileItemsComplete () { final ICommonsMap <String, IFileItem []> ret = new CommonsHashMap <> (); for (final Map.Entry <String, Object> aEntry : entrySet ()) { final String sAttrName = aEntry.getKey (); final Object aAttrValue = aEntry.getValue (); if (aAttrValue instanceof IFileItem) ret.put (sAttrName, new IFileItem [] { (IFileItem) aAttrValue }); else if (aAttrValue instanceof IFileItem []) ret.put (sAttrName, ArrayHelper.getCopy ((IFileItem []) aAttrValue)); } return ret; }