View Javadoc
1   /*
2    * MoneyWise: Finance Application
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.moneywise.sheets;
18  
19  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDataSet;
20  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseLoanInfo;
21  import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
22  import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataValues;
23  import io.github.tonywasher.joceanus.prometheus.sheets.PrometheusSheetDataInfo;
24  import io.github.tonywasher.joceanus.prometheus.sheets.PrometheusSheetReader;
25  import io.github.tonywasher.joceanus.prometheus.sheets.PrometheusSheetWriter;
26  
27  /**
28   * SheetDataInfo extension for LoanInfo.
29   *
30   * @author Tony Washer
31   */
32  public final class MoneyWiseSheetLoanInfo
33          extends PrometheusSheetDataInfo<MoneyWiseLoanInfo> {
34      /**
35       * NamedArea for DepositInfo.
36       */
37      private static final String AREA_LOANINFO = MoneyWiseLoanInfo.LIST_NAME;
38  
39      /**
40       * Constructor for loading a spreadsheet.
41       *
42       * @param pReader the spreadsheet reader
43       */
44      MoneyWiseSheetLoanInfo(final PrometheusSheetReader pReader) {
45          /* Call super-constructor */
46          super(pReader, AREA_LOANINFO);
47  
48          /* Access the InfoType list */
49          final MoneyWiseDataSet myData = (MoneyWiseDataSet) pReader.getData();
50          setDataList(myData.getLoanInfo());
51      }
52  
53      /**
54       * Constructor for creating a spreadsheet.
55       *
56       * @param pWriter the spreadsheet writer
57       */
58      MoneyWiseSheetLoanInfo(final PrometheusSheetWriter pWriter) {
59          /* Call super-constructor */
60          super(pWriter, AREA_LOANINFO);
61  
62          /* Access the InfoType list */
63          final MoneyWiseDataSet myData = (MoneyWiseDataSet) pWriter.getData();
64          setDataList(myData.getLoanInfo());
65      }
66  
67      @Override
68      public PrometheusDataValues loadSecureValues() throws OceanusException {
69          /* Build data values */
70          return getRowValues(MoneyWiseLoanInfo.OBJECT_NAME);
71      }
72  }