Class PeppolWildcardSelector

java.lang.Object
com.helger.smpclient.peppol.PeppolWildcardSelector

@Immutable public class PeppolWildcardSelector extends Object
Helper class to support the different ways of dealing with peppol-doctype-wildcard scheme in combination with the busdox-docid-qns scheme.
Since:
9.2.0
Author:
Philip Helger
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Defines the different selection modes.
    This was valid for Policy for use of Identifiers 4.2.0.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new wildcard selector using the provided operational mode.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.helger.commons.state.ESuccess
    findPeppolDoctypeWildcardMatch(com.helger.commons.collection.impl.ICommonsList<? extends com.helger.peppolid.IDocumentTypeIdentifier> aBaseDocTypes, com.helger.peppolid.IDocumentTypeIdentifier aSearchDocTypeValue, Consumer<? super com.helger.peppolid.IDocumentTypeIdentifier> aMatchingDocTypeConsumer)
    Helper method to find the best match wildcard document type identifier for PFUOI 4.3.0.
    void
    forEachMatchingDocumentType(com.helger.commons.collection.impl.ICommonsList<? extends com.helger.peppolid.IDocumentTypeIdentifier> aBaseDocTypes, String sDocTypeValue, Function<? super com.helger.peppolid.IDocumentTypeIdentifier,com.helger.commons.state.EContinue> aMatchingDocTypeConsumer)
    Helper method to iterate all matching document type identifiers for PFUOI 4.2.0.
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PeppolWildcardSelector

      public PeppolWildcardSelector(@Nonnull PeppolWildcardSelector.EMode eMode)
      Create a new wildcard selector using the provided operational mode.
      Parameters:
      eMode - The selection mode to use. May not be null.
  • Method Details

    • getMode

      @Nonnull public final PeppolWildcardSelector.EMode getMode()
      Returns:
      The selection mode as provided in the constructor.
    • forEachMatchingDocumentType

      public void forEachMatchingDocumentType(@Nonnull com.helger.commons.collection.impl.ICommonsList<? extends com.helger.peppolid.IDocumentTypeIdentifier> aBaseDocTypes, @Nonnull @Nonempty String sDocTypeValue, @Nonnull Function<? super com.helger.peppolid.IDocumentTypeIdentifier,com.helger.commons.state.EContinue> aMatchingDocTypeConsumer)
      Helper method to iterate all matching document type identifiers for PFUOI 4.2.0. The preference of schemes is defined by the operational mode.
      Parameters:
      aBaseDocTypes - The list of document types to filter. Usually this list was obtained from an SMP query "get all receiving capabilities of participant". May not be null, but maybe empty.
      sDocTypeValue - The document type identifier value (!) without the scheme to search. The schemes are added internally automatically.
      aMatchingDocTypeConsumer - The consumer to be invoked for each match. May not be null.
    • findPeppolDoctypeWildcardMatch

      @Nonnull public static com.helger.commons.state.ESuccess findPeppolDoctypeWildcardMatch(@Nonnull com.helger.commons.collection.impl.ICommonsList<? extends com.helger.peppolid.IDocumentTypeIdentifier> aBaseDocTypes, @Nonnull @Nonempty com.helger.peppolid.IDocumentTypeIdentifier aSearchDocTypeValue, @Nonnull Consumer<? super com.helger.peppolid.IDocumentTypeIdentifier> aMatchingDocTypeConsumer)
      Helper method to find the best match wildcard document type identifier for PFUOI 4.3.0. This method only work for peppol-doctype-wildcard scheme.
      Parameters:
      aBaseDocTypes - The list of document types to filter. Usually this list was obtained from an SMP query "get all receiving capabilities of participant". May not be null, but maybe empty.
      aSearchDocTypeValue - The document type identifier to search. It may or may not contain the Wildcard indicator.
      aMatchingDocTypeConsumer - The consumer to be invoked for the first match only. May not be null.
      Returns:
      Non-null.
    • toString

      public String toString()
      Overrides:
      toString in class Object