com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class HeaderCollection

  • All Implemented Interfaces:
    ICollection<String>, IEnumerable<String>, Iterable<String>


    public class HeaderCollection
    extends Object
    implements ICollection<String>

    Defines the collection of header fields

    • Constructor Detail

      • 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 System.Collections.ObjectModel.ReadOnlyCollection{string} containing all header keys in collections

      • get_Item

        public final 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 final 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 final 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 final String get(String name)

        Gets the header value by a given header name.

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

        public final String getDecodedValue(String name)

        Gets the header value.

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

        public final 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 final void add(HeaderCollection c)

        Adds a header to collection.

        Parameters:
        c - HeaderCollection for adding.
      • add

        public final void add(String name,
               String value)

        Adds the header.

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

        public final 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 final void set(String name,
               String value)

        Sets the header.

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

        public final 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 ICollection<String>
      • isReadOnly

        public final boolean isReadOnly()

        Is collection readonly

      • add

        public final void add(String item)

        Adds the header without value

      • clear

        public void clear()

        Clears all headers.

      • contains

        public final boolean contains(String item)

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

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

        public final void copyTo(String[] array,
                  int arrayIndex)

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

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

        public final boolean remove(String item)

        Removes the header from collection by a given header name.

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

        public final IGenericEnumerator<String> iterator()

        Returns an enumerator that iterates through a collection.

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

        public void copyTo(Array dest,
                  int index)
        Specified by:
        copyTo in interface ICollection<String>
      • getSyncRoot

        public Object getSyncRoot()
        Specified by:
        getSyncRoot in interface ICollection<String>
      • isSynchronized

        public boolean isSynchronized()
        Specified by:
        isSynchronized in interface ICollection<String>