Class AS4OutgoingAttachment.Builder

java.lang.Object
com.helger.phase4.attachment.AS4OutgoingAttachment.Builder
All Implemented Interfaces:
com.helger.base.builder.IBuilder<AS4OutgoingAttachment>
Enclosing class:
AS4OutgoingAttachment

public static class AS4OutgoingAttachment.Builder extends Object implements com.helger.base.builder.IBuilder<AS4OutgoingAttachment>
Builder class for class AS4OutgoingAttachment. At least "data" and "mimeType" must be set.
Author:
Philip Helger
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • data

      public @NonNull AS4OutgoingAttachment.Builder data(byte @Nullable [] a)
    • data

      public @NonNull AS4OutgoingAttachment.Builder data(@Nullable com.helger.base.array.bytes.ByteArrayWrapper a)
    • data

      public @NonNull AS4OutgoingAttachment.Builder data(@Nullable File a)
    • reandomContentID

      public @NonNull AS4OutgoingAttachment.Builder reandomContentID()
    • contentID

      public @NonNull AS4OutgoingAttachment.Builder contentID(@Nullable String s)
    • filename

      public @NonNull AS4OutgoingAttachment.Builder filename(@Nullable String s)
    • mimeTypeXML

      public @NonNull AS4OutgoingAttachment.Builder mimeTypeXML()
      Shortcut for mimeType (CMimeType.APPLICATION_XML)
      Returns:
      this for chaining
    • mimeType

      public @NonNull AS4OutgoingAttachment.Builder mimeType(@Nullable com.helger.mime.IMimeType a)
    • compressionGZIP

      public @NonNull AS4OutgoingAttachment.Builder compressionGZIP()
      Shortcut for compression (EAS4CompressionMode.GZIP)
      Returns:
      this for chaining
    • compression

      public @NonNull AS4OutgoingAttachment.Builder compression(@Nullable EAS4CompressionMode e)
    • charset

      public @NonNull AS4OutgoingAttachment.Builder charset(@Nullable Charset a)
      Define the charset of the outgoing attachment.
      Parameters:
      a - The Charset to use. May be null.
      Returns:
      this for chaining
      Since:
      0.14.0
    • addCustomProperty

      public @NonNull AS4OutgoingAttachment.Builder addCustomProperty(@Nullable String sKey, @Nullable String sValue)
      Add a single custom property.
      Parameters:
      sKey - They property key. May be null. Only properties with a non-null key are considered.
      sValue - The value to use. May be null.
      Returns:
      this for chaining
      Since:
      2.8.6
    • addCustomProperties

      public @NonNull AS4OutgoingAttachment.Builder addCustomProperties(@Nullable com.helger.collection.commons.ICommonsOrderedMap<String,String> a)
      Add the provided map of custom properties. Existing custom properties are not changed, but may be overwritten.
      Parameters:
      a - The key-value-pairs to be added as custom properties. May be null.
      Returns:
      this for chaining
      Since:
      2.8.6
    • customProperty

      public @NonNull AS4OutgoingAttachment.Builder customProperty(@Nullable String sKey, @Nullable String sValue)
      Remove all existing custom properties and only use the provided one.
      Parameters:
      sKey - They property key. May be null. Only properties with a non-null key are considered.
      sValue - The value to use. May be null.
      Returns:
      this for chaining
      Since:
      2.8.6
    • customProperties

      public @NonNull AS4OutgoingAttachment.Builder customProperties(@Nullable com.helger.collection.commons.ICommonsOrderedMap<String,String> a)
      Use the provided map of custom properties. All existing custom properties are removed.
      Parameters:
      a - The key-value-pairs to use as custom properties. May be null.
      Returns:
      this for chaining
      Since:
      2.8.6
    • checkConsistency

      @OverridingMethodsMustInvokeSuper protected void checkConsistency()
    • build

      public @NonNull AS4OutgoingAttachment build()
      Specified by:
      build in interface com.helger.base.builder.IBuilder<AS4OutgoingAttachment>