public class ResourceModel extends BaseIdentifiable implements Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
DESCRIPTION_COLUMN_SIZE |
static int |
KEY_SIZE |
static int |
NAME_COLUMN_SIZE |
static String |
QUALIFIER_PROJECT_TRUNK |
static String |
SCOPE_PROJECT |
Constructor and Description |
---|
ResourceModel()
Default constructor
|
ResourceModel(String scope,
String key,
String qualifier,
Integer rootId,
String name)
Creates a resource model
|
Modifier and Type | Method and Description |
---|---|
static ResourceModel |
build(Resource resource)
Maps a resource to a resource model and returns the resource
|
Object |
clone() |
boolean |
equals(Object obj) |
Integer |
getCopyResourceId() |
Date |
getCreatedAt() |
String |
getDescription()
Only available at project level.
|
Boolean |
getEnabled() |
String |
getKey() |
String |
getLanguageKey() |
String |
getLongName() |
String |
getName() |
Integer |
getPersonId() |
ProjectLink |
getProjectLink(String key) |
List<ProjectLink> |
getProjectLinks()
Only available at project level.
|
String |
getQualifier() |
Integer |
getRootId() |
String |
getScope() |
int |
hashCode() |
void |
setCopyResourceId(Integer i) |
void |
setCreatedAt(Date createdAt) |
void |
setDescription(String description)
Sets the resource description, truncated to DESCRIPTION_COLUMN_SIZE
|
void |
setEnabled(Boolean enabled) |
void |
setKey(String key) |
void |
setLanguageKey(String lang) |
void |
setLongName(String s)
Sets the long name of the resource, truncated to NAME_COLUMN_SIZE
|
void |
setName(String name)
Sets the resource name, truncated to NAME_COLUMN_SIZE
|
ResourceModel |
setPersonId(Integer i) |
void |
setProjectLinks(List<ProjectLink> projectLinks) |
void |
setQualifier(String qualifier) |
void |
setRootId(Integer rootId) |
void |
setScope(String scope) |
String |
toString() |
getId, setId
public static final String SCOPE_PROJECT
public static final String QUALIFIER_PROJECT_TRUNK
public static final int DESCRIPTION_COLUMN_SIZE
public static final int NAME_COLUMN_SIZE
public static final int KEY_SIZE
public ResourceModel()
public ResourceModel(String scope, String key, String qualifier, Integer rootId, String name)
Creates a resource model
scope
- the scope the rule will apply onkey
- the rule key. This is the name of the resource, including the pathqualifier
- the resource qualifierrootId
- the rootId for the resourcename
- the short name of the resourcepublic List<ProjectLink> getProjectLinks()
public void setProjectLinks(List<ProjectLink> projectLinks)
public ProjectLink getProjectLink(String key)
public String getDescription()
public void setDescription(String description)
public String getLongName()
public void setLongName(String s)
public Boolean getEnabled()
public void setEnabled(Boolean enabled)
public String getLanguageKey()
public void setLanguageKey(String lang)
public Integer getCopyResourceId()
public void setCopyResourceId(Integer i)
public Integer getPersonId()
public ResourceModel setPersonId(Integer i)
public void setKey(String key)
IllegalArgumentException
- if the key is longer than KEY_SIZEpublic String getQualifier()
public void setQualifier(String qualifier)
public Date getCreatedAt()
public void setCreatedAt(Date createdAt)
public static ResourceModel build(Resource resource)
Copyright © 2009-2013 SonarSource. All Rights Reserved.