diff options
author | 2016-07-12 17:39:33 +0300 | |
---|---|---|
committer | 2016-07-12 17:39:33 +0300 | |
commit | bdbf65e0a50758bfcc88e1cc9c501eeed4e7e45d (patch) | |
tree | 756e8b29b2442c82ae50a3548c772f4a65b6d1ef /juick-core/src/main/java/com/juick/Tag.java | |
parent | 291da35b1bf7dcd66bf621160f907872fd0f7825 (diff) |
jackson-databind WIP
Diffstat (limited to 'juick-core/src/main/java/com/juick/Tag.java')
-rw-r--r-- | juick-core/src/main/java/com/juick/Tag.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/juick-core/src/main/java/com/juick/Tag.java b/juick-core/src/main/java/com/juick/Tag.java index 119aad99..8b790377 100644 --- a/juick-core/src/main/java/com/juick/Tag.java +++ b/juick-core/src/main/java/com/juick/Tag.java @@ -17,6 +17,9 @@ */ package com.juick; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonValue; + import java.util.Objects; /** @@ -25,11 +28,15 @@ import java.util.Objects; */ public class Tag { - public String Name = null; + private String Name; public int TID = 0; public int SynonymID = 0; public int UsageCnt = 0; + public Tag(String name) { + this.Name = name; + } + @Override public boolean equals(Object o) { boolean equal = false; @@ -38,4 +45,13 @@ public class Tag { } return equal; } + @JsonIgnore + public String getName() { + return Name; + } + @Override + @JsonValue + public String toString() { + return Name; + } } |