Liferay 6.1.2-ce-ga3

com.liferay.portal.model
Class ResourceWrapper

java.lang.Object
  extended by com.liferay.portal.model.ResourceWrapper
All Implemented Interfaces:
BaseModel<Resource>, ClassedModel, ModelWrapper<Resource>, PersistedModel, Resource, ResourceModel, Serializable, Cloneable, Comparable<Resource>

public class ResourceWrapper
extends Object
implements Resource, ModelWrapper<Resource>

This class is a wrapper for Resource.

See Also:
Resource, Serialized Form

Constructor Summary
ResourceWrapper(Resource resource)
           
 
Method Summary
 Object clone()
          Creates a shallow clone of this model instance.
 int compareTo(Resource resource)
           
 boolean equals(Object obj)
           
 long getCodeId()
          Returns the code ID of this resource.
 long getCompanyId()
           
 ExpandoBridge getExpandoBridge()
          Returns the expando bridge for this model instance.
 Map<String,Object> getModelAttributes()
           
 Class<?> getModelClass()
           
 String getModelClassName()
           
 String getName()
           
 long getPrimaryKey()
          Returns the primary key of this resource.
 Serializable getPrimaryKeyObj()
          Returns the primary key of this model instance.
 String getPrimKey()
          Returns the prim key of this resource.
 long getResourceId()
          Returns the resource ID of this resource.
 int getScope()
           
 Resource getWrappedModel()
           
 Resource getWrappedResource()
          Deprecated. Renamed to getWrappedModel()
 int hashCode()
           
 boolean isCachedModel()
          Returns true if this model instance was retrieved from the entity cache.
 boolean isEscapedModel()
          Returns true if this model instance is escaped.
 boolean isNew()
          Returns true if this model instance does not yet exist in the database.
 void persist()
          Updates this model instance in the database or adds it if it does not yet exist.
 void resetOriginalValues()
          Reset all original fields to current values.
 void setCachedModel(boolean cachedModel)
          Sets whether this model instance was retrieved from the entity cache.
 void setCodeId(long codeId)
          Sets the code ID of this resource.
 void setCompanyId(long companyId)
           
 void setExpandoBridgeAttributes(ServiceContext serviceContext)
          Sets the expando bridge attributes for this model instance to the attributes stored in the service context.
 void setModelAttributes(Map<String,Object> attributes)
           
 void setName(String name)
           
 void setNew(boolean n)
          Sets whether this model instance does not yet exist in the database.
 void setPrimaryKey(long primaryKey)
          Sets the primary key of this resource.
 void setPrimaryKeyObj(Serializable primaryKeyObj)
          Sets the primary key of this model instance.
 void setPrimKey(String primKey)
          Sets the prim key of this resource.
 void setResourceId(long resourceId)
          Sets the resource ID of this resource.
 void setScope(int scope)
           
 CacheModel<Resource> toCacheModel()
          Returns a cache model object for this entity used by entity cache.
 Resource toEscapedModel()
          Returns a copy of this entity as an escaped model instance by wrapping it with an AutoEscapeBeanHandler.
 String toString()
           
 Resource toUnescapedModel()
           
 String toXmlString()
          Returns the XML representation of this model instance.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceWrapper

public ResourceWrapper(Resource resource)
Method Detail

getModelClass

public Class<?> getModelClass()
Specified by:
getModelClass in interface ClassedModel

getModelClassName

public String getModelClassName()
Specified by:
getModelClassName in interface ClassedModel

getModelAttributes

public Map<String,Object> getModelAttributes()
Specified by:
getModelAttributes in interface BaseModel<Resource>

setModelAttributes

public void setModelAttributes(Map<String,Object> attributes)
Specified by:
setModelAttributes in interface BaseModel<Resource>

getPrimaryKey

public long getPrimaryKey()
Returns the primary key of this resource.

Specified by:
getPrimaryKey in interface ResourceModel
Returns:
the primary key of this resource

setPrimaryKey

public void setPrimaryKey(long primaryKey)
Sets the primary key of this resource.

Specified by:
setPrimaryKey in interface ResourceModel
Parameters:
primaryKey - the primary key of this resource

getResourceId

public long getResourceId()
Returns the resource ID of this resource.

Specified by:
getResourceId in interface ResourceModel
Returns:
the resource ID of this resource

setResourceId

public void setResourceId(long resourceId)
Sets the resource ID of this resource.

Specified by:
setResourceId in interface ResourceModel
Parameters:
resourceId - the resource ID of this resource

getCodeId

public long getCodeId()
Returns the code ID of this resource.

Specified by:
getCodeId in interface ResourceModel
Returns:
the code ID of this resource

setCodeId

public void setCodeId(long codeId)
Sets the code ID of this resource.

Specified by:
setCodeId in interface ResourceModel
Parameters:
codeId - the code ID of this resource

getPrimKey

public String getPrimKey()
Returns the prim key of this resource.

Specified by:
getPrimKey in interface ResourceModel
Returns:
the prim key of this resource

setPrimKey

public void setPrimKey(String primKey)
Sets the prim key of this resource.

Specified by:
setPrimKey in interface ResourceModel
Parameters:
primKey - the prim key of this resource

isNew

public boolean isNew()
Description copied from interface: BaseModel
Returns true if this model instance does not yet exist in the database.

Specified by:
isNew in interface BaseModel<Resource>
Specified by:
isNew in interface ResourceModel
Returns:
true if this model instance does not yet exist in the database; false otherwise

setNew

public void setNew(boolean n)
Description copied from interface: BaseModel
Sets whether this model instance does not yet exist in the database.

Specified by:
setNew in interface BaseModel<Resource>
Specified by:
setNew in interface ResourceModel
Parameters:
n - whether this model instance does not yet exist in the database

isCachedModel

public boolean isCachedModel()
Description copied from interface: BaseModel
Returns true if this model instance was retrieved from the entity cache.

Specified by:
isCachedModel in interface BaseModel<Resource>
Specified by:
isCachedModel in interface ResourceModel
Returns:
true if this model instance was retrieved from the entity cache; false otherwise
See Also:
BaseModel.setCachedModel(boolean)

setCachedModel

public void setCachedModel(boolean cachedModel)
Description copied from interface: BaseModel
Sets whether this model instance was retrieved from the entity cache.

Specified by:
setCachedModel in interface BaseModel<Resource>
Specified by:
setCachedModel in interface ResourceModel
Parameters:
cachedModel - whether this model instance was retrieved from the entity cache
See Also:
EntityCache

isEscapedModel

public boolean isEscapedModel()
Description copied from interface: BaseModel
Returns true if this model instance is escaped.

Specified by:
isEscapedModel in interface BaseModel<Resource>
Specified by:
isEscapedModel in interface ResourceModel
Returns:
true if this model instance is escaped; false otherwise

getPrimaryKeyObj

public Serializable getPrimaryKeyObj()
Description copied from interface: BaseModel
Returns the primary key of this model instance.

Specified by:
getPrimaryKeyObj in interface BaseModel<Resource>
Specified by:
getPrimaryKeyObj in interface ClassedModel
Specified by:
getPrimaryKeyObj in interface ResourceModel
Returns:
the primary key of this model instance

setPrimaryKeyObj

public void setPrimaryKeyObj(Serializable primaryKeyObj)
Description copied from interface: BaseModel
Sets the primary key of this model instance.

Specified by:
setPrimaryKeyObj in interface BaseModel<Resource>
Specified by:
setPrimaryKeyObj in interface ClassedModel
Specified by:
setPrimaryKeyObj in interface ResourceModel
Parameters:
primaryKeyObj - the primary key of this model instance

getExpandoBridge

public ExpandoBridge getExpandoBridge()
Description copied from interface: BaseModel
Returns the expando bridge for this model instance.

Specified by:
getExpandoBridge in interface BaseModel<Resource>
Specified by:
getExpandoBridge in interface ClassedModel
Specified by:
getExpandoBridge in interface ResourceModel
Returns:
the expando bridge for this model instance

setExpandoBridgeAttributes

public void setExpandoBridgeAttributes(ServiceContext serviceContext)
Description copied from interface: BaseModel
Sets the expando bridge attributes for this model instance to the attributes stored in the service context.

Specified by:
setExpandoBridgeAttributes in interface BaseModel<Resource>
Specified by:
setExpandoBridgeAttributes in interface ResourceModel
Parameters:
serviceContext - the service context
See Also:
ServiceContext.getExpandoBridgeAttributes( )

clone

public Object clone()
Description copied from interface: BaseModel
Creates a shallow clone of this model instance.

Specified by:
clone in interface BaseModel<Resource>
Specified by:
clone in interface ResourceModel
Overrides:
clone in class Object
Returns:
the shallow clone of this model instance

compareTo

public int compareTo(Resource resource)
Specified by:
compareTo in interface ResourceModel
Specified by:
compareTo in interface Comparable<Resource>

hashCode

public int hashCode()
Specified by:
hashCode in interface ResourceModel
Overrides:
hashCode in class Object

toCacheModel

public CacheModel<Resource> toCacheModel()
Description copied from interface: BaseModel
Returns a cache model object for this entity used by entity cache.

Specified by:
toCacheModel in interface BaseModel<Resource>
Specified by:
toCacheModel in interface ResourceModel
Returns:
the cache model object

toEscapedModel

public Resource toEscapedModel()
Description copied from interface: BaseModel
Returns a copy of this entity as an escaped model instance by wrapping it with an AutoEscapeBeanHandler.

Specified by:
toEscapedModel in interface BaseModel<Resource>
Specified by:
toEscapedModel in interface ResourceModel
Returns:
the escaped model instance
See Also:
AutoEscapeBeanHandler

toUnescapedModel

public Resource toUnescapedModel()
Specified by:
toUnescapedModel in interface BaseModel<Resource>
Specified by:
toUnescapedModel in interface ResourceModel

toString

public String toString()
Specified by:
toString in interface ResourceModel
Overrides:
toString in class Object

toXmlString

public String toXmlString()
Description copied from interface: BaseModel
Returns the XML representation of this model instance.

Specified by:
toXmlString in interface BaseModel<Resource>
Specified by:
toXmlString in interface ResourceModel
Returns:
the XML representation of this model instance

persist

public void persist()
             throws SystemException
Description copied from interface: PersistedModel
Updates this model instance in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Specified by:
persist in interface PersistedModel
Throws:
SystemException - if a system exception occurred

getCompanyId

public long getCompanyId()
                  throws PortalException,
                         SystemException
Specified by:
getCompanyId in interface Resource
Throws:
PortalException
SystemException

getName

public String getName()
               throws PortalException,
                      SystemException
Specified by:
getName in interface Resource
Throws:
PortalException
SystemException

getScope

public int getScope()
             throws PortalException,
                    SystemException
Specified by:
getScope in interface Resource
Throws:
PortalException
SystemException

setCompanyId

public void setCompanyId(long companyId)
Specified by:
setCompanyId in interface Resource

setName

public void setName(String name)
Specified by:
setName in interface Resource

setScope

public void setScope(int scope)
Specified by:
setScope in interface Resource

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getWrappedResource

public Resource getWrappedResource()
Deprecated. Renamed to getWrappedModel()


getWrappedModel

public Resource getWrappedModel()
Specified by:
getWrappedModel in interface ModelWrapper<Resource>

resetOriginalValues

public void resetOriginalValues()
Description copied from interface: BaseModel
Reset all original fields to current values.

Specified by:
resetOriginalValues in interface BaseModel<Resource>

Liferay 6.1.2-ce-ga3