forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests with all the primitive values. Remove those that weren't expected to work.
- Loading branch information
1 parent
cdd6968
commit e3b6986
Showing
3 changed files
with
74 additions
and
30 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
21 changes: 21 additions & 0 deletions
21
gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.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,21 @@ | ||
package org.baeldung.gson.primitives.models; | ||
|
||
public class PrimitiveBundleInitialized { | ||
// @formatter:off | ||
public byte byteValue = (byte) 1; | ||
public short shortValue = (short) 1; | ||
public int intValue = 1; | ||
public long longValue = 1L; | ||
public float floatValue = 1.0f; | ||
public double doubleValue = 1; | ||
public boolean booleanValue = true; | ||
public char charValue = 'a'; | ||
// @formatter:on | ||
|
||
public String toString() { | ||
return "{" + "byte: " + byteValue + ", " + "short: " + shortValue + ", " | ||
+ "int: " + intValue + ", " + "long: " + longValue + ", " | ||
+ "float: " + floatValue + ", " + "double: " + doubleValue + ", " | ||
+ "boolean: " + booleanValue + ", " + "char: " + charValue + "}"; | ||
} | ||
} |
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