Package com.jms.socialmedia.cache.codec
Class GsonCachingCodec
- java.lang.Object
-
- com.jms.socialmedia.cache.codec.GsonCachingCodec
-
- All Implemented Interfaces:
CachingCodec<String>
public class GsonCachingCodec extends Object implements CachingCodec<String>
-
-
Constructor Summary
Constructors Constructor Description GsonCachingCodec(com.google.gson.Gson gson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comment
decodeComment(String encodedComment)
Post
decodePost(String encodedPost)
User
decodeUser(String encodedUser)
String
encodeComment(Comment comment)
String
encodePost(Post post)
String
encodeUser(User user)
-
-
-
Method Detail
-
encodePost
public String encodePost(Post post)
- Specified by:
encodePost
in interfaceCachingCodec<String>
-
decodePost
public Post decodePost(String encodedPost)
- Specified by:
decodePost
in interfaceCachingCodec<String>
-
encodeComment
public String encodeComment(Comment comment)
- Specified by:
encodeComment
in interfaceCachingCodec<String>
-
decodeComment
public Comment decodeComment(String encodedComment)
- Specified by:
decodeComment
in interfaceCachingCodec<String>
-
encodeUser
public String encodeUser(User user)
- Specified by:
encodeUser
in interfaceCachingCodec<String>
-
decodeUser
public User decodeUser(String encodedUser)
- Specified by:
decodeUser
in interfaceCachingCodec<String>
-
-