Skip to content

Commit

Permalink
Merge pull request #130 from kondapally1989/master
Browse files Browse the repository at this point in the history
adding toString method to IntOrString
  • Loading branch information
brendandburns authored Nov 29, 2017
2 parents fc13f8f + b3421f1 commit 562b3c0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public Integer getIntValue() {
return intValue;
}

@Override
public String toString() {
return (isInt ? String.valueOf(intValue) : strValue);
}

public static class IntOrStringAdapter extends TypeAdapter<IntOrString> {
@Override
public void write(JsonWriter jsonWriter, IntOrString intOrString) throws IOException {
Expand Down

0 comments on commit 562b3c0

Please sign in to comment.