forked from hpehl/piriti
-
Notifications
You must be signed in to change notification settings - Fork 0
Order
Harald Pehl edited this page Oct 29, 2012
·
1 revision
Piriti processes all annotated fields in random order. If you depend on a specific order, you can use the order
attribute. Suppose you have the following model:
public class User
{
@Json(order = 0) String username;
@Json(order = 2) String firstname;
@Json(order = 1) String surname;
@Json int age;
@Json boolean valid;
}
When reading / writing JSON data the fields are proceesed in this order
- username
- surname
- firstname
- age or valid
- age or valid (order is not specified)