Add java to java-less '''

This commit is contained in:
Ersin Ertan 2016-03-24 18:51:01 -04:00
parent 633a95be62
commit 0c14ad0117

View file

@ -365,7 +365,7 @@ shouldnt need this `@JsonQualifier`, but its very handy for those that do.
Some models declare fields that shouldnt be included in JSON. For example, suppose our blackjack
hand has a `total` field with the sum of the cards:
```
```java
public final class BlackjackHand {
private int total;
@ -376,7 +376,7 @@ public final class BlackjackHand {
By default, all fields are emitted when encoding JSON, and all fields are accepted when decoding
JSON. Prevent a field from being included by adding Javas `transient` keyword:
```
```java
public final class BlackjackHand {
private transient int total;
@ -397,7 +397,7 @@ If the class has a no-arguments constructor, Moshi will call that constructor an
it assigns will be used. For example, because this class has a no-arguments constructor the `total`
field is initialized to `-1`.
```
```java
public final class BlackjackHand {
private int total = -1;
...
@ -416,7 +416,7 @@ If the class doesnt have a no-arguments constructor, Moshi cant assign the
numbers, `false` for booleans, and `null` for references. In this example, the default value of
`total` is `0`!
```
```java
public final class BlackjackHand {
private int total = -1;
...
@ -431,7 +431,7 @@ This is surprising and is a potential source of bugs! For this reason consider d
no-arguments constructor in classes that you use with Moshi, using `@SuppressWarnings("unused")` to
prevent it from being inadvertently deleted later:
```
```java
public final class BlackjackHand {
private int total = -1;
...