-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa15d96
commit 2dfa93a
Showing
9 changed files
with
78 additions
and
41 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
16 changes: 8 additions & 8 deletions
16
net/src/main/java/com/syntaxphoenix/syntaxapi/net/http/RequestSerializer.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,8 +1,8 @@ | ||
package com.syntaxphoenix.syntaxapi.net.http; | ||
|
||
@FunctionalInterface | ||
public interface RequestSerializer { | ||
|
||
public RequestData<?> serialize(String data) throws Exception; | ||
|
||
} | ||
package com.syntaxphoenix.syntaxapi.net.http; | ||
|
||
@FunctionalInterface | ||
public interface RequestSerializer { | ||
|
||
public RequestData<?> serialize(byte[] data) throws Exception; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
net/src/main/java/com/syntaxphoenix/syntaxapi/net/http/RequestTextSerializer.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,14 @@ | ||
package com.syntaxphoenix.syntaxapi.net.http; | ||
|
||
import java.nio.charset.StandardCharsets; | ||
|
||
@FunctionalInterface | ||
public interface RequestTextSerializer extends RequestSerializer { | ||
|
||
default RequestData<?> serialize(byte[] data) throws Exception { | ||
return serialize(new String(data, StandardCharsets.UTF_8)); | ||
} | ||
|
||
RequestData<?> serialize(String data) throws Exception; | ||
|
||
} |
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
27 changes: 27 additions & 0 deletions
27
utils/json/json-lib/src/test/java/com/syntaxphoenix/syntaxapi/test/json/JsonValueTest.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 com.syntaxphoenix.syntaxapi.test.json; | ||
|
||
import java.io.IOException; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.syntaxphoenix.syntaxapi.json.io.JsonWriter; | ||
import com.syntaxphoenix.syntaxapi.json.value.JsonInteger; | ||
import com.syntaxphoenix.syntaxapi.json.value.JsonString; | ||
|
||
public class JsonValueTest { | ||
|
||
@Test | ||
public void tryJsonWriter() throws IOException { | ||
|
||
System.out.println("== Write Test ==\n"); | ||
|
||
JsonWriter writer = new JsonWriter().setIndent(2).setSpaces(true); | ||
|
||
writer.toStream(new JsonInteger(152), System.out); | ||
writer.toStream(new JsonString("Test"), System.out); | ||
|
||
System.out.println("\n== Write Test =="); | ||
|
||
} | ||
|
||
} |