-
Notifications
You must be signed in to change notification settings - Fork 18
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 #284 from fjtirado/Fix_#281
[Fix #281] Adding deserializer support
- Loading branch information
Showing
15 changed files
with
159 additions
and
28 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
16 changes: 16 additions & 0 deletions
16
...ion-tests/src/main/java/io/quarkus/reactivemessaging/http/FirstLowerCaseDeserializer.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,16 @@ | ||
package io.quarkus.reactivemessaging.http; | ||
|
||
import io.quarkus.reactivemessaging.http.runtime.serializers.Deserializer; | ||
import io.vertx.core.buffer.Buffer; | ||
|
||
public class FirstLowerCaseDeserializer implements Deserializer<String> { | ||
|
||
@Override | ||
public String deserialize(Buffer payload) { | ||
StringBuilder sb = new StringBuilder(payload.toString()); | ||
if (sb.length() > 0) { | ||
sb.setCharAt(0, Character.toLowerCase(sb.charAt(0))); | ||
} | ||
return sb.toString(); | ||
} | ||
} |
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
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
4 changes: 2 additions & 2 deletions
4
...src/main/java/io/quarkus/reactivemessaging/http/runtime/config/WebSocketStreamConfig.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
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
22 changes: 22 additions & 0 deletions
22
...ime/src/main/java/io/quarkus/reactivemessaging/http/runtime/serializers/Deserializer.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,22 @@ | ||
package io.quarkus.reactivemessaging.http.runtime.serializers; | ||
|
||
import io.vertx.core.buffer.Buffer; | ||
|
||
/** | ||
* Reactive http connector deserializer. | ||
* Deserializes given payload from a {@link Buffer} | ||
* | ||
* | ||
* @param <PayloadType> type of the payload to deserialize | ||
*/ | ||
public interface Deserializer<PayloadType> { | ||
|
||
/** | ||
* Deserialize the payload | ||
* | ||
* @param payload buffer to deserialize | ||
* @return deserialized object | ||
*/ | ||
PayloadType deserialize(Buffer payload); | ||
|
||
} |
Oops, something went wrong.