Skip to content

Commit

Permalink
align java code
Browse files Browse the repository at this point in the history
  • Loading branch information
mmouly committed Dec 9, 2024
1 parent d6b8c47 commit 14e46e0
Show file tree
Hide file tree
Showing 2 changed files with 263 additions and 291 deletions.
192 changes: 90 additions & 102 deletions doc/rule-projects/miniloan-xom/src/miniloan/Borrower.java
Original file line number Diff line number Diff line change
@@ -1,102 +1,90 @@
/*
* Copyright IBM Corp. 1987, 2024
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
**/

package miniloan;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;


// import to be able to use the annotations for the BOM
import ilog.rules.bom.annotations.*;

/**
* This class models a borrower.
* A borrower is created with a name, a credit score, and a yearly income.
*/
@XmlAccessorType(XmlAccessType.FIELD)
public class Borrower {
@XmlElement
private String name;
@XmlElement
private int creditScore;
@XmlElement
private int yearlyIncome;

public Borrower() {
}

/**
* Builds a borrower.
* The parameters names to be used in the BOM are given with the annotation BusinessName
* @param name The name of the borrower.
* @param creditScore The credit score of the borrower.
* @param yearlyIncome The yearly income of the borrower.
*/
public Borrower(@BusinessName("name") String name,@BusinessName("creditScore") int creditScore,
@BusinessName("yearlyIncome") int yearlyIncome) {
this();
this.name = name;
this.creditScore = creditScore;
this.yearlyIncome = yearlyIncome;
}

/**
* @return The name of the borrower.
*/
public String getName() {
return name;
}
/**
* Sets the name of the borrower.
* @param name The name to set.
*/
public void setName(String n) {
name = n;
}
/**
* @return The credit score of the borrower.
*/
public int getCreditScore() {
return creditScore;
}
/**
* Sets the credit score of the borrower.
* @param creditScore The credit score to set.
*/
public void setCreditScore(int creditScore) {
this.creditScore = creditScore;
}
/**
* @return The yearly income of the borrower.
*/
public int getYearlyIncome() {
return yearlyIncome;
}
/**
* Sets the yearly income of the borrower.
* @param yearlyIncome The yearly income to set.
*/
public void setYearlyIncome(int yearlyIncome) {
this.yearlyIncome = yearlyIncome;
}
}
/*
* Copyright IBM Corp. 1987, 2024
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
**/

package miniloan;

/**
* This class models a borrower.
* A borrower is created with a name, a credit score, and a yearly income.
*/
public class Borrower {
private String name;
private int creditScore;
private int yearlyIncome;

public Borrower() {
}

/**
* Builds a borrower.
* The parameters names to be used in the BOM are given with the annotation BusinessName
* @param name The name of the borrower.
* @param creditScore The credit score of the borrower.
* @param yearlyIncome The yearly income of the borrower.
*/
public Borrower(String name, int creditScore, int yearlyIncome) {
this();
this.name = name;
this.creditScore = creditScore;
this.yearlyIncome = yearlyIncome;
}

/**
* @return The name of the borrower.
*/
public String getName() {
return name;
}
/**
* Sets the name of the borrower.
* @param name The name to set.
*/
public void setName(String n) {
name = n;
}
/**
* @return The credit score of the borrower.
*/
public int getCreditScore() {
return creditScore;
}
/**
* Sets the credit score of the borrower.
* @param creditScore The credit score to set.
*/
public void setCreditScore(int creditScore) {
this.creditScore = creditScore;
}
/**
* @return The yearly income of the borrower.
*/
public int getYearlyIncome() {
return yearlyIncome;
}
/**
* Sets the yearly income of the borrower.
* @param yearlyIncome The yearly income to set.
*/
public void setYearlyIncome(int yearlyIncome) {
this.yearlyIncome = yearlyIncome;
}
}
Loading

0 comments on commit 14e46e0

Please sign in to comment.