001: package org.osbl.riskmanagement.model;
002:
003: import org.conform.*;
004: import org.conform.validator.NumberRange;
005: import org.osbl.identity.model.Identity;
006: import org.osbl.persistence.model.Entity;
007:
008: import java.math.BigDecimal;
009: import java.sql.Timestamp;
010: import java.util.List;
011:
012: /**
013: * @author hengels
014: * @version $Revision: 840 $
015: */
016: @Bean(format=FormatType.CUSTOM,formatClass="org.osbl.riskmanagement.model.RiskFormat",patternKey="org.osbl.riskmanagement.model.Risk.pattern")
017: public class Risk extends Entity {
018: int version;
019:
020: @Property(mandatory="true")
021: RiskType type;
022:
023: @NumberRange(from="0")
024: BigDecimal coverage;
025: @NumberRange(from="0")
026: BigDecimal amount;
027: @NumberRange(from="0",fromInclusive=true,until="100",untilInclusive=true)
028: BigDecimal probability;
029:
030: String comment;
031:
032: List<Record> progression;
033:
034: Identity assignee;
035: Criticality criticality;
036: Timestamp obsolete;
037:
038: public int getVersion() {
039: return version;
040: }
041:
042: public void setVersion(int version) {
043: this .version = version;
044: }
045:
046: public RiskType getType() {
047: return type;
048: }
049:
050: public void setType(RiskType type) {
051: this .type = type;
052: }
053:
054: public BigDecimal getCoverage() {
055: return coverage;
056: }
057:
058: public void setCoverage(BigDecimal coverage) {
059: this .coverage = coverage;
060: }
061:
062: public BigDecimal getAmount() {
063: return amount;
064: }
065:
066: public void setAmount(BigDecimal amount) {
067: this .amount = amount;
068: }
069:
070: public BigDecimal getProbability() {
071: return probability;
072: }
073:
074: public void setProbability(BigDecimal probability) {
075: this .probability = probability;
076: }
077:
078: public String getComment() {
079: return comment;
080: }
081:
082: public void setComment(String comment) {
083: this .comment = comment;
084: }
085:
086: public Identity getAssignee() {
087: return assignee;
088: }
089:
090: public void setAssignee(Identity assignee) {
091: this .assignee = assignee;
092: }
093:
094: public Criticality getCriticality() {
095: return criticality;
096: }
097:
098: public void setCriticality(Criticality criticality) {
099: this .criticality = criticality;
100: }
101:
102: public List<Record> getProgression() {
103: return progression;
104: }
105:
106: public void setProgression(List<Record> progression) {
107: this .progression = progression;
108: }
109:
110: public Timestamp getObsolete() {
111: return obsolete;
112: }
113:
114: public void setObsolete(Timestamp obsolete) {
115: this .obsolete = obsolete;
116: }
117:
118: public String toString() {
119: if (amount != null && probability != null)
120: return getKey() + " " + amount.multiply(probability);
121: else
122: return getKey() + "";
123: }
124: }
|