com.microfocus.awm.core

## Class SimpleFileAttributes

- java.lang.Object
- - com.microfocus.awm.core.SimpleFileAttributes

- All Implemented Interfaces:
    IFileAttributes<java.lang.String,java.lang.String>, java.lang.Cloneable

      public class SimpleFileAttributes
      extends java.lang.Object
      implements IFileAttributes<java.lang.String,java.lang.String>, java.lang.Cloneable

  Basic implementation for `IFileAttributes` storing keys and values as keys.

  Copyright (C) Micro Focus

  Author:
    Ralf Pakosch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleFileAttributes()` Basic constructor for an empty file attribute set.
    `SimpleFileAttributes(IFileAttributes<java.lang.String,java.lang.String> pAttributes)` Constructor for a new file attributes copying all attributes from another set.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map<java.lang.String,java.lang.String>` | `getAllAttributes()` Returns all attributes and its values.
    `java.lang.String` | `getAttribute(java.lang.String pKey)` Returns the value for an attribute with the given name.
    `static java.lang.String` | `nullToUnknown(java.lang.String pValue)` Returns `` if the given string is `null`.
    `void` | `setAttribute(java.lang.String pName, java.lang.String pValue)` Adds a new file attribute.
    `void` | `setAttributeNullToUnknown(java.lang.String pName, java.lang.String pValue)` Calls `setAttribute(String, String)` but converts any given `null` attribute value to .

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleFileAttributes

          public SimpleFileAttributes()

      Basic constructor for an empty file attribute set.

    - #### SimpleFileAttributes

          public SimpleFileAttributes(IFileAttributes<java.lang.String,java.lang.String> pAttributes)

      Constructor for a new file attributes copying all attributes from another set.
      Parameters:
        `pAttributes` - file attributes to copy attributes from

  - ### Method Detail

    - #### getAttribute

          public java.lang.String getAttribute(java.lang.String pKey)

      Description copied from interface: `IFileAttributes`
      Returns the value for an attribute with the given name.
      Specified by:
        `getAttribute` in interface `IFileAttributes<java.lang.String,java.lang.String>`
      Parameters:
        `pKey` - the name of a file attribute
      Returns:
        the value of the given attribute name or `null`

    - #### setAttribute

          public void setAttribute(java.lang.String pName,
                                   java.lang.String pValue)

      Description copied from interface: `IFileAttributes`
      Adds a new file attribute. If the attribute with the given name already exists, its value will be overwritten.
      Specified by:
        `setAttribute` in interface `IFileAttributes<java.lang.String,java.lang.String>`
      Parameters:
        `pName` - the name of the file attribute
        `pValue` - the value to which the file attribute should be set

    - #### setAttributeNullToUnknown

          public void setAttributeNullToUnknown(java.lang.String pName,
                                                java.lang.String pValue)

      Calls `setAttribute(String, String)` but converts any given `null` attribute value to .
      Parameters:
        `pName` - the attribute name
        `pValue` - the attribute value
      See Also:
        `nullToUnknown(String)`

    - #### getAllAttributes

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

      Description copied from interface: `IFileAttributes`
      Returns all attributes and its values.
      Specified by:
        `getAllAttributes` in interface `IFileAttributes<java.lang.String,java.lang.String>`
      Returns:
        a Map of all attributes (Key = attribute name, Value = attribute value)

    - #### nullToUnknown

          public static java.lang.String nullToUnknown(java.lang.String pValue)

      Returns `` if the given string is `null`. Useful for avoiding the string "null" when e.g. presenting values of a file in the UI.
      Parameters:
        `pValue` - a string value which can be `null`
      Returns:
        the unchanged given string or `` if the string is `null`. Never returns `null`.

Copyright © 2015 Micro Focus GmbH. All rights reserved.