]> git.mxchange.org Git - jfinancials-swing.git/blob - Addressbook/src/org/mxchange/addressbook/BaseFrameworkSystem.java
680474db064288d1de4d9e47f98835ed158060be
[jfinancials-swing.git] / Addressbook / src / org / mxchange / addressbook / BaseFrameworkSystem.java
1 /*\r
2  * Copyright (C) 2015 Roland Haeder\r
3  *\r
4  * This program is free software: you can redistribute it and/or modify\r
5  * it under the terms of the GNU General Public License as published by\r
6  * the Free Software Foundation, either version 3 of the License, or\r
7  * (at your option) any later version.\r
8  *\r
9  * This program is distributed in the hope that it will be useful,\r
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
12  * GNU General Public License for more details.\r
13  *\r
14  * You should have received a copy of the GNU General Public License\r
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
16  */\r
17 package org.mxchange.addressbook;\r
18 \r
19 import java.util.ResourceBundle;\r
20 import org.apache.logging.log4j.LogManager;\r
21 import org.apache.logging.log4j.Logger;\r
22 import org.mxchange.addressbook.application.Application;\r
23 import org.mxchange.addressbook.client.Client;\r
24 import org.mxchange.addressbook.manager.contact.ManageableContact;\r
25 \r
26 /**\r
27  * General class\r
28  *\r
29  * @author Roland Haeder\r
30  */\r
31 public class BaseFrameworkSystem implements FrameworkInterface {\r
32     /**\r
33      * Class' logger\r
34      */\r
35     private final Logger LOG;\r
36 \r
37     /**\r
38      * Application instance\r
39      */\r
40     private Application application;\r
41 \r
42     /**\r
43      * Bundle instance\r
44      */\r
45     private final ResourceBundle bundle;\r
46 \r
47     /**\r
48      * Client instance\r
49      */\r
50     private Client client;\r
51 \r
52     /**\r
53      * Contact manager instance\r
54      */\r
55     private ManageableContact contactManager;\r
56 \r
57     /**\r
58      * Name of used database table, handled over to backend\r
59      */\r
60     private String tableName;\r
61 \r
62 \r
63     /**\r
64      * Initialize object\r
65      */\r
66     {\r
67         LOG = LogManager.getLogger(this);\r
68         bundle = ResourceBundle.getBundle("org/mxchange/addressbook/localization/bundle"); // NOI18N\r
69     }\r
70 \r
71     /**\r
72      * No instances can be created of this class\r
73      */\r
74     protected BaseFrameworkSystem () {\r
75     }\r
76 \r
77     /**\r
78      * Application instance\r
79      * \r
80      * @return the application\r
81      */\r
82     @Override\r
83     public final Application getApplication () {\r
84         return this.application;\r
85     }\r
86 \r
87     /**\r
88      * Client instance\r
89      * \r
90      * @return the client\r
91      */\r
92     @Override\r
93     public final Client getClient () {\r
94         return this.client;\r
95     }\r
96 \r
97     /**\r
98      * Contact manager instance\r
99      * @return the contactManager\r
100      */\r
101     @Override\r
102     public final ManageableContact getContactManager () {\r
103         return this.contactManager;\r
104     }\r
105 \r
106     /**\r
107      * Contact manager instance\r
108      * @param contactManager the contactManager to set\r
109      */\r
110     protected final void setContactManager (final ManageableContact contactManager) {\r
111         this.contactManager = contactManager;\r
112     }\r
113 \r
114     /**\r
115      * Client instance\r
116      * @param client the client to set\r
117      */\r
118     protected final void setClient (final Client client) {\r
119         this.client = client;\r
120     }\r
121 \r
122     /**\r
123      * Application instance\r
124      *\r
125      * @param application the application to set\r
126      */\r
127     protected final void setApplication(final Application application) {\r
128         this.application = application;\r
129     }\r
130 \r
131     /**\r
132      * Getter for logger\r
133      *\r
134      * @return Logger\r
135      */\r
136     protected final Logger getLogger () {\r
137         return this.LOG;\r
138     }\r
139 \r
140     /**\r
141      * Name of used database table, handled over to backend\r
142      * \r
143      * @return the tableName\r
144      */\r
145     protected final String getTableName () {\r
146         return this.tableName;\r
147     }\r
148 \r
149     /**\r
150      * Name of used database table, handled over to backend\r
151      * \r
152      * @param tableName the tableName to set\r
153      */\r
154     protected final void setTableName (final String tableName) {\r
155         this.tableName = tableName;\r
156     }\r
157 \r
158     /**\r
159      * Getter for bundle instance\r
160      * \r
161      * @return Resource bundle\r
162      */\r
163     protected ResourceBundle getBundle () {\r
164         return this.bundle;\r
165     }\r
166 }\r