Thanks for the answer. For more clearly explain my problem, I enclosed some sections of the source code.
private String created_at;
private long id;
private String text;
private String source;
private boolean truncated;
private long in_reply_to_status_id;//nullable
private long in_reply_to_user_id;//nullable
private String in_reply_to_screen_name;//nullable
private User user;
private Coordinates coordinates;//nullable
private Place place;//nullable
private long quoted_status_id;
private boolean is_quote_status;
private TweetStatus quoted_status;
private TweetStatus retweeted_status;
private int quote_count;//nullable
private int reply_count;
private int retweet_count;
private int favorite_count;//nullable
private Entities entities;
private ExtendedEntities extended_entities;
private boolean favorited;//nullable
private boolean retweeted;
private boolean possibly_sensitive;//nullable
private String filter_level;
private String lang;//nullable
private List<MatchingRulesEntity> matching_rules;
private long current_user_retweet;//nullable
private Map<String, Boolean> scopes;//nullable
private boolean withheld_copyright;//nullable
private List<String> withheld_in_countries;//nullable
private String withheld_scope;//nullable
//>>>>> User Class:
private long id;
private String name;
private String screen_name;
private String location;//nullable
private String url;//nullable
private String description;//nullable
//TODO: protected is a java keyboard so we need a solution for get data from text string
private boolean isProtected;
private boolean verified;
private int followers_count;
private int friends_count;
private int listed_count;
private int favourites_count;
private int statuses_count;
private String created_at;
private String profile_banner_url;
private String profile_image_url_https;
private boolean default_profile;
private List<String> withheld_in_countries;
private String withheld_scope;
//No longer supported (deprecated) attributes
private List<URLEntity> descriptionURLEntities;
private boolean geo_enabled;
private String lang;
private boolean contributors_enabled;
private String profile_background_color;
private String profile_background_image_url;
private String profile_background_image_url_https;
private boolean profile_background_tile;
private String profile_image_url;
private String profile_link_color;
private String profile_sidebar_border_color;
private String profile_sidebar_fill_color;
private String profile_text_color;
private boolean profile_use_background_image;
private int utc_offset;
private String time_zone;
private boolean is_translator;
private boolean follow_request_sent;
private boolean showAllInlineMedia;
//>>> Place Class:
private String name;
private String country_code;
private String id;
private String country;
private String place_type;
private String url;
private String full_name;
private BoundingBoxCoordinate bounding_box;
=========================== There are more classes in the project.
and my Singleton Kryo class:
kryo = new Kryo();
kryo.register(LinkedHashMap.class);
kryo.register(ArrayList.class);
kryo.register(HashMap.class);
kryo.register(double[].class);
kryo.register(com.google.gson.internal.LinkedTreeMap.class);
kryo.register(AdditionalMediaInfoEntity.class);
kryo.register(BoundingBoxCoordinate.class);
kryo.register(Coordinates.class);
kryo.register(Entities.class);
kryo.register(ExtendedEntities.class);
kryo.register(HashtagEntity.class);
kryo.register(MatchingRulesEntity.class);
kryo.register(MediaEntity.class);
kryo.register(MediaSizesEntity.class);
kryo.register(OptionEntity.class);
kryo.register(Place.class);
kryo.register(PollEntity.class);
kryo.register(SizeEntity.class);
kryo.register(SymbolEntity.class);
kryo.register(TweetStatus.class);
kryo.register(URLEntity.class);
kryo.register(User.class);
kryo.register(UserMentionEntity.class);
kryo.register(VariantEntity.class);
kryo.register(VideoEntity.class);
kryo.register(AdditionalMediaInfoEntityFBS.class);
kryo.register(BoundingBoxCoordinateFBS.class);
kryo.register(CoordinatesFBS.class);
kryo.register(EntitiesFBS.class);
kryo.register(ExtendedEntitiesFBS.class);
kryo.register(HashtagEntityFBS.class);
kryo.register(MatchingRulesEntityFBS.class);
kryo.register(MediaEntityFBS.class);
kryo.register(MediaSizesEntityFBS.class);
kryo.register(OptionEntityFBS.class);
kryo.register(PlaceFBS.class);
kryo.register(PollEntityFBS.class);
kryo.register(SizeEntityFBS.class);
kryo.register(SymbolEntityFBS.class);
kryo.register(TweetStatusFBS.class);
kryo.register(URLEntityFBS.class);
kryo.register(UserFBS.class);
kryo.register(UserMentionEntityFBS.class);
kryo.register(VariantEntityFBS.class);
kryo.register(VideoEntityFBS.class);
kryo.register(TweetStatusProtos.TweetStatusP.class);
//>>>> Kryo deserialization function:
public RootData kryoDeserialization(byte[] buf, Class<?> myclass, Kryo kryo) {
ByteArrayInputStream byteInputStream = new ByteArrayInputStream(buf);
Input input = new Input(byteInputStream);
return (RootData) kryo.readObject(input, myclass);
}
Let me know if you need more info.
Thanks,
Saeed |
|
|