Created
November 20, 2013 00:25
-
-
Save sdpatil/7555173 to your computer and use it in GitHub Desktop.
JSON Serializer sample Pojo
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
package com.spnotes.misc; | |
import com.spnotes.misc.com.spnotes.misc.CustomDateSerializer; | |
import org.codehaus.jackson.map.annotate.JsonSerialize; | |
import java.util.Date; | |
/** | |
* Created by gpzpati on 11/19/13. | |
*/ | |
public class Contact { | |
private String firstName; | |
private String lastName; | |
private Date dateOfBirth; | |
public String getFirstName() { | |
return firstName; | |
} | |
public void setFirstName(String firstName) { | |
this.firstName = firstName; | |
} | |
public String getLastName() { | |
return lastName; | |
} | |
public void setLastName(String lastName) { | |
this.lastName = lastName; | |
} | |
@JsonSerialize(using = CustomDateSerializer.class) | |
public Date getDateOfBirth() { | |
return dateOfBirth; | |
} | |
public void setDateOfBirth(Date dateOfBirth) { | |
this.dateOfBirth = dateOfBirth; | |
} | |
@Override | |
public String toString() { | |
return "Contact{" + | |
"firstName='" + firstName + '\'' + | |
", lastName='" + lastName + '\'' + | |
", dateOfBirth=" + dateOfBirth + | |
'}'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment