Package com.day.util

Class NameValuePair


  • public class NameValuePair
    extends Object
    The NameValuePair class implements a structure of a name and an optional value.
    Since:
    coati Audience wad
    • Constructor Detail

      • NameValuePair

        public NameValuePair​(String name,
                             String value)
        Creates a new name value pair
        Parameters:
        name - the name
        value - the value
    • Method Detail

      • getName

        public String getName()
        Gets the name
        Returns:
        the name
      • getValue

        public String getValue()
        Gets the value
        Returns:
        the value
      • parse

        public static NameValuePair parse​(String str)
        Parses a line of the form: {ws} name {ws} ["=" {ws} value {ws}];
        Parameters:
        str - the string to parse
        Returns:
        the parsed nv pair
      • parse

        public static NameValuePair parse​(String str,
                                          char equal)
        Parses a line of the form: {ws} name {ws} ["<equal>" {ws} value {ws}];
        Parameters:
        str - the string to parse
        equal - the delimiter for the equal sign
        Returns:
        the parsed nv pair