Zizalik

CurrencyJSON

May 16th, 2018
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package kontrolltoo;
  7.  
  8. import java.text.SimpleDateFormat;
  9. import org.codehaus.jackson.annotate.JsonCreator;
  10. import org.codehaus.jackson.annotate.JsonIgnoreProperties;
  11. import org.codehaus.jackson.annotate.JsonProperty;
  12.  
  13.  
  14.  
  15. @JsonIgnoreProperties(ignoreUnknown=true)
  16. public class CurrencyJSON {
  17. @JsonProperty("name")
  18. private String name;
  19.  
  20. @JsonProperty("fullname")
  21. private String fullname;
  22.  
  23. @JsonProperty("country")
  24. private String country;
  25.  
  26. @JsonProperty("symbol")
  27. private String symbol;
  28.  
  29.  
  30. public CurrencyJSON(){}
  31.  
  32. @JsonCreator
  33. public CurrencyJSON(String name, String fullname, String country, String symbol)
  34. {
  35. this.name=name;
  36. this.fullname=fullname;
  37. this.country=country;
  38. this.symbol=symbol;
  39. }
  40.  
  41.  
  42. // omadused
  43. public String getName() {
  44. return name;
  45. }
  46.  
  47. public void setName(String name) {
  48. this.name = name;
  49. }
  50.  
  51. public String getCountry() {
  52. return country;
  53. }
  54.  
  55. public void setCountry(String country) {
  56. this.country = country;
  57. }
  58.  
  59. public String getFullname() {
  60. return fullname;
  61. }
  62.  
  63. public void setFullname(String fullname) {
  64. this.fullname = fullname;
  65. }
  66.  
  67. public String getSymbol() {
  68. return symbol;
  69. }
  70.  
  71. public void setSymbol(String symbol) {
  72. this.symbol = symbol;
  73. }
  74.  
  75. @Override
  76. public String toString(){
  77.  
  78. return String.format("\n name: %s \n fullname: %s \n country: %s \n symbol: %s \n"
  79. ,name, fullname,country, symbol);
  80. }
  81. }
Add Comment
Please, Sign In to add comment