public class ReporterType extends BasicItem implements Nameable, Removable, Registered
ReporterData
Modifier and Type | Field and Description |
---|---|
private static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
ReporterType(ReporterTypeData data)
Constructor that sets reporter type data.
|
Modifier and Type | Method and Description |
---|---|
static ReporterType |
getById(DbControl dc,
int id)
Get a
ReporterType object when you know the ID. |
(package private) ReporterTypeData |
getData()
Get the
BasicData object that holds all data for this item. |
String |
getDescription()
Get the description for the item.
|
Date |
getEntryDate()
Get the date that the item was registered in the database.
|
String |
getName()
Get the name of the item.
|
static ReporterType |
getNew(DbControl dc)
Create a new
ReporterType item. |
static ItemQuery<ReporterType> |
getQuery()
Get a query configured to retrieve reporter types.
|
User |
getRemovedBy()
Get the user that flagged this item for removal.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get all:
Reporter :s of this type
|
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
boolean |
isUsed()
Check if any reporters of this type exists.
|
ReporterData |
newReporter(String externalId)
Create a new
ReporterData object of this type. |
void |
setDescription(String description)
Set the description for the item.
|
void |
setName(String name)
Set the name of the item.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
private static final Item TYPE
Item.REPORTERTYPE
,
getType()
ReporterType(ReporterTypeData data)
data
- A ReporterTypeData
object.public static ReporterType getNew(DbControl dc) throws PermissionDeniedException, BaseException
ReporterType
item.dc
- The DbControl
which will be used for
permission checking and database access.ReporterType
item.PermissionDeniedException
- If the logged in user doesn't
have CREATE
permission for this type
of item.BaseException
- If there is another error.public static ReporterType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ReporterType
object when you know the ID.dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load.ReporterType
item.ItemNotFoundException
- This exception is thrown if an
item with the specified ID is not found.PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the items.BaseException
- This exception is thrown if there is another
error.public static ItemQuery<ReporterType> getQuery()
ItemQuery
objectReporterTypeData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isRemoved()
Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
Removable
getRemovedBy
in interface Removable
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the userItemNotFoundException
- If the user that removed this item
can't be foundpublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Reporter
:s of this type
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public ReporterData newReporter(String externalId) throws PermissionDeniedException, InvalidDataException, BaseException
ReporterData
object of this type.externalId
- The external id of the new reporter. Null is not allowedReporterData
objectPermissionDeniedException
- This exception is thrown if
user doesn't have use permission
for this reporter type.InvalidDataException
- If required argument is null.BaseException
- If there is another error.