|
1 | | -/* |
2 | | -* Copyright IBM Corp. 1987, 2024 |
3 | | -* |
4 | | -* Licensed to the Apache Software Foundation (ASF) under one |
5 | | -* or more contributor license agreements. See the NOTICE file |
6 | | -* distributed with this work for additional information |
7 | | -* regarding copyright ownership. The ASF licenses this file |
8 | | -* to you under the Apache License, Version 2.0 (the |
9 | | -* "License"); you may not use this file except in compliance |
10 | | -* with the License. You may obtain a copy of the License at |
11 | | -* |
12 | | -* http://www.apache.org/licenses/LICENSE-2.0 |
13 | | -* |
14 | | -* Unless required by applicable law or agreed to in writing, |
15 | | -* software distributed under the License is distributed on an |
16 | | -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
17 | | -* KIND, either express or implied. See the License for the |
18 | | -* specific language governing permissions and limitations |
19 | | -* under the License. |
20 | | -* |
21 | | -**/ |
22 | | - |
23 | | -package miniloan; |
24 | | -import javax.xml.bind.annotation.XmlAccessType; |
25 | | -import javax.xml.bind.annotation.XmlAccessorType; |
26 | | -import javax.xml.bind.annotation.XmlElement; |
27 | | - |
28 | | - |
29 | | -// import to be able to use the annotations for the BOM |
30 | | -import ilog.rules.bom.annotations.*; |
31 | | - |
32 | | -/** |
33 | | - * This class models a borrower. |
34 | | - * A borrower is created with a name, a credit score, and a yearly income. |
35 | | - */ |
36 | | -@XmlAccessorType(XmlAccessType.FIELD) |
37 | | -public class Borrower { |
38 | | - @XmlElement |
39 | | - private String name; |
40 | | - @XmlElement |
41 | | - private int creditScore; |
42 | | - @XmlElement |
43 | | - private int yearlyIncome; |
44 | | - |
45 | | - public Borrower() { |
46 | | - } |
47 | | - |
48 | | - /** |
49 | | - * Builds a borrower. |
50 | | - * The parameters names to be used in the BOM are given with the annotation BusinessName |
51 | | - * @param name The name of the borrower. |
52 | | - * @param creditScore The credit score of the borrower. |
53 | | - * @param yearlyIncome The yearly income of the borrower. |
54 | | - */ |
55 | | - public Borrower(@BusinessName("name") String name,@BusinessName("creditScore") int creditScore, |
56 | | - @BusinessName("yearlyIncome") int yearlyIncome) { |
57 | | - this(); |
58 | | - this.name = name; |
59 | | - this.creditScore = creditScore; |
60 | | - this.yearlyIncome = yearlyIncome; |
61 | | - } |
62 | | - |
63 | | - /** |
64 | | - * @return The name of the borrower. |
65 | | - */ |
66 | | - public String getName() { |
67 | | - return name; |
68 | | - } |
69 | | - /** |
70 | | - * Sets the name of the borrower. |
71 | | - * @param name The name to set. |
72 | | - */ |
73 | | - public void setName(String n) { |
74 | | - name = n; |
75 | | - } |
76 | | - /** |
77 | | - * @return The credit score of the borrower. |
78 | | - */ |
79 | | - public int getCreditScore() { |
80 | | - return creditScore; |
81 | | - } |
82 | | - /** |
83 | | - * Sets the credit score of the borrower. |
84 | | - * @param creditScore The credit score to set. |
85 | | - */ |
86 | | - public void setCreditScore(int creditScore) { |
87 | | - this.creditScore = creditScore; |
88 | | - } |
89 | | - /** |
90 | | - * @return The yearly income of the borrower. |
91 | | - */ |
92 | | - public int getYearlyIncome() { |
93 | | - return yearlyIncome; |
94 | | - } |
95 | | - /** |
96 | | - * Sets the yearly income of the borrower. |
97 | | - * @param yearlyIncome The yearly income to set. |
98 | | - */ |
99 | | - public void setYearlyIncome(int yearlyIncome) { |
100 | | - this.yearlyIncome = yearlyIncome; |
101 | | - } |
102 | | -} |
| 1 | +/* |
| 2 | +* Copyright IBM Corp. 1987, 2024 |
| 3 | +* |
| 4 | +* Licensed to the Apache Software Foundation (ASF) under one |
| 5 | +* or more contributor license agreements. See the NOTICE file |
| 6 | +* distributed with this work for additional information |
| 7 | +* regarding copyright ownership. The ASF licenses this file |
| 8 | +* to you under the Apache License, Version 2.0 (the |
| 9 | +* "License"); you may not use this file except in compliance |
| 10 | +* with the License. You may obtain a copy of the License at |
| 11 | +* |
| 12 | +* http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | +* |
| 14 | +* Unless required by applicable law or agreed to in writing, |
| 15 | +* software distributed under the License is distributed on an |
| 16 | +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 17 | +* KIND, either express or implied. See the License for the |
| 18 | +* specific language governing permissions and limitations |
| 19 | +* under the License. |
| 20 | +* |
| 21 | +**/ |
| 22 | + |
| 23 | +package miniloan; |
| 24 | + |
| 25 | +/** |
| 26 | + * This class models a borrower. |
| 27 | + * A borrower is created with a name, a credit score, and a yearly income. |
| 28 | + */ |
| 29 | +public class Borrower { |
| 30 | + private String name; |
| 31 | + private int creditScore; |
| 32 | + private int yearlyIncome; |
| 33 | + |
| 34 | + public Borrower() { |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * Builds a borrower. |
| 39 | + * The parameters names to be used in the BOM are given with the annotation BusinessName |
| 40 | + * @param name The name of the borrower. |
| 41 | + * @param creditScore The credit score of the borrower. |
| 42 | + * @param yearlyIncome The yearly income of the borrower. |
| 43 | + */ |
| 44 | + public Borrower(String name, int creditScore, int yearlyIncome) { |
| 45 | + this(); |
| 46 | + this.name = name; |
| 47 | + this.creditScore = creditScore; |
| 48 | + this.yearlyIncome = yearlyIncome; |
| 49 | + } |
| 50 | + |
| 51 | + /** |
| 52 | + * @return The name of the borrower. |
| 53 | + */ |
| 54 | + public String getName() { |
| 55 | + return name; |
| 56 | + } |
| 57 | + /** |
| 58 | + * Sets the name of the borrower. |
| 59 | + * @param name The name to set. |
| 60 | + */ |
| 61 | + public void setName(String n) { |
| 62 | + name = n; |
| 63 | + } |
| 64 | + /** |
| 65 | + * @return The credit score of the borrower. |
| 66 | + */ |
| 67 | + public int getCreditScore() { |
| 68 | + return creditScore; |
| 69 | + } |
| 70 | + /** |
| 71 | + * Sets the credit score of the borrower. |
| 72 | + * @param creditScore The credit score to set. |
| 73 | + */ |
| 74 | + public void setCreditScore(int creditScore) { |
| 75 | + this.creditScore = creditScore; |
| 76 | + } |
| 77 | + /** |
| 78 | + * @return The yearly income of the borrower. |
| 79 | + */ |
| 80 | + public int getYearlyIncome() { |
| 81 | + return yearlyIncome; |
| 82 | + } |
| 83 | + /** |
| 84 | + * Sets the yearly income of the borrower. |
| 85 | + * @param yearlyIncome The yearly income to set. |
| 86 | + */ |
| 87 | + public void setYearlyIncome(int yearlyIncome) { |
| 88 | + this.yearlyIncome = yearlyIncome; |
| 89 | + } |
| 90 | +} |
0 commit comments