Class PModePayloadProfile

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

@NotThreadSafe @MustImplementEqualsAndHashcode public class PModePayloadProfile extends Object implements com.helger.base.name.IHasName, com.helger.base.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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    PModePayloadProfile(@NonNull @Nonempty String sName, @NonNull com.helger.mime.IMimeType aMimeType, @Nullable String sXSDFilename, @Nullable Integer aMaxSizeKB, @NonNull com.helger.base.state.EMandatory eMandatory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    final @Nullable Integer
     
    final @NonNull com.helger.mime.IMimeType
     
    final @NonNull @Nonempty String
    The PMode payload profile name.
    final @Nullable String
     
    int
     
    final boolean
     
    final boolean
     
    final boolean
     
    final boolean
     
    final @NonNull com.helger.base.state.EChange
    setMandatory(boolean bMandatory)
    Set the payload mandatory or optional.
    final @NonNull com.helger.base.state.EChange
    setMandatory(@NonNull com.helger.base.state.EMandatory eMandatory)
    Set the payload mandatory or optional.
    final @NonNull com.helger.base.state.EChange
    setMaxSizeKB(int nMaxSizeKB)
    Set the maximum size in kilobytes.
    final @NonNull com.helger.base.state.EChange
    setMaxSizeKB(@Nullable Integer aMaxSizeKB)
    Set the maximum size in kilobytes.
    final @NonNull com.helger.base.state.EChange
    setMimeType(@NonNull com.helger.mime.IMimeType aMimeType)
    Set the MIME type.
    final @NonNull com.helger.base.state.EChange
    setName(@NonNull @Nonempty String sName)
    Set the name.
    final @NonNull com.helger.base.state.EChange
    setXSDFilename(@Nullable String sXSDFilename)
    Set the XML Schema filename.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.helger.base.state.IMandatoryIndicator

    and, or
  • Field Details

  • Constructor Details

    • PModePayloadProfile

      public PModePayloadProfile()
    • PModePayloadProfile

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

    • getName

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

      public final @NonNull com.helger.base.state.EChange setName(@Nonempty @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

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

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

      public final @Nullable 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

      public final @NonNull com.helger.base.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

      public final @Nullable 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

      public final @NonNull com.helger.base.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

      public final @NonNull com.helger.base.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.base.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.base.state.IMandatoryIndicator
      Returns:
      true if the part is optional, false if it is mandatory.
    • setMandatory

      public final @NonNull com.helger.base.state.EChange setMandatory(@NonNull com.helger.base.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

      public final @NonNull com.helger.base.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