com.sun.tdk.specdiff.html.stat

## Class DocumentProperties

- java.lang.Object
- - com.sun.tdk.specdiff.html.stat.DocumentProperties

-     public class DocumentProperties
      extends java.lang.Object

  Document properties holder. An instance of this class can be created and populated with values in two ways:

  1. Using a constructor and putting values with `put(java.lang.String, java.lang.String)`.

  2. Using a static method `createFromPlainString(java.lang.String)`. In this case the following rules apply:

  - the format of the string is: [key1[=value1][;key2[=value2]]...]
  - no-value keys are allowed;
  - keys and values are trimmed;
  - empty plain string maps to empty DocumentProperties instance;
  - `null` plain string leads to NullPointerException
  This class is mutable and is not thread safe.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DOCUMENT_TYPE_KEY` A key denoting the type of the document.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentProperties()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsKey(java.lang.String key)` Returns true if the specified key is contained in this document properties.
    `static DocumentProperties` | `createFromPlainString(java.lang.String str)` Creates a new instance of DocumentProperties according to the described `rules`
    `boolean` | `equals(java.lang.Object obj)`
    `java.lang.String` | `get(java.lang.String key)` Returns the value associated with the specified key if the one exists or null otherwise.
    `int` | `hashCode()`
    `DocumentProperties` | `put(java.lang.String key, java.lang.String value)` Associates the specified key with the specified value in the properties map.
    `int` | `size()` Returns the number of records contained in this document properties map.
    `java.util.Map<java.lang.String,java.lang.String>` | `toMap()` Returns an instance of unmodifiable Map that backs this document properties.
    `java.lang.String` | `toPlainString()` Converts this instance of DocumentProperties to the plain string according to the described `rules`.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DOCUMENT_TYPE_KEY

          public static final java.lang.String DOCUMENT_TYPE_KEY

      A key denoting the type of the document.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DocumentProperties

          public DocumentProperties()

  - ### Method Detail

    - #### createFromPlainString

          public static DocumentProperties createFromPlainString(java.lang.String str)

      Creates a new instance of DocumentProperties according to the described `rules`

    - #### toPlainString

          public java.lang.String toPlainString()

      Converts this instance of DocumentProperties to the plain string according to the described `rules`.

    - #### toMap

          public java.util.Map<java.lang.String,java.lang.String> toMap()

      Returns an instance of unmodifiable Map that backs this document properties.

    - #### containsKey

          public boolean containsKey(java.lang.String key)

      Returns true if the specified key is contained in this document properties.

    - #### get

          public java.lang.String get(java.lang.String key)

      Returns the value associated with the specified key if the one exists or null otherwise.

    - #### put

          public DocumentProperties put(java.lang.String key,
                                        java.lang.String value)

      Associates the specified key with the specified value in the properties map. Trims both `key` and `value`.
      Parameters:
        `key` - non-null key
        `value` - any value; can be null
      Returns:
        reference to this object
      Throws:
        `java.lang.NullPointerException` - if key is null

    - #### size

          public int size()

      Returns the number of records contained in this document properties map.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`