Added types to DataNode map function also added flattend pom to ignore file

This commit is contained in:
Ziver Koc 2020-02-16 00:32:53 +01:00
parent 622665d080
commit 704b5ffc36
3 changed files with 6 additions and 64 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
/bin/
/target/
/.repository/
/.flattened-pom.xml

View file

@ -1,61 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" scope="TEST">
<library name="JUnit4">
<CLASSES>
<root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.12.jar!/" />
<root url="jar://$APPLICATION_HOME_DIR$/lib/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="lib">
<CLASSES>
<root url="file://$MODULE_DIR$/lib" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$MODULE_DIR$/lib" />
<root url="jar://$USER_HOME$/.ideaLibSources/commons-fileupload-1.2.1-sources.jar!/" />
</SOURCES>
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" type="SOURCES" />
</library>
</orderEntry>
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-controls:win:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-graphics:win:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-base:win:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-fxml:win:11" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-controls:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-controls:linux:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-graphics:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-graphics:linux:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-base:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-base:linux:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-fxml:11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.openjfx:javafx-fxml:linux:11" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.36" level="project" />
<orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.8.11.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: com.carrotsearch:junit-benchmarks:0.7.2" level="project" />
</component>
</module>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4" />

View file

@ -378,7 +378,7 @@ public class DataNode implements Iterable<DataNode> {
* @return the long value in this map
* @throws NullPointerException if the node is not of type map
*/
public Map getMap(String key) {
public Map<String,?> getMap(String key) {
if (!this.isMap())
throw new NullPointerException("The node is not setup as a map");
@ -425,7 +425,7 @@ public class DataNode implements Iterable<DataNode> {
* @return a list with the items in the node
* @throws NullPointerException if the node is not of type list
*/
public List getList() {
public List<?> getList() {
if (!this.isList()) throw new NullPointerException("The node is not setup as a list");
List output = new ArrayList();
@ -445,10 +445,10 @@ public class DataNode implements Iterable<DataNode> {
* @return a map with the items in the node
* @throws NullPointerException if the node is not of type map
*/
public Map getMap() {
public Map<String,?> getMap() {
if (!this.isMap()) throw new NullPointerException("The node is not setup as a map");
Map output = new HashMap();
Map<String,Object> output = new HashMap<>();
for (String key : map.keySet()) {
DataNode node = get(key);
switch (node.getType()) {