-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #875 from vikasgupta78/relate
merge main OSS into relate OSS
- Loading branch information
Showing
29 changed files
with
253 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
|
||
|
||
|
||
|
||
package zingg.common.client; | ||
|
||
import java.io.Serializable; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
common/client/src/main/java/zingg/common/client/event/listeners/IEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
package zingg.common.client.event.listeners; | ||
|
||
import zingg.common.client.ZinggClientException; | ||
import zingg.common.client.event.events.IEvent; | ||
|
||
public class IEventListener { | ||
|
||
public void listen(IEvent event) throws ZinggClientException { | ||
public void listen(IEvent event) { | ||
|
||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
common/client/src/main/java/zingg/common/client/util/JsonStringify.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package zingg.common.client.util; | ||
|
||
import java.io.IOException; | ||
import java.io.StringWriter; | ||
|
||
import com.fasterxml.jackson.core.JsonParser; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import zingg.common.client.Arguments; | ||
import zingg.common.client.ArgumentsUtil; | ||
|
||
public class JsonStringify { | ||
public static String toString (Object o){ | ||
ObjectMapper mapper = new ObjectMapper(); | ||
mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true); | ||
//mapper.configure(JsonParser.Feature.FAIL_ON_EMPTY_BEANS, true) | ||
try { | ||
StringWriter writer = new StringWriter(); | ||
return mapper.writeValueAsString(o); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
return null; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
common/core/src/test/java/zingg/common/core/util/CsvReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package zingg.common.core.util; | ||
|
||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Scanner; | ||
|
||
public class CsvReader { | ||
protected List<? extends IFromCsv> records; | ||
IFromCsv creator; | ||
|
||
public CsvReader(IFromCsv creator){ | ||
records = new ArrayList<IFromCsv>(); | ||
this.creator = creator; | ||
} | ||
|
||
public List<? extends IFromCsv> getRecords(String file, boolean skipHeader) throws FileNotFoundException{ | ||
int lineno = 0; | ||
try (Scanner scanner = new Scanner(new File(file))) { | ||
while (scanner.hasNextLine()) { | ||
records.add(creator.fromCsv(scanner.nextLine())); | ||
} | ||
} | ||
return records; | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
common/core/src/test/java/zingg/common/core/util/IFromCsv.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package zingg.common.core.util; | ||
|
||
public interface IFromCsv { | ||
|
||
<C> C fromCsv(String s); | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...mmon/infra/util/PojoToArrayConverter.java → ...ommon/core/util/PojoToArrayConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.