public class Asset extends Object
Constructor and Description |
---|
Asset(IAssetType assetType)
Create based on type
|
Asset(Oid oid)
Create from Object Id
|
Modifier and Type | Method and Description |
---|---|
void |
acceptChanges()
Accept changes to asset
|
void |
addAttributeValue(IAttributeDefinition attributeDefinition,
Object value)
Add an attribute value
|
void |
clearAttributeCache(IAttributeDefinition attributeDefinition)
Clear an attribute from cache based on definition.
|
Attribute |
ensureAttribute(IAttributeDefinition attributeDefinition) |
void |
forceAttributeValue(IAttributeDefinition attributeDefinition,
Object value)
Force an attribute to a value
|
IAssetType |
getAssetType()
Get type information
|
Attribute |
getAttribute(IAttributeDefinition attributeDefinition)
Get an attribute based on definition
|
Map<String,Attribute> |
getAttributes()
Get asset attributes
|
List<Asset> |
getChildren()
Get child assets
|
Map<String,Asset> |
getNewAssets()
Used to add new relationships and get new assets
|
Oid |
getOid()
Get Asset Object Identifier
|
boolean |
hasChanged()
Determine if something changed
|
void |
loadAttributeValue(IAttributeDefinition attributeDefinition,
Object value) |
void |
rejectChanges()
Reject changes to this asset
|
void |
removeAttributeValue(IAttributeDefinition attributeDefinition,
Object value)
Remove an attribute value
|
void |
setAttributeValue(IAttributeDefinition attributeDefinition,
Object value)
Set an attribute value
|
void |
setOid(Oid value)
This method is used by Service after a new asset has been created.
|
public Asset(Oid oid)
oid
- - Oid datapublic Asset(IAssetType assetType)
assetType
- - IAssetTypepublic IAssetType getAssetType()
public Oid getOid()
public void setOid(Oid value) throws OidException
value
- - OidOidException
- - when the new oid is a different type of assetpublic Map<String,Asset> getNewAssets()
public void setAttributeValue(IAttributeDefinition attributeDefinition, Object value) throws APIException
attributeDefinition
- attribute definitionvalue
- attribute valueAPIException
- Throws APIExceptionpublic void forceAttributeValue(IAttributeDefinition attributeDefinition, Object value) throws APIException
attributeDefinition
- IAttributeDefinitionvalue
- ObjectAPIException
- APIExceptionpublic void addAttributeValue(IAttributeDefinition attributeDefinition, Object value) throws APIException
attributeDefinition
- - IAttributeDefinitionvalue
- - ObjectAPIException
- - exception throwspublic void removeAttributeValue(IAttributeDefinition attributeDefinition, Object value) throws APIException
attributeDefinition
- - IAttributeDefinitionvalue
- - ObjectAPIException
- - APIException throwspublic void clearAttributeCache(IAttributeDefinition attributeDefinition)
attributeDefinition
- definition of attribute to clear; if null, all attributes will be cleared from cache.public Attribute getAttribute(IAttributeDefinition attributeDefinition) throws MetaException
attributeDefinition
- - IAttributeDefinitionMetaException
- - MetaExceptionpublic void acceptChanges()
public void rejectChanges()
public boolean hasChanged()
public void loadAttributeValue(IAttributeDefinition attributeDefinition, Object value) throws APIException
APIException
public Attribute ensureAttribute(IAttributeDefinition attributeDefinition) throws APIException
APIException
Copyright © 2015 VersionOne, Inc.. All rights reserved.