Class ProtonAttachments

  • All Implemented Interfaces:
    Attachments

    public class ProtonAttachments
    extends Object
    implements Attachments
    Proton implementation of an Attachments object.
    • Constructor Detail

      • ProtonAttachments

        public ProtonAttachments()
    • Method Detail

      • get

        public <T> T get​(String key)
        Description copied from interface: Attachments
        Gets the user attached value that is associated with the given key, or null if no data is mapped to the key.
        Specified by:
        get in interface Attachments
        Type Parameters:
        T - The type to cast the attached mapped value to if one is set.
        Parameters:
        key - The key to use to lookup the mapped data.
        Returns:
        the object associated with the given key in this Attachments instance.
      • get

        public <T> T get​(String key,
                         Class<T> typeClass)
        Description copied from interface: Attachments
        Gets the user set Attachments value that is associated with the given key, or null if no data is mapped to the key.
        Specified by:
        get in interface Attachments
        Type Parameters:
        T - The type to cast the attached mapped value to if one is set.
        Parameters:
        key - The key to use to lookup the mapped data.
        typeClass - The Class that will be used when casting the returned mapped object.
        Returns:
        the object associated with the given key in this Attachments instance.
      • containsKey

        public boolean containsKey​(String key)
        Description copied from interface: Attachments
        Checks if the given key has a value mapped to it in this Attachments instance.
        Specified by:
        containsKey in interface Attachments
        Parameters:
        key - The key to search for a mapping to in this Attachments instance.
        Returns:
        true if there is a value mapped to the given key in this Attachments instance.