Class NameValuePair

java.lang.Object
com.tridion.meta.NameValuePair
All Implemented Interfaces:
Serializable

public class NameValuePair extends Object implements Serializable
This class represents a name-value pair. It has 3 properties, namely the name, type and value.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The type for values of type Date.
    static final int
    The type for values of type Float.
    static final int
    The type for values of type String.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NameValuePair(String name, int type, Object value)
    Deprecated.
    Use NameValuePair(String, MetadataType, Object) instead.
    NameValuePair(String name, int type, List<Object> multipleValues)
    Deprecated.
    Use NameValuePair(String, MetadataType, List) instead.
    NameValuePair(String name, MetadataType type, Object value)
     
    NameValuePair(String name, MetadataType type, List<Object> multipleValues)
    Constructing NameValuePair for multiple values.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Returns the value part of this NameValuePair instance.
    This type is the type the underlying storage layer uses to store the name.
    Returns multiple values of this NameValuePair instance.
    Returns the name part of this NameValuePair instance.
    int
    Deprecated.
    Deprecated.
    This method is only for backwards compatibility reasons and should not be used anymore.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Details

      • TYPE_STRING

        public static final int TYPE_STRING
        The type for values of type String.
      • TYPE_DATE

        public static final int TYPE_DATE
        The type for values of type Date.
      • TYPE_FLOAT

        public static final int TYPE_FLOAT
        The type for values of type Float.
    • Constructor Details

      • NameValuePair

        @Deprecated public NameValuePair(String name, int type, Object value)
        Deprecated.
        Use NameValuePair(String, MetadataType, Object) instead.
      • NameValuePair

        @Deprecated public NameValuePair(String name, int type, List<Object> multipleValues)
        Deprecated.
        Use NameValuePair(String, MetadataType, List) instead.
      • NameValuePair

        public NameValuePair(String name, MetadataType type, Object value)
      • NameValuePair

        public NameValuePair(String name, MetadataType type, List<Object> multipleValues)
        Constructing NameValuePair for multiple values.
        Parameters:
        name - Name
        type - Type of the value
        multipleValues - values
      • Method Details

        • getName

          public String getName()
          Returns the name part of this NameValuePair instance.
          Returns:
          A String indicating the name of this NameValuePair instance.
        • getMetadataType

          public MetadataType getMetadataType()
          This type is the type the underlying storage layer uses to store the name. By default this is a String.
          Returns:
          A constant indicating the type in which the value is stored.
        • getType

          @Deprecated public int getType()
          Deprecated.
          This type is the type the underlying storage layer uses to store the name. By default this is a String.
          Returns:
          A constant indicating the type in which the value is stored.
        • getValue

          @Deprecated public Object getValue()
          Deprecated.
          This method is only for backwards compatibility reasons and should not be used anymore. New method to be used is getFirstValue().
          Returns the value part of this NameValuePair instance. This can be a java.lang.String, a java.util.Date, or a java.lang.Float instance.
          Returns:
          An object representing the value of this NameValuePair instance.
          See Also:
        • getFirstValue

          public Object getFirstValue()
          Returns the value part of this NameValuePair instance. This can be a java.lang.String, a java.util.Date, or a java.lang.Float instance.
          Returns:
          An object representing the value of this NameValuePair instance.
          See Also:
        • getMultipleValues

          public List<Object> getMultipleValues()
          Returns multiple values of this NameValuePair instance. This can be a list of java.lang.String, a java.util.Date, or a java.lang.Float instances.
          Returns:
          An list representing the values of this NameValuePair instance.
          See Also:
        • addValue

          public void addValue(Object value)