Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. @RequestMapping(value="/getContact", method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE)
  2. public Contact getContact () {
  3.  
  4. Contact s1 = new Contact();
  5. s1.setContactName("Avijit");
  6. s1.setContactType("Primary");
  7. return s1;
  8. }
  9.  
  10. public class Contact {
  11.  
  12. private String contactName;
  13. private String contactType;
  14.  
  15. public String getContactName() {
  16. return contactName;
  17. }
  18. public void setContactName(String contactNm) {
  19. this.contactName = contactNm;
  20. }
  21. public String getContactType() {
  22. return contactType;
  23. }
  24. public void setContactType(String contactType) {
  25. this.contactType = contactType;
  26. }
  27.  
  28. {
  29. "contactName": "Avijit",
  30. "contactType": "Primary"
  31. }
  32.  
  33. public class Contact {
  34. @JsonProperty(value="contactName")
  35. private String contactName;
  36. private String contactType;
  37.  
  38. public String getContactName() {
  39. return contactName;
  40. }
  41. public void setContactName(String contactNm) {
  42. this.contactName = contactNm;
  43. }
  44. public String getContactType() {
  45. return contactType;
  46. }
  47. public void setContactType(String contactType) {
  48. this.contactType = contactType;
  49. }
  50.  
  51. }
  52.  
  53. {
  54. "contactType": "Primary",
  55. "contactName": "Avijit"
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement