PageRenderTime 56ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/wqdsoft/im/Entity/ChatImg.java

https://gitlab.com/Er_Hei/PlayCar
Java | 124 lines | 70 code | 51 blank | 3 comment | 0 complexity | 686055796715a6b7e450eea16ec0e0ed MD5 | raw file
  1. package com.wqdsoft.im.Entity;
  2. import java.io.Serializable;
  3. import com.alibaba.fastjson.JSONObject;
  4. public class ChatImg implements Serializable{
  5. /**
  6. *
  7. */
  8. private static final long serialVersionUID = 1L;
  9. private String small;
  10. private String origin;
  11. private String imgWidth;
  12. private String imgHeight;
  13. public ChatImg(String small, String origin, String imgWidth,
  14. String imgHeight) {
  15. super();
  16. this.small = small;
  17. this.origin = origin;
  18. this.imgWidth = imgWidth;
  19. this.imgHeight = imgHeight;
  20. }
  21. public ChatImg() {
  22. super();
  23. }
  24. public ChatImg(String small) {
  25. super();
  26. this.small = small;
  27. }
  28. public static ChatImg getInfo(String json) {
  29. try {
  30. return JSONObject.toJavaObject(JSONObject.parseObject(json),
  31. ChatImg.class);
  32. } catch (Exception e) {
  33. e.printStackTrace();
  34. return null;
  35. }
  36. }
  37. public static String getInfo(ChatImg info) {
  38. String json = JSONObject.toJSON(info).toString();
  39. return json;
  40. }
  41. public String getSmall() {
  42. return small;
  43. }
  44. public void setSmall(String small) {
  45. this.small = small;
  46. }
  47. public String getOrigin() {
  48. return origin;
  49. }
  50. public void setOrigin(String origin) {
  51. this.origin = origin;
  52. }
  53. public String getImgWidth() {
  54. return imgWidth;
  55. }
  56. public void setImgWidth(String imgWidth) {
  57. this.imgWidth = imgWidth;
  58. }
  59. public String getImgHeight() {
  60. return imgHeight;
  61. }
  62. public void setImgHeight(String imgHeight) {
  63. this.imgHeight = imgHeight;
  64. }
  65. public static long getSerialversionuid() {
  66. return serialVersionUID;
  67. }
  68. @Override
  69. public String toString() {
  70. return "ChatImg [small=" + small + ", origin=" + origin + ", imgHeight=" + imgHeight
  71. + ", imgWidth=" + imgWidth + "]";
  72. }
  73. }