package net.dev123.mblog.tencent; import net.dev123.commons.ServiceProvider; import net.dev123.exception.ExceptionCode; import net.dev123.exception.LibException; import net.dev123.mblog.entity.Comment; import net.dev123.mblog.entity.Status; public class TencentCommentAdaptor { public static Comment createCommentFromStatus(Status status) throws LibException { if (null == status) { throw new LibException(ExceptionCode.PARAMETER_NULL); } Comment comment = new Comment(); comment.setId(status.getId()); comment.setCreatedAt(status.getCreatedAt()); comment.setFavorited(status.isFavorited()); comment.setInReplyToStatus(status.getRetweetedStatus()); comment.setServiceProvider(status.getServiceProvider()); comment.setSource(status.getSource()); comment.setText(status.getText()); comment.setTruncated(status.isTruncated()); comment.setUser(status.getUser()); comment.setServiceProvider(ServiceProvider.Tencent); return comment; } }