01: package org.osbl.riskmanagement.model;
02:
03: import org.conform.*;
04: import org.conform.validator.NumberRange;
05: import org.osbl.persistence.model.Entity;
06: import org.osbl.identity.model.Identity;
07:
08: import java.math.BigDecimal;
09: import java.sql.Timestamp;
10:
11: /**
12: * @author hengels
13: * @version $Revision: 840 $
14: */
15: public class Record {
16: Long id;
17:
18: @Property(mandatory="true")
19: Timestamp timestamp;
20:
21: @NumberRange(from="0")
22: BigDecimal coverage;
23: @NumberRange(from="0")
24: BigDecimal amount;
25: @NumberRange(from="0",fromInclusive=true,until="100",untilInclusive=true)
26: BigDecimal probability;
27:
28: String comment;
29:
30: public Long getId() {
31: return id;
32: }
33:
34: public void setId(Long id) {
35: this .id = id;
36: }
37:
38: public Timestamp getTimestamp() {
39: return timestamp;
40: }
41:
42: public void setTimestamp(Timestamp timestamp) {
43: this .timestamp = timestamp;
44: }
45:
46: public BigDecimal getCoverage() {
47: return coverage;
48: }
49:
50: public void setCoverage(BigDecimal coverage) {
51: this .coverage = coverage;
52: }
53:
54: public BigDecimal getAmount() {
55: return amount;
56: }
57:
58: public void setAmount(BigDecimal amount) {
59: this .amount = amount;
60: }
61:
62: public BigDecimal getProbability() {
63: return probability;
64: }
65:
66: public void setProbability(BigDecimal probability) {
67: this .probability = probability;
68: }
69:
70: public String getComment() {
71: return comment;
72: }
73:
74: public void setComment(String comment) {
75: this .comment = comment;
76: }
77:
78: public String toString() {
79: if (amount != null && probability != null)
80: return timestamp + " " + amount.multiply(probability);
81: else
82: return timestamp + "";
83: }
84: }
|