com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class HeaderCollection

  • All Implemented Interfaces:
    com.aspose.ms.System.Collections.ICollection<String>, com.aspose.ms.System.Collections.IEnumerable<String>, Iterable<String>


    public class HeaderCollection
    extends Object
    implements com.aspose.ms.System.Collections.ICollection<String>

    Defines the collection of header fields

    • Constructor Detail

      • HeaderCollection

        public HeaderCollection(HeaderCollection col)

        Initializes a new instance of the HeaderCollection class.

        Parameters:
        col - The collection.
      • HeaderCollection

        public HeaderCollection()

        Initializes a new instance of the HeaderCollection class.

    • Method Detail

      • getAllKeys

        public String[] getAllKeys()

        Gets an array of strings containing all header keys in collections

      • getKeys

        public List<String> getKeys()

        Gets a T:System.Collections.ObjectModel.ReadOnlyCollection{string} containing all header keys in collections

      • get_Item

        public String get_Item(String name)

        Gets a value from collection by the name.

        Parameters:
        name - The name (key) in collection for an item.
        Returns:
        Returns specified item
      • set_Item

        public void set_Item(String name,
                    String value)

        Gets a value from collection by the name.

        Parameters:
        name - The name (key) in collection for an item.
      • get_Item

        public String get_Item(int index)

        Gets a value from collection by the index.

        Parameters:
        index - The index in collection for an item.
        Returns:
        Returns specified item
      • getKey

        public String getKey(int index)

        Gets the key at the specified index of the collection.

        Parameters:
        index - The index of the key.
        Returns:
        The key at the specified index.
      • get

        public String get(int index)

        Gets the value at the specified index.

        Parameters:
        index - An integer that represents the position of the element to get.
        Returns:
        The value at the specified position in current collection.
      • get

        public String get(String name)

        Gets the header value by a given header name.

        Parameters:
        name - The haeader name.
        Returns:
        The header value.
      • getDecodedValue

        public String getDecodedValue(String name)

        Gets the header value.

        Parameters:
        name - The text header name.
        Returns:
        Decoded text value
      • getValues

        public String[] getValues(String name)

        Gets the header values.

        Parameters:
        name - The header name.
        Returns:
        The collection of header values.
      • add_

        public void add_(String name,
                String value)

        Adds the header.

        Parameters:
        name - The header name.
        value - The header value.
      • add

        public void add(HeaderCollection c)

        Adds a header to collection.

        Parameters:
        c - HeaderCollection for adding.
      • add

        public void add(String name,
               String value)

        Adds the header.

        Parameters:
        name - The header name.
        value - The header value.
      • insert

        public void insert(String name,
                  String value)

        Inserts the header in collection. If collection contains headers with the same name this header will be inserted before other headers with the same name.

        Parameters:
        name - The header name.
        value - The header value.
      • set

        public void set(String name,
               String value)

        Sets the header.

        Parameters:
        name - The header name.
        value - The header value.
      • hasKeys

        public boolean hasKeys()

        Gets a value indicating whether the collection contains keys.

        Returns:
        Returns true if collection has an items, otherwise returns false.
      • size

        public int size()

        Gets a count of headers

        Specified by:
        size in interface com.aspose.ms.System.Collections.ICollection<String>
      • isReadOnly

        public boolean isReadOnly()

        Is collection readonly

      • add

        public void add(String item)

        Adds the header without value

      • clear

        public void clear()

        Clears all headers.

      • contains

        public boolean contains(String headerName)

        Gets a value indicating whether the specified header is contained in the collection

        Parameters:
        headerName - A header to search
        Returns:
        True if collection contains specified headerName; otherwise, false
      • copyTo

        public void copyTo(String[] dest,
                  int index)

        Copies all the elements of the current collection to the specified string array starting at the specified destination index.

        Parameters:
        dest - The destination of the elements copied from the current collection.
        index - An integer that represents the index in array at which copying begins.
      • remove

        public boolean remove(String name)

        Removes the header from collection by a given header name.

        Parameters:
        name - The header name.
        Returns:
        true if item was successfully removed from the collection.
      • iterator

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<String> iterator()

        Returns an enumerator that iterates through a collection.

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<String>
        Specified by:
        iterator in interface Iterable<String>
        Returns:
        An T:System.Collections.Generic.IEnumerator{string} object that can be used to iterate through the collection.
      • copyTo

        public void copyTo(com.aspose.ms.System.Array dest,
                  int index)
        Specified by:
        copyTo in interface com.aspose.ms.System.Collections.ICollection<String>
      • getSyncRoot

        public Object getSyncRoot()
        Specified by:
        getSyncRoot in interface com.aspose.ms.System.Collections.ICollection<String>
      • isSynchronized

        public boolean isSynchronized()
        Specified by:
        isSynchronized in interface com.aspose.ms.System.Collections.ICollection<String>