Class PModePayloadProfile

java.lang.Object
com.helger.phase4.model.pmode.leg.PModePayloadProfile
All Implemented Interfaces:
com.helger.commons.name.IHasName, com.helger.commons.state.IMandatoryIndicator, Serializable

@NotThreadSafe @MustImplementEqualsAndHashcode public class PModePayloadProfile extends Object implements com.helger.commons.name.IHasName, com.helger.commons.state.IMandatoryIndicator, Serializable
A payload part is a data structure that consists of five properties: name (or Content-ID) that is the part identifier, and can be used as an index in the notation PayloadProfile[]; MIME data type (text/xml, application/pdf, etc.); name of the applicable XML Schema file if the MIME data type is text/xml; maximum size in kilobytes; and a Boolean value indicating whether the part is expected or optional, within the User message. The message payload(s) must match this profile.
Author:
Philip Helger
See Also:
  • Field Details

  • Constructor Details

    • PModePayloadProfile

      public PModePayloadProfile()
    • PModePayloadProfile

      public PModePayloadProfile(@Nonnull @Nonempty String sName, @Nonnull com.helger.commons.mime.IMimeType aMimeType, @Nullable String sXSDFilename, @Nullable Integer aMaxSizeKB, @Nonnull com.helger.commons.state.EMandatory eMandatory)
  • Method Details

    • getName

      @Nonnull @Nonempty public final String getName()
      The PMode payload profile name.
      Specified by:
      getName in interface com.helger.commons.name.IHasName
    • setName

      @Nonnull public final com.helger.commons.state.EChange setName(@Nonnull @Nonempty String sName)
      Set the name.
      Parameters:
      sName - The new name. May neither be null nor empty.
      Returns:
      EChange
      Since:
      0.12.0
    • getMimeType

      @Nonnull public final com.helger.commons.mime.IMimeType getMimeType()
      Returns:
      The MIME type. Never null.
    • setMimeType

      @Nonnull public final com.helger.commons.state.EChange setMimeType(@Nonnull com.helger.commons.mime.IMimeType aMimeType)
      Set the MIME type.
      Parameters:
      aMimeType - The new MIME type. May not be null.
      Returns:
      EChange
      Since:
      0.12.0
    • getXSDFilename

      @Nullable public final String getXSDFilename()
      Returns:
      The name of the XML Schema filename to apply. May be null.
    • hasXSDFilename

      public final boolean hasXSDFilename()
      Returns:
      true if an XML Schema filename is present, false if not.
    • setXSDFilename

      @Nonnull public final com.helger.commons.state.EChange setXSDFilename(@Nullable String sXSDFilename)
      Set the XML Schema filename.
      Parameters:
      sXSDFilename - The new XML Schema filename. May be null.
      Returns:
      EChange
      Since:
      0.12.0
    • getMaxSizeKB

      @Nullable public final Integer getMaxSizeKB()
      Returns:
      The maximum size in kilobyte or null.
    • hasMaxSizeKB

      public final boolean hasMaxSizeKB()
      Returns:
      true if a maximum size in kilobyte is present, false if not.
    • setMaxSizeKB

      @Nonnull public final com.helger.commons.state.EChange setMaxSizeKB(@Nullable Integer aMaxSizeKB)
      Set the maximum size in kilobytes.
      Parameters:
      aMaxSizeKB - The maximum size in kilobytes. May be null.
      Returns:
      EChange
      Since:
      0.12.0
    • setMaxSizeKB

      @Nonnull public final com.helger.commons.state.EChange setMaxSizeKB(int nMaxSizeKB)
      Set the maximum size in kilobytes.
      Parameters:
      nMaxSizeKB - The maximum size in kilobytes.
      Returns:
      EChange
      Since:
      0.12.0
    • isMandatory

      public final boolean isMandatory()
      Specified by:
      isMandatory in interface com.helger.commons.state.IMandatoryIndicator
      Returns:
      true if the part is mandatory, false if it is optional.
    • isOptional

      public final boolean isOptional()
      Specified by:
      isOptional in interface com.helger.commons.state.IMandatoryIndicator
      Returns:
      true if the part is optional, false if it is mandatory.
    • setMandatory

      @Nonnull public final com.helger.commons.state.EChange setMandatory(@Nonnull com.helger.commons.state.EMandatory eMandatory)
      Set the payload mandatory or optional.
      Parameters:
      eMandatory - Payload mandatory state. May not be null.
      Returns:
      EChange
      Since:
      0.12.0
    • setMandatory

      @Nonnull public final com.helger.commons.state.EChange setMandatory(boolean bMandatory)
      Set the payload mandatory or optional.
      Parameters:
      bMandatory - true for mandatory, false for optional.
      Returns:
      EChange
      Since:
      0.12.0
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object