@Override @Nullable public final IMicroNode getFirstChild () { return m_aChildren == null ? null : m_aChildren.getFirst (); }
@Nullable public String getDefaultMenuItemID () { return m_aDefaultMenuItemIDs.getFirst (); }
@Override @Nullable public final ITEMTYPE getFirstChild () { return m_aChildren == null ? null : m_aChildren.getFirst (); }
@Nullable public TypeaheadDataset getFirstDataset () { return m_aDatasets.getFirst (); }
/** * @return The first MIC algorithm contained in the list. May be * <code>null</code> if no MIC algorithm is set. */ @Nullable public ECryptoAlgorithmSign getFirstMICAlg () { return m_aMICAlgs.getFirst (); }
@Nonnull public Locale getLocale () { // One element is added in ctor! return m_aLocales.getFirst (); }
@Override @Nullable public final ITEMTYPE getFirstChild () { return m_aChildren == null ? null : m_aChildren.getFirst (); }
@Nonnull public ECSSProperty getProp () { return m_aValues.getFirst ().getProp (); }
/** * Add a new prefix-namespace URI mapping at the current stack level * * @param sPrefix * Prefix to use. May be <code>null</code>. * @param sNamespaceURI * Namespace URI to use. May neither be <code>null</code> nor empty. */ public void addNamespaceMapping (@Nullable final String sPrefix, @Nonnull @Nonempty final String sNamespaceURI) { // Add the namespace to the current level m_aStack.getFirst ().addPrefixNamespaceMapping (sPrefix, sNamespaceURI); }
@Nullable public String getHeader (@Nonnull final String sName) { ValueEnforcer.notNull (sName, "HeaderName"); final String sNameLower = sName.toLowerCase (Locale.US); final ICommonsList <String> aHeaderValueList = m_aRWLock.readLocked ( () -> m_aHeaderNameToValueListMap.get (sNameLower)); return aHeaderValueList == null ? null : aHeaderValueList.getFirst (); }
@Nullable public String getFirstExtensionXML () { if (m_aExtensions.isEmpty ()) return null; // Use only the XML element of the first extension final Element aAny = (Element) m_aExtensions.getFirst ().getAny (); return XMLWriter.getNodeAsString (aAny); }
@Nullable public String getFirstExtensionXML () { if (m_aExtensions.isEmpty ()) return null; // Use only the XML element of the first extension final Element aAny = (Element) m_aExtensions.getFirst ().getAny (); return XMLWriter.getNodeAsString (aAny); }
@Nonnull public IJSExpression getAsExpression () { final int nSize = m_aElements.size (); if (nSize == 0) throw new IllegalStateException ("Empty jQuery selector is not allowed!"); if (nSize == 1) return m_aElements.getFirst ().getExpression (); // Concatenate with ' ' IJSExpression ret = m_aElements.getFirst ().getExpression (); for (int i = 1; i < nSize; ++i) ret = ret.plus (' ').plus (m_aElements.get (i).getExpression ()); return ret; }
/** * Get the primary (=first) mime type that is associated to the specified * filename extension. * * @param sExtension * The filename extension to search. May not be <code>null</code>. * @return <code>null</code> if no mime type is associated with the passed * extension. */ @Nullable public IMimeType getPrimaryMimeTypeForExtension (@Nonnull final String sExtension) { ValueEnforcer.notNull (sExtension, "Extension"); final ICommonsList <MimeTypeInfo> aInfos = getAllInfosOfExtension (sExtension); if (aInfos != null && aInfos.isNotEmpty ()) return aInfos.getFirst ().getPrimaryMimeType (); return null; }
/** * Get the primary (=first) mime type that is associated to the specified * filename extension. * * @param sExtension * The filename extension to search. May not be <code>null</code>. * @return <code>null</code> if no mime type is associated with the passed * extension. */ @Nullable public String getPrimaryMimeTypeStringForExtension (@Nonnull final String sExtension) { ValueEnforcer.notNull (sExtension, "Extension"); final ICommonsList <MimeTypeInfo> aInfos = getAllInfosOfExtension (sExtension); if (aInfos != null && aInfos.isNotEmpty ()) return aInfos.getFirst ().getPrimaryMimeTypeString (); return null; }
@Nullable @ReturnsMutableCopy public com.helger.peppol.smp.ExtensionType getAsPeppolExtension () { if (m_aExtensions.isEmpty ()) return null; // Use only the XML element of the first extension final com.helger.peppol.smp.ExtensionType ret = new com.helger.peppol.smp.ExtensionType (); ret.setAny ((Element) m_aExtensions.getFirst ().getAny ()); return ret; }
@Nullable @ReturnsMutableCopy public com.helger.peppol.smp.ExtensionType getAsPeppolExtension () { if (m_aExtensions.isEmpty ()) return null; // Use only the XML element of the first extension final com.helger.peppol.smp.ExtensionType ret = new com.helger.peppol.smp.ExtensionType (); ret.setAny ((Element) m_aExtensions.getFirst ().getAny ()); return ret; }
/** * Find the servlet matching the specified path. * * @param sPath * The path, relative to the servlet context. May be <code>null</code>. * @return <code>null</code> if no {@link Servlet} matching the specified path * was found. If more than one matching servlet was found, the first * one is returned. */ @Nullable public Servlet getServletOfPath (@Nullable final String sPath) { final ICommonsList <ServletItem> aMatchingItems = new CommonsArrayList <> (); if (StringHelper.hasText (sPath)) m_aServlets.findAll (aItem -> aItem.matchesPath (sPath), aMatchingItems::add); final int nMatchingItems = aMatchingItems.size (); if (nMatchingItems == 0) return null; if (nMatchingItems > 1) if (LOGGER.isWarnEnabled ()) LOGGER.warn ("Found more than 1 servlet matching path '" + sPath + "' - using first one: " + aMatchingItems); return aMatchingItems.getFirst ().getServlet (); }
public WebSiteResourceBundle (@Nonnull @Nonempty final List <WebSiteResourceWithCondition> aResources, @Nullable final String sConditionalComment, final boolean bIsBundlable, @Nullable final ICSSMediaList aMediaList) { ValueEnforcer.notEmptyNoNullValue (aResources, "Resources"); m_aResources.addAllMapped (aResources, WebSiteResourceWithCondition::getResource); m_sConditionalComment = sConditionalComment; m_bIsBundlable = bIsBundlable; m_aMediaList = aMediaList == null || aMediaList.hasNoMedia () ? null : new CSSMediaList (aMediaList); m_eResourceType = m_aResources.getFirst ().getResourceType (); // Consistency check for (final WebSiteResourceWithCondition aResource : aResources) if (!aResource.getResource ().getResourceType ().equals (m_eResourceType)) throw new IllegalArgumentException ("The passed resources are mixed of different resource types: " + aResources); }
@Nullable public InvokableAPIDescriptor getMatching (@Nonnull final APIPath aPath, @Nonnull final Function <List <InvokableAPIDescriptor>, InvokableAPIDescriptor> aAmbiguityResolver) { ValueEnforcer.notNull (aPath, "Path"); // Split only once for performance reasons final String sSourcePath = aPath.getPath (); final ICommonsList <String> aPathParts = PathDescriptorHelper.getCleanPathParts (sSourcePath); final ICommonsList <InvokableAPIDescriptor> aMatching = new CommonsArrayList<> (); // HTTP Method must match for (final APIDescriptor aDescriptor : m_aMap.get (aPath.getHTTPMethod ())) { final PathMatchingResult aMatchResult = aDescriptor.getPathDescriptor ().matchesParts (aPathParts); if (aMatchResult.isMatch ()) aMatching.add (new InvokableAPIDescriptor (aDescriptor, sSourcePath, aMatchResult.getAllVariableValues ())); } // Now get the result final int nMatching = aMatching.size (); if (nMatching == 1) { // 1 match - straight forward return aMatching.getFirst (); } // Use the resolver... return aAmbiguityResolver.apply (aMatching); }