@Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <String> getAllExtensions () { final ICommonsOrderedSet <String> ret = new CommonsLinkedHashSet <> (); ret.addAllMapped (m_aExtensions, ExtensionWithSource::getExtension); return ret; }
@Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <ICSSPathProvider> getAllItems () { return m_aRWLock.readLocked ( () -> new CommonsLinkedHashSet<> (m_aList)); }
@Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <IJSPathProvider> getAllItems () { return m_aRWLock.readLocked ( () -> new CommonsLinkedHashSet<> (m_aList)); }
@Nonnull @ReturnsMutableCopy public static ICommonsOrderedSet <IFontResource> getAllResourcesOfFontWeight (@Nullable final IFontWeight aFontWeight) { if (aFontWeight == null) return new CommonsLinkedHashSet <> (); return getAllResources (f -> f.getFontWeight ().equals (aFontWeight)); } }
public ICommonsList <String> getPropertyGroups (final String sPrefix) { final ICommonsSet <String> groups = new CommonsLinkedHashSet <> (10); String sRealPrefix = sPrefix; if (!sRealPrefix.endsWith (".")) sRealPrefix += "."; for (final String sKey : m_aProps.keySet ()) { if (sKey.startsWith (sRealPrefix)) { final String groupName = sKey.substring (sRealPrefix.length (), sKey.indexOf ('.', sRealPrefix.length ())); groups.add (groupName); } } return groups.getCopyAsList (); }
@Nullable @ReturnsMutableCopy public static ICommonsOrderedSet <Character> getAllInvalidXMLAttributeValueChars (@Nonnull final EXMLSerializeVersion eXMLVersion, @Nullable final char [] aChars, @Nonnegative final int nOfs, @Nonnegative final int nLen) { if (aChars == null || nLen <= 0) return null; final ICommonsOrderedSet <Character> aRes = new CommonsLinkedHashSet <> (); for (int i = 0; i < nLen; ++i) { final char c = aChars[nOfs + i]; if (isInvalidXMLAttributeValueChar (eXMLVersion, c)) aRes.add (Character.valueOf (c)); } return aRes; }
@Nullable @ReturnsMutableCopy public static ICommonsOrderedSet <Character> getAllInvalidXMLTextChars (@Nonnull final EXMLSerializeVersion eXMLVersion, @Nullable final char [] aChars, @Nonnegative final int nOfs, @Nonnegative final int nLen) { if (aChars == null || nLen <= 0) return null; final ICommonsOrderedSet <Character> aRes = new CommonsLinkedHashSet <> (); for (int i = 0; i < nLen; ++i) { final char c = aChars[nOfs + i]; if (isInvalidXMLTextChar (eXMLVersion, c)) aRes.add (Character.valueOf (c)); } return aRes; }
@Nullable @ReturnsMutableCopy public static ICommonsOrderedSet <Character> getAllInvalidXMLCDATAChars (@Nonnull final EXMLSerializeVersion eXMLVersion, @Nullable final char [] aChars, @Nonnegative final int nOfs, @Nonnegative final int nLen) { if (aChars == null || nLen <= 0) return null; final ICommonsOrderedSet <Character> aRes = new CommonsLinkedHashSet <> (); for (int i = 0; i < nLen; ++i) { final char c = aChars[nOfs + i]; if (isInvalidXMLCDATAChar (eXMLVersion, c)) aRes.add (Character.valueOf (c)); } return aRes; }
@Nonnull @ReturnsMutableCopy public static ICommonsOrderedSet <IFontResource> getAllResourcesOfFontType (@Nullable final String sFontName) { if (StringHelper.hasNoText (sFontName)) return new CommonsLinkedHashSet <> (); return getAllResources (f -> f.getFontName ().equals (sFontName)); }
@Nonnull @ReturnsMutableCopy public static ICommonsOrderedSet <IFontResource> getAllResourcesOfFontType (@Nullable final EFontType eFontType) { if (eFontType == null) return new CommonsLinkedHashSet <> (); return getAllResources (f -> f.getFontType ().equals (eFontType)); }
@Nullable @ReturnsMutableCopy public static ICommonsOrderedSet <Character> getAllInvalidXMLNameChars (@Nonnull final EXMLSerializeVersion eXMLVersion, @Nullable final char [] aChars, @Nonnegative final int nOfs, @Nonnegative final int nLen) { if (aChars == null || nLen <= 0) return null; final ICommonsOrderedSet <Character> aRes = new CommonsLinkedHashSet <> (); int nIndex = 0; for (int i = 0; i < nLen; ++i) { final char c = aChars[nOfs + i]; if (nIndex == 0) { if (isInvalidXMLNameStartChar (eXMLVersion, c)) aRes.add (Character.valueOf (c)); } else { if (isInvalidXMLNameChar (eXMLVersion, c)) aRes.add (Character.valueOf (c)); } ++nIndex; } return aRes; }
/** * Get all extensions associated to the specified mime type * * @param aMimeType * The mime type to search. May be <code>null</code>. * @return Never <code>null</code> but empty set if no extensions are present. */ @Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <String> getAllExtensionsOfMimeType (@Nullable final IMimeType aMimeType) { final ICommonsOrderedSet <String> ret = new CommonsLinkedHashSet <> (); final ICommonsList <MimeTypeInfo> aInfos = getAllInfosOfMimeType (aMimeType); if (aInfos != null) for (final MimeTypeInfo aInfo : aInfos) ret.addAll (aInfo.getAllExtensions ()); return ret; }
/** * @return A non-<code>null</code> set with all JS paths to be included in * this request. */ @Nonnull @ReturnsMutableCopy public static ICommonsOrderedSet <IJSPathProvider> getAllRegisteredJSIncludesForThisRequest () { final JSResourceSet aSet = _getPerRequestSet (false); if (aSet == null) return new CommonsLinkedHashSet <> (); aSet.markAsCollected (); return aSet.getAllItems (); }
/** * @return A non-<code>null</code> set with all CSS paths to be included in * this request. */ @Nonnull @ReturnsMutableCopy public static ICommonsOrderedSet <ICSSPathProvider> getAllRegisteredCSSIncludesForThisRequest () { final CSSResourceSet aSet = _getPerRequestSet (false); if (aSet == null) return new CommonsLinkedHashSet <> (); aSet.markAsCollected (); return aSet.getAllItems (); }
/** * Get all globs (=filename patterns) associated to the specified mime type * * @param aMimeType * The mime type to search. May be <code>null</code>. * @return Never <code>null</code> but empty set if no globs are present. */ @Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <String> getAllGlobsOfMimeType (@Nullable final IMimeType aMimeType) { final ICommonsOrderedSet <String> ret = new CommonsLinkedHashSet <> (); final ICommonsList <MimeTypeInfo> aInfos = getAllInfosOfMimeType (aMimeType); if (aInfos != null) for (final MimeTypeInfo aInfo : aInfos) ret.addAll (aInfo.getAllGlobs ()); return ret; } }
/** * @return A non-<code>null</code> set with all mime types known to this * instance. */ @Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <IMimeType> getAllMimeTypes () { final ICommonsOrderedSet <IMimeType> ret = new CommonsLinkedHashSet <> (); m_aRWLock.readLocked ( () -> m_aList.forEach (i -> ret.addAll (i.getAllMimeTypes ()))); return ret; }
/** * @return A non-<code>null</code> set with all mime types known to this * instance. */ @Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <String> getAllMimeTypeStrings () { final ICommonsOrderedSet <String> ret = new CommonsLinkedHashSet <> (); m_aRWLock.readLocked ( () -> m_aList.forEach (i -> ret.addAll (i.getAllMimeTypeStrings ()))); return ret; }
/** * Find all proxy settings matching the provided parameters. * * @param sProtocol * Destination server protocol. * @param sHostName * Destination host name * @param nPort * Destination port * @return A non-<code>null</code> set with all matching proxy settings. A set * is used to avoid that the same settings are used more than once. */ @Nonnull @ReturnsMutableCopy public static ICommonsOrderedSet <IProxySettings> findAllProxySettings (@Nullable final String sProtocol, @Nullable final String sHostName, @CheckForSigned final int nPort) { final ICommonsOrderedSet <IProxySettings> ret = new CommonsLinkedHashSet <> (); for (final IProxySettingsProvider aProvider : getAllProviders ()) ret.addAll (aProvider.getAllProxySettings (sProtocol, sHostName, nPort)); return ret; }
/** * Get all mime types that are associated to the specified filename extension. * * @param sExtension * The filename extension to search. May not be <code>null</code>. * @return Never <code>null</code> but maybe empty set if no mime type is * associated with the passed extension. */ @Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <String> getAllMimeTypeStringsForExtension (@Nonnull final String sExtension) { ValueEnforcer.notNull (sExtension, "Extension"); final ICommonsOrderedSet <String> ret = new CommonsLinkedHashSet <> (); final ICommonsList <MimeTypeInfo> aInfos = getAllInfosOfExtension (sExtension); if (aInfos != null) for (final MimeTypeInfo aInfo : aInfos) ret.addAll (aInfo.getAllMimeTypeStrings ()); return ret; }
/** * Get all mime types that are associated to the specified filename extension. * * @param sExtension * The filename extension to search. May not be <code>null</code>. * @return Never <code>null</code> but maybe empty set if no mime type is * associated with the passed extension. */ @Nonnull @ReturnsMutableCopy public ICommonsOrderedSet <IMimeType> getAllMimeTypesForExtension (@Nonnull final String sExtension) { ValueEnforcer.notNull (sExtension, "Extension"); final ICommonsOrderedSet <IMimeType> ret = new CommonsLinkedHashSet <> (); final ICommonsList <MimeTypeInfo> aInfos = getAllInfosOfExtension (sExtension); if (aInfos != null) for (final MimeTypeInfo aInfo : aInfos) ret.addAll (aInfo.getAllMimeTypes ()); return ret; }