c31427bcb852a4b8436b2e2a71521e4bd5743da9
[utils] /
1 package org.wamblee.support.persistence;
2
3 /**
4  * Description of a specific database. 
5  */
6 public class DatabaseDescription {
7
8         private String[] itsCapabilities; 
9         private String itsDatabase; 
10         private String itsOther;
11         
12         /**
13          * Constructs the description. 
14          * @param aCapabilities List of all capabilities. 
15          * @param aDatabase Database. 
16          * @param aOther Other information. 
17          */
18         public DatabaseDescription(String[] aCapabilities, String aDatabase, String aOther) {
19                 itsCapabilities = aCapabilities; 
20                 itsDatabase = aDatabase; 
21                 itsOther = aOther;
22         }
23         
24         @Override
25         public String toString() {
26                 return "\n  Database " + itsDatabase + 
27                                 "\n    Capabilities: "  + printCapabilities() + 
28                                 "\n    Other info:   " + itsOther; 
29         }
30         
31         private String printCapabilities() {
32                 String res = "";
33                 for (int i = 0; i < itsCapabilities.length; i++) { 
34                         res += "" + itsCapabilities[i]; 
35                         if ( i < itsCapabilities.length -1 ) { 
36                                 res += ", ";
37                         }
38                 }
39                 return res; 
40         }
41 }