Package org.dizitart.no2.common.meta
Class Attributes
- java.lang.Object
-
- org.dizitart.no2.common.meta.Attributes
-
- All Implemented Interfaces:
Serializable
public class Attributes extends Object implements Serializable
Represents metadata attributes of aNitriteMap.- Since:
- 1.0
- Author:
- Anindya Chatterjee
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCREATED_TIMEThe constant CREATED_TIME.static StringLAST_MODIFIED_TIMEThe constant LAST_MODIFIED_TIME.static StringOWNERThe constant OWNER.static StringUNIQUE_IDThe constant UNIQUE_ID.
-
Constructor Summary
Constructors Constructor Description Attributes()Instantiates a new Attributes.Attributes(String collection)Instantiates a new Attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Stringget(String key)Retrieves the value associated with a given key from aAttributes.Map<String,String>getAttributes()inthashCode()booleanhasKey(String key)Check whether a key exists in the attributes.Attributesset(String key, String value)Adds a key-value pair to the attributes and returns the updatedAttributesobject.voidsetAttributes(Map<String,String> attributes)StringtoString()
-
-
-
Field Detail
-
CREATED_TIME
public static final String CREATED_TIME
The constant CREATED_TIME.- See Also:
- Constant Field Values
-
LAST_MODIFIED_TIME
public static final String LAST_MODIFIED_TIME
The constant LAST_MODIFIED_TIME.- See Also:
- Constant Field Values
-
OWNER
public static final String OWNER
The constant OWNER.- See Also:
- Constant Field Values
-
UNIQUE_ID
public static final String UNIQUE_ID
The constant UNIQUE_ID.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Attributes
public Attributes()
Instantiates a new Attributes.
-
Attributes
public Attributes(String collection)
Instantiates a new Attributes.- Parameters:
collection- the collection
-
-
Method Detail
-
set
public Attributes set(String key, String value)
Adds a key-value pair to the attributes and returns the updatedAttributesobject.- Parameters:
key- The key is a string that represents the attribute name. It is used to identify the attribute in the attributes.value- The value parameter is a string that represents the value to be associated with the given key in the attributes.- Returns:
- The method is returning an instance of the Attributes class.
-
get
public String get(String key)
Retrieves the value associated with a given key from aAttributes.- Parameters:
key- The "key" parameter is a String that represents the key of the attribute that you want to retrieve from the attributes.- Returns:
- The method is returning the value associated with the given key in the attributes.
-
hasKey
public boolean hasKey(String key)
Check whether a key exists in the attributes.- Parameters:
key- the key- Returns:
- the boolean
-
-