Class Attachments


  • public class Attachments
    extends java.lang.Object
    Attachments

    Attachments for the message. You can pass here images, audio and video files bodies. To set one attachment please use Attachments.of(String) method simply passing to it a string with attachment body encoded by base64. To set multiple attachments please use Attachments.of(List.of(String,...)) method passing to it List<string> with attachments bodies encoded by base64. Max 3 attachments per message.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      static Attachments of​(java.lang.String value)  
      static Attachments of​(java.util.List<java.lang.String> value)  
      java.lang.String toString()  
      java.lang.Object value()
      Returns an instance of one of these types: java.lang.String java.util.List<java.lang.String>
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • of

        public static Attachments of​(java.lang.String value)
      • of

        public static Attachments of​(java.util.List<java.lang.String> value)
      • value

        public java.lang.Object value()
        Returns an instance of one of these types:
        • java.lang.String
        • java.util.List<java.lang.String>

        Use instanceof to determine what type is returned. For example:

         if (obj.value() instanceof String) {
             String answer = (String) obj.value();
             System.out.println("answer=" + answer);
         }
         
        Returns:
        value of oneOf type
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object