Package com.contentful.java.cda
Class CDAResource
- java.lang.Object
-
- com.contentful.java.cda.CDAResource
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ArrayResource,CDAContentType,CDALocale,CDASpace,CDATag,DeletedResource,LocalizedResource
public abstract class CDAResource extends java.lang.Object implements java.io.SerializableThis class represents a basic resource, serving as a base class for CDAContentType, CDASpace and, indirectly, for CDAEntry.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CDAResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>attrs()<T> TgetAttribute(java.lang.String key)Retrieve a specific attribute of this resource.java.lang.Stringid()java.lang.StringtoString()CDATypetype()
-
-
-
Method Detail
-
id
public java.lang.String id()
- Returns:
- a string representing this object's id.
-
type
public CDAType type()
- Returns:
- the type of this resource.
-
attrs
public java.util.Map<java.lang.String,java.lang.Object> attrs()
- Returns:
- all of the attributes, this object holds.
-
getAttribute
public <T> T getAttribute(java.lang.String key)
Retrieve a specific attribute of this resource.- Type Parameters:
T- the type of the attribute to be retrieved.- Parameters:
key- a string key associated with the value to be retrieved.- Returns:
- the actual value of the attribute, or null, if there the key was not found.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable string, representing the object.
-
-