Skip to content

Commit

Permalink
making nullity clearer in TalkPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Nov 19, 2020
1 parent e0f292f commit 0db8382
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/vonage/client/voice/TalkPayload.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
* {@code style}: The Vocal Style to use (vocal Range, tessitura, timbre to use in the TTS
*/

@JsonInclude(JsonInclude.Include.NON_NULL)
public class TalkPayload {
private String text;
private int loop;
private TextToSpeechLanguage language;
private int style;

@JsonInclude(JsonInclude.Include.NON_NULL)
private Integer style = null;

@Deprecated
@JsonInclude(JsonInclude.Include.NON_NULL)
private VoiceName voiceName;

@Deprecated
Expand Down Expand Up @@ -70,14 +72,17 @@ public String getText() {
return text;
}

@JsonProperty(value = "voice_name",defaultValue = "")
@JsonProperty(value = "voice_name")
@JsonInclude(JsonInclude.Include.NON_NULL)
public VoiceName getVoiceName() {
return voiceName;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public TextToSpeechLanguage getLanguage() { return language; }

public int getStyle() { return style; }
@JsonInclude(JsonInclude.Include.NON_NULL)
public Integer getStyle() { return style; }

public String toJson() {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/vonage/client/voice/TalkPayloadTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void getLanguage() throws Exception {

@Test
public void getStyle() throws Exception{
assertEquals(2,payload.getStyle());
assertEquals(new Integer(2),payload.getStyle());
}

@Test
Expand Down

0 comments on commit 0db8382

Please sign in to comment.