Class DBNAlliancePayload

java.lang.Object
com.helger.peppol.xhe.DBNAlliancePayload

@NotThreadSafe public class DBNAlliancePayload extends Object
This class contains all the DBNAlliance data per Payload instance, such as a single invoice in a syntax neutral way. This class maps to the requirements of the Exchange Header Envelope (XHE) Version 1.0 specification.
Author:
Robinson Garcia, Philip Helger
  • Field Details

    • DEFAULT_CONTENT_TYPE_CODE_LIST_ID

      public static final String DEFAULT_CONTENT_TYPE_CODE_LIST_ID
      See Also:
    • DEFAULT_INSTANCE_ENCRYPTION_INDICATOR

      public static final boolean DEFAULT_INSTANCE_ENCRYPTION_INDICATOR
      See Also:
  • Constructor Details

    • DBNAlliancePayload

      public DBNAlliancePayload(@Nonnull com.helger.peppolid.factory.IIdentifierFactory aIdentifierFactory)
      Constructor
      Parameters:
      aIdentifierFactory - Identifier factory to be used. May not be null.
  • Method Details

    • getDescription

      @Nullable public String getDescription()
      Description - An OPTIONAL human readable description of the payload. This field is mapped to XHE/Payloads/Payload/Description.
      Returns:
      Description value. May be null.
    • hasDescription

      public boolean hasDescription()
      Returns:
      true if a description is present, false if not.
    • setDescription

      @Nonnull public DBNAlliancePayload setDescription(@Nullable String s)
      Set the content of the fields that are mapped to XHE/Payloads/Payload/Description.
      Parameters:
      s - Description - An OPTIONAL human readable description of the payload. This field is mapped to XHE/Payloads/Payload/Description .
      Returns:
      this for chaining
    • getContentTypeCodeListID

      @Nullable public String getContentTypeCodeListID()
      Returns:
      The content type code list id. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/ContentTypeCode/@listID .
    • hasContentTypeCodeListID

      public boolean hasContentTypeCodeListID()
      Returns:
      true if a Content-Type Code list ID is present, false if not.
    • setContentTypeCodeListID

      @Nonnull public DBNAlliancePayload setContentTypeCodeListID(@Nullable String s)
      Set the content type code list ID.
      Parameters:
      s - An OPTIONAL aIribute specifying that the ContentTypeCode value is a MIME Type. When set, this aIribute MUST be set to: MIME.
      Returns:
      this for chaining
    • getContentTypeCode

      @Nullable public String getContentTypeCode()
      Returns:
      The content type code value. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/ContentTypeCode/.
    • hasContentTypeCode

      public boolean hasContentTypeCode()
      Returns:
      true if a Content-Type Code value is present, false if not.
    • setContentTypeCode

      @Nonnull public DBNAlliancePayload setContentTypeCode(@Nonnull @Nonempty String s)
      Set the content type code. The MIME Type of the payload content. For XML payload content the ContentTypeCode MUST be set to: application/xml
      Parameters:
      s - The Content-Type code to use. This field is mapped to XHE/Payloads/Payload/ContentTypeCode/.
      Returns:
      this for chaining
    • setContentTypeCode

      @Nonnull public DBNAlliancePayload setContentTypeCode(@Nullable String sCodeListID, @Nonnull @Nonempty String sValue)
    • setContentTypeCode

      @Nonnull public DBNAlliancePayload setContentTypeCode(@Nonnull com.helger.commons.mime.IMimeType a)
      Set the content type code. The MIME Type of the payload content. For XML payload content the ContentTypeCode MUST be set to: application/xml
      Parameters:
      a - The Content-Type code to use. May neither be null nor empty. This field is mapped to XHE/Payloads/Payload/ContentTypeCode/.
      Returns:
      this for chaining
    • setContentTypeCodeXML

      @Nonnull public DBNAlliancePayload setContentTypeCodeXML()
      Set the content type code to application/xml
      Returns:
      this for chaining
    • getCustomizationIDSchemeID

      @Nullable public String getCustomizationIDSchemeID()
      Returns:
      The identifier of the scheme used for the CustomizationID if one is defined. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/CustomizationID/@schemeID.
    • hasCustomizationIDSchemeID

      public boolean hasCustomizationIDSchemeID()
    • setCustomizationIDSchemeID

      @Nonnull public DBNAlliancePayload setCustomizationIDSchemeID(@Nullable String s)
      Set the customization identifier scheme ID.
      Parameters:
      s - The identifier of the scheme used for the CustomizationID if one is defined. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/CustomizationID/@schemeID.
      Returns:
      this for chaining
    • getCustomizationID

      @Nullable public String getCustomizationID()
      Returns:
      If defined in the business document profile or specification of the payload, this MUST be set to the Customization ID as specified therein. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/CustomizationID/.
    • hasCustomizationID

      public boolean hasCustomizationID()
    • setCustomizationID

      @Nonnull public DBNAlliancePayload setCustomizationID(@Nullable String s)
      Set the customization identifier.
      Parameters:
      s - If defined in the business document profile or specification of the payload, this MUST be set to the Customization ID as specified therein. Otherwise, MUST NOT be used. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/CustomizationID/.
      Returns:
      this for chaining
    • getCustomizationIDAsIdentifier

      @Nullable public com.helger.peppolid.IDocumentTypeIdentifier getCustomizationIDAsIdentifier()
      Returns:
      The customization identifier as a document type identifier or null if certain information are missing or are invalid.
    • setCustomizationID

      @Nonnull public DBNAlliancePayload setCustomizationID(@Nullable com.helger.peppolid.IDocumentTypeIdentifier a)
      Set the customization identifier.
      Parameters:
      a - The document type identifier to use. May be null.
      Returns:
      this for chaining
      See Also:
    • setCustomizationID

      @Nonnull public DBNAlliancePayload setCustomizationID(@Nullable String sSchemeID, @Nullable String sValue)
    • getProfileIDSchemeID

      @Nullable public String getProfileIDSchemeID()
      Returns:
      The identifier of the scheme used for the ProfileID if one is defined. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/ProfileID/@schemeID.
    • hasProfileIDSchemeID

      public boolean hasProfileIDSchemeID()
    • setProfileIDSchemeID

      @Nonnull public DBNAlliancePayload setProfileIDSchemeID(@Nullable String s)
      Set the profile identifier scheme ID.
      Parameters:
      s - The identifier of the scheme used for the ProfileID if one is defined. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/ProfileID/@schemeID.
      Returns:
      this for chaining
    • getProfileID

      @Nullable public String getProfileID()
      Returns:
      If defined in the business document profile or specification of the payload, this MUST be set to the Profile ID as specified therein. Otherwise, MUST NOT be used. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/ProfileID/.
    • hasProfileID

      public boolean hasProfileID()
    • setProfileID

      @Nonnull public DBNAlliancePayload setProfileID(@Nullable String s)
      Set the profile identifier.
      Parameters:
      s - If defined in the business document profile or specification of the payload, this MUST be set to the Profile ID as specified therein. Otherwise, MUST NOT be used. May be null if not initialized. This field is mapped to XHE/Payloads/Payload/ProfileID/.
      Returns:
      this
    • getProfileIDAsIdentifier

      @Nullable public com.helger.peppolid.IProcessIdentifier getProfileIDAsIdentifier()
      Returns:
      The profile identifier or null if certain information are missing or are invalid.
    • setProfileID

      @Nonnull public DBNAlliancePayload setProfileID(@Nullable com.helger.peppolid.IProcessIdentifier aProfileID)
      Set the profile identifier.
      Parameters:
      aProfileID - The process identifier to use. May be null.
      Returns:
      this
      See Also:
    • setProfileID

      @Nonnull public DBNAlliancePayload setProfileID(@Nullable String sSchemeID, @Nullable String sValue)
    • isInstanceEncryptionIndicator

      public boolean isInstanceEncryptionIndicator()
      InstanceEncryptionIndicator - Indicator to state whether the payload instance is encrypted or not. This field is mapped to XHE/Payloads/Payload/InstanceEncryptionIndicator.
      Returns:
      InstanceEncryptionIndicator value. Default value is false.
    • setInstanceEncryptionIndicator

      @Nonnull public DBNAlliancePayload setInstanceEncryptionIndicator(boolean b)
      Set the content of the fields that are mapped to XHE/Payloads/Payload/InstanceEncryptionIndicator.
      Parameters:
      b - Indicator to state whether the payload instance is encrypted or not. This field is mapped to XHE/Payloads/Payload/InstanceEncryptionIndicator .
      Returns:
      this
    • getInstanceEncryptionMethod

      @Nullable public String getInstanceEncryptionMethod()
      The method or algorithm used for encrypting payload content. When encryption is used, payloads MUST be encrypted using one of the supported encryption methods and algorithms as specified in section 7.3 and the value of this element MUST be set to the corresponding identifier. This field is mapped to XHE/Payloads/Payload/InstanceEncryptionMethod.
      Returns:
      InstanceEncryptionMethod value. Default value is false.
    • hasInstanceEncryptionMethod

      public boolean hasInstanceEncryptionMethod()
      Returns:
      true if a InstanceEncryptionMethod is present, false if not.
    • setInstanceEncryptionMethod

      @Nonnull public DBNAlliancePayload setInstanceEncryptionMethod(@Nullable String s)
      Set the method or algorithm used for encrypting payload content. When encryption is used, payloads MUST be encrypted using one of the supported encryption methods and algorithms as specified in section 7.3 and the value of this element MUST be set to the corresponding identifier. The content of the fields that are mapped to XHE/Payloads/Payload/InstanceEncryptionMethod.
      Parameters:
      s - Method used to encrypt the payload instance. This field is mapped to XHE/Payloads/Payload/InstanceEncryptionMethod .
      Returns:
      this for chaining
    • getPayloadContent

      @Nullable @ReturnsMutableCopy public Element getPayloadContent()
      Get the contained payload content.
      Returns:
      null if no payload content is present. A clone (deep copy) of the payload content otherwise.
      See Also:
    • getPayloadContentNoClone

      @Nullable @ReturnsMutableObject public Element getPayloadContentNoClone()
      Get the contained payload content without cloning it.
      Returns:
      null if no payload content is present.
      See Also:
    • hasPayloadContent

      public boolean hasPayloadContent()
      Check if a payload content is present without having the need to explicitly call getPayloadContent() which returns a cloned node and is therefore an expensive operation.
      Returns:
      true if a payload content is present, false otherwise.
    • setPayloadContent

      @Nonnull public DBNAlliancePayload setPayloadContent(@Nonnull Element aPayloadContent)
      Set the main payload content that should be transmitted together with the XHE. The DOM element is cloned internally to avoid outside modification
      Parameters:
      aPayloadContent - The payload content to be set. May not be null. Internally the passed element is cloned, so that further modifications outside of this method have no impact on the XHE inside this object.
      Returns:
      this
      See Also:
    • setPayloadContentNoClone

      @Nonnull public DBNAlliancePayload setPayloadContentNoClone(@Nonnull Element aPayloadContent)
      Set the main payload content that should be transmitted together with the XHE. The DOM element is not cloned / copied internally.
      Parameters:
      aPayloadContent - The payload content to be set. May not be null. Internally the passed element is cloned, so that further modifications outside of this method have no impact on the XHE inside this object.
      Returns:
      this
      See Also:
    • areAllMandatoryFieldsSet

      public boolean areAllMandatoryFieldsSet()
    • toString

      public String toString()
      Overrides:
      toString in class Object