Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.yangutils.translator.tojava; |
| 17 | |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 18 | import java.util.ArrayList; |
| 19 | import java.util.List; |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 20 | import java.util.SortedSet; |
| 21 | import java.util.TreeSet; |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 22 | |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 23 | import static org.onosproject.yangutils.utils.UtilConstants.ABSTRACT_EVENT; |
Bharat saraswal | e707f03 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 24 | import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER; |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 25 | import static org.onosproject.yangutils.utils.UtilConstants.BITSET; |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 26 | import static org.onosproject.yangutils.utils.UtilConstants.COLLECTION_IMPORTS; |
| 27 | import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING; |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 28 | import static org.onosproject.yangutils.utils.UtilConstants.EVENT_LISTENER; |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 29 | import static org.onosproject.yangutils.utils.UtilConstants.GOOGLE_MORE_OBJECT_IMPORT_CLASS; |
| 30 | import static org.onosproject.yangutils.utils.UtilConstants.GOOGLE_MORE_OBJECT_IMPORT_PKG; |
Bharat saraswal | b551aae | 2016-07-14 15:18:20 +0530 | [diff] [blame] | 31 | import static org.onosproject.yangutils.utils.UtilConstants.HASH_MAP; |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 32 | import static org.onosproject.yangutils.utils.UtilConstants.IMPORT; |
| 33 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_LANG; |
Bharat saraswal | e707f03 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 34 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_MATH; |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 35 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_CLASS; |
| 36 | import static org.onosproject.yangutils.utils.UtilConstants.JAVA_UTIL_OBJECTS_IMPORT_PKG; |
| 37 | import static org.onosproject.yangutils.utils.UtilConstants.LIST; |
Bharat saraswal | ab4c6ba | 2016-05-17 14:19:38 +0530 | [diff] [blame] | 38 | import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_REG; |
| 39 | import static org.onosproject.yangutils.utils.UtilConstants.LISTENER_SERVICE; |
Bharat saraswal | b551aae | 2016-07-14 15:18:20 +0530 | [diff] [blame] | 40 | import static org.onosproject.yangutils.utils.UtilConstants.MAP; |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 41 | import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE; |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 42 | import static org.onosproject.yangutils.utils.UtilConstants.ONOS_EVENT_PKG; |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 43 | import static org.onosproject.yangutils.utils.UtilConstants.PERIOD; |
| 44 | import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN; |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 45 | import static java.util.Collections.sort; |
| 46 | |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 47 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 48 | * Represents that generated Java file can contain imports. |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 49 | */ |
| 50 | public class JavaImportData { |
| 51 | |
| 52 | /** |
| 53 | * Flag to denote if any list in imported. |
| 54 | */ |
| 55 | private boolean isListToImport; |
| 56 | |
| 57 | /** |
| 58 | * Sorted set of import info, to be used to maintain the set of classes to |
| 59 | * be imported in the generated class. |
| 60 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 61 | private SortedSet<JavaQualifiedTypeInfoTranslator> importSet; |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 62 | |
| 63 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 64 | * Creates java import data object. |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 65 | */ |
| 66 | public JavaImportData() { |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 67 | setImportSet(new TreeSet<>()); |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 71 | * Returns if the list needs to be imported. |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 72 | * |
Vidyashree Rama | 7445371 | 2016-04-18 12:29:39 +0530 | [diff] [blame] | 73 | * @return true if any of the attribute needs to be maintained as a list |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 74 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 75 | private boolean getIfListImported() { |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 76 | return isListToImport; |
| 77 | } |
| 78 | |
| 79 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 80 | * Sets the status of importing list. |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 81 | * |
Vidyashree Rama | 7445371 | 2016-04-18 12:29:39 +0530 | [diff] [blame] | 82 | * @param isList status to mention list is bing imported |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 83 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 84 | void setIfListImported(boolean isList) { |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 85 | isListToImport = isList; |
| 86 | } |
| 87 | |
| 88 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 89 | * Returns the set containing the imported class/interface info. |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 90 | * |
| 91 | * @return the set containing the imported class/interface info |
| 92 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 93 | public SortedSet<JavaQualifiedTypeInfoTranslator> getImportSet() { |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 94 | return importSet; |
| 95 | } |
| 96 | |
| 97 | /** |
Bharat saraswal | cc1cdab | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 98 | * Assigns the set containing the imported class/interface info. |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 99 | * |
| 100 | * @param importSet the set containing the imported class/interface info |
| 101 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 102 | private void setImportSet(SortedSet<JavaQualifiedTypeInfoTranslator> importSet) { |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 103 | this.importSet = importSet; |
| 104 | } |
| 105 | |
| 106 | /** |
Bharat saraswal | cc1cdab | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 107 | * Adds an imported class/interface info if it is not already part of the |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 108 | * collection. |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 109 | * <p> |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 110 | * If already part of the collection, check if the packages are same, if so |
| 111 | * then return true, to denote it is already in the import collection, and |
| 112 | * it can be accessed without qualified access. If the packages do not |
| 113 | * match, then do not add to the import collection, and return false to |
| 114 | * denote, it is not added to import collection and needs to be accessed in |
| 115 | * a qualified manner. |
| 116 | * |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 117 | * @param newImportInfo class/interface info being imported |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 118 | * @param className name of the call being generated |
| 119 | * @param classPkg generated class package |
| 120 | * @return qualified access status of the import node being added |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 121 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 122 | public boolean addImportInfo(JavaQualifiedTypeInfoTranslator newImportInfo, |
| 123 | String className, String classPkg) { |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 124 | |
| 125 | if (newImportInfo.getClassInfo().contentEquals(className)) { |
| 126 | /* |
| 127 | * if the current class name is same as the attribute class name, |
| 128 | * then the attribute must be accessed in a qualified manner. |
| 129 | */ |
| 130 | return true; |
| 131 | } else if (newImportInfo.getPkgInfo() == null) { |
| 132 | /* |
| 133 | * If the package info is null, then it is not a candidate for import / qualified access |
| 134 | */ |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | /* |
| 139 | * If the attribute type is having the package info, it is contender |
| 140 | * for import list and also need to check if it needs to be a |
| 141 | * qualified access. |
| 142 | */ |
| 143 | if (newImportInfo.getPkgInfo().contentEquals(classPkg)) { |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 144 | /* |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 145 | * Package of the referred attribute and the generated class is same, so no need import |
| 146 | * or qualified access. |
| 147 | */ |
| 148 | return false; |
| 149 | } |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 150 | |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 151 | for (JavaQualifiedTypeInfoTranslator curImportInfo : getImportSet()) { |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 152 | if (curImportInfo.getClassInfo() |
| 153 | .contentEquals(newImportInfo.getClassInfo())) { |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 154 | return !curImportInfo.getPkgInfo() |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 155 | .contentEquals(newImportInfo.getPkgInfo()); |
| 156 | } |
| 157 | } |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 158 | |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 159 | /* |
| 160 | * import is added, so it is a member for non qualified access |
| 161 | */ |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 162 | getImportSet().add(newImportInfo); |
VinodKumarS-Huawei | 2ee9e7e | 2016-06-01 14:30:22 +0530 | [diff] [blame] | 163 | return false; |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 164 | } |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 165 | |
| 166 | /** |
| 167 | * Returns import for class. |
| 168 | * |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 169 | * @return imports for class |
| 170 | */ |
| 171 | public List<String> getImports() { |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 172 | |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 173 | String importString; |
| 174 | List<String> imports = new ArrayList<>(); |
| 175 | |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 176 | for (JavaQualifiedTypeInfoTranslator importInfo : getImportSet()) { |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 177 | if (!importInfo.getPkgInfo().equals(EMPTY_STRING) && importInfo.getClassInfo() != null |
| 178 | && !importInfo.getPkgInfo().equals(JAVA_LANG)) { |
| 179 | importString = IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN |
| 180 | + NEW_LINE; |
| 181 | |
| 182 | imports.add(importString); |
| 183 | } |
| 184 | } |
| 185 | |
Bharat saraswal | c0e0484 | 2016-05-12 13:16:57 +0530 | [diff] [blame] | 186 | if (getIfListImported()) { |
Vinod Kumar S | e4b9b0c | 2016-04-30 21:09:15 +0530 | [diff] [blame] | 187 | imports.add(getImportForList()); |
| 188 | } |
| 189 | |
Vidyashree Rama | 7142d9c | 2016-04-26 15:06:06 +0530 | [diff] [blame] | 190 | sort(imports); |
| 191 | return imports; |
| 192 | } |
| 193 | |
| 194 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 195 | * Returns import for hash and equals method. |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 196 | * |
| 197 | * @return import for hash and equals method |
| 198 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 199 | String getImportForHashAndEquals() { |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 200 | return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + JAVA_UTIL_OBJECTS_IMPORT_CLASS; |
| 201 | } |
| 202 | |
| 203 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 204 | * Returns import for to string method. |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 205 | * |
| 206 | * @return import for to string method |
| 207 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 208 | String getImportForToString() { |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 209 | return IMPORT + GOOGLE_MORE_OBJECT_IMPORT_PKG + PERIOD + GOOGLE_MORE_OBJECT_IMPORT_CLASS; |
| 210 | } |
| 211 | |
| 212 | /** |
Shankara-Huawei | b9999eb | 2016-07-14 16:53:09 +0530 | [diff] [blame] | 213 | * Returns import for to bitset method. |
| 214 | * |
| 215 | * @return import for to bitset method |
| 216 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 217 | String getImportForToBitSet() { |
Shankara-Huawei | b9999eb | 2016-07-14 16:53:09 +0530 | [diff] [blame] | 218 | return IMPORT + JAVA_UTIL_OBJECTS_IMPORT_PKG + PERIOD + BITSET + SEMI_COLAN + NEW_LINE; |
| 219 | } |
| 220 | |
| 221 | /** |
Bharat saraswal | d9822e9 | 2016-04-05 15:13:44 +0530 | [diff] [blame] | 222 | * Returns import for list attribute. |
| 223 | * |
Bharat saraswal | cc1cdab | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 224 | * @return import for list attribute |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 225 | */ |
Bharat saraswal | 2d90b0c | 2016-08-04 02:00:03 +0530 | [diff] [blame^] | 226 | String getImportForList() { |
Bharat saraswal | e2d51d6 | 2016-03-23 19:40:35 +0530 | [diff] [blame] | 227 | return IMPORT + COLLECTION_IMPORTS + PERIOD + LIST + SEMI_COLAN + NEW_LINE; |
| 228 | } |
Bharat saraswal | cc1cdab | 2016-04-16 02:28:25 +0530 | [diff] [blame] | 229 | |
| 230 | /** |
Bharat saraswal | ab4c6ba | 2016-05-17 14:19:38 +0530 | [diff] [blame] | 231 | * Returns import string for ListenerService class. |
| 232 | * |
| 233 | * @return import string for ListenerService class |
| 234 | */ |
| 235 | public String getListenerServiceImport() { |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 236 | return IMPORT + ONOS_EVENT_PKG + PERIOD + LISTENER_SERVICE + SEMI_COLAN + NEW_LINE; |
Bharat saraswal | ab4c6ba | 2016-05-17 14:19:38 +0530 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Returns import string for ListenerRegistry class. |
| 241 | * |
| 242 | * @return import string for ListenerRegistry class |
| 243 | */ |
| 244 | public String getListenerRegistryImport() { |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 245 | return IMPORT + ONOS_EVENT_PKG + PERIOD + LISTENER_REG + SEMI_COLAN + NEW_LINE; |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Returns import string for AbstractEvent class. |
| 250 | * |
| 251 | * @return import string for AbstractEvent class |
| 252 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 253 | String getAbstractEventsImport() { |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 254 | return IMPORT + ONOS_EVENT_PKG + PERIOD + ABSTRACT_EVENT + SEMI_COLAN + NEW_LINE; |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * Returns import string for EventListener class. |
| 259 | * |
| 260 | * @return import string for EventListener class |
| 261 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 262 | String getEventListenerImport() { |
Bharat saraswal | 33dfa01 | 2016-05-17 19:59:16 +0530 | [diff] [blame] | 263 | return IMPORT + ONOS_EVENT_PKG + PERIOD + EVENT_LISTENER + SEMI_COLAN + NEW_LINE; |
Bharat saraswal | ab4c6ba | 2016-05-17 14:19:38 +0530 | [diff] [blame] | 264 | } |
Bharat saraswal | b551aae | 2016-07-14 15:18:20 +0530 | [diff] [blame] | 265 | |
| 266 | /** |
| 267 | * Returns import string for map class. |
| 268 | * |
| 269 | * @return import string for map class |
| 270 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 271 | String getMapImport() { |
Bharat saraswal | b551aae | 2016-07-14 15:18:20 +0530 | [diff] [blame] | 272 | return IMPORT + COLLECTION_IMPORTS + PERIOD + MAP + SEMI_COLAN + NEW_LINE; |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * Returns import string for hash map class. |
| 277 | * |
| 278 | * @return import string for hash map class |
| 279 | */ |
Shankara-Huawei | bdf24bb | 2016-08-02 18:13:13 +0530 | [diff] [blame] | 280 | String getHashMapImport() { |
Bharat saraswal | b551aae | 2016-07-14 15:18:20 +0530 | [diff] [blame] | 281 | return IMPORT + COLLECTION_IMPORTS + PERIOD + HASH_MAP + SEMI_COLAN + NEW_LINE; |
| 282 | } |
| 283 | |
| 284 | /** |
Bharat saraswal | e707f03 | 2016-07-14 23:33:55 +0530 | [diff] [blame] | 285 | * Returns import for big integer. |
| 286 | * |
| 287 | * @return import for big integer |
| 288 | */ |
| 289 | public String getBigIntegerImport() { |
| 290 | return IMPORT + JAVA_MATH + PERIOD + |
| 291 | BIG_INTEGER + SEMI_COLAN + NEW_LINE; |
| 292 | } |
Vinod Kumar S | 3804650 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 293 | } |