|
@ -148,48 +148,6 @@ public class SearchItem { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
|
|
private static User getUser(@NonNull final RecentSearch recentSearch) { |
|
|
|
|
|
return new User( |
|
|
|
|
|
Long.parseLong(recentSearch.getIgId()), |
|
|
|
|
|
recentSearch.getUsername(), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
false, |
|
|
|
|
|
recentSearch.getPicUrl(), |
|
|
|
|
|
null, null, false, false, false, false, false, |
|
|
|
|
|
null, null, 0, 0, 0, 0, null, null, |
|
|
|
|
|
0, null, null, null, null, null, null |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
|
|
private static Hashtag getHashtag(@NonNull final RecentSearch recentSearch) { |
|
|
|
|
|
return new Hashtag( |
|
|
|
|
|
recentSearch.getIgId(), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
0, |
|
|
|
|
|
null, |
|
|
|
|
|
null |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
|
|
private static Place getPlace(@NonNull final RecentSearch recentSearch) { |
|
|
|
|
|
final Location location = new Location( |
|
|
|
|
|
Long.parseLong(recentSearch.getIgId()), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
null, null, 0, 0 |
|
|
|
|
|
); |
|
|
|
|
|
return new Place( |
|
|
|
|
|
location, |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
null, |
|
|
|
|
|
null, |
|
|
|
|
|
null |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static List<SearchItem> fromFavorite(final List<Favorite> favorites) { |
|
|
public static List<SearchItem> fromFavorite(final List<Favorite> favorites) { |
|
|
if (favorites == null) { |
|
|
if (favorites == null) { |
|
|
return Collections.emptyList(); |
|
|
return Collections.emptyList(); |
|
@ -225,6 +183,20 @@ public class SearchItem { |
|
|
return searchItem; |
|
|
return searchItem; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
|
|
private static User getUser(@NonNull final RecentSearch recentSearch) { |
|
|
|
|
|
return new User( |
|
|
|
|
|
Long.parseLong(recentSearch.getIgId()), |
|
|
|
|
|
recentSearch.getUsername(), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
false, |
|
|
|
|
|
recentSearch.getPicUrl(), |
|
|
|
|
|
null, null, false, false, false, false, false, |
|
|
|
|
|
null, null, 0, 0, 0, 0, null, null, |
|
|
|
|
|
0, null, null, null, null, null, null |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@NonNull |
|
|
@NonNull |
|
|
private static User getUser(@NonNull final Favorite favorite) { |
|
|
private static User getUser(@NonNull final Favorite favorite) { |
|
|
return new User( |
|
|
return new User( |
|
@ -239,6 +211,17 @@ public class SearchItem { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
|
|
private static Hashtag getHashtag(@NonNull final RecentSearch recentSearch) { |
|
|
|
|
|
return new Hashtag( |
|
|
|
|
|
recentSearch.getIgId(), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
0, |
|
|
|
|
|
null, |
|
|
|
|
|
null |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@NonNull |
|
|
@NonNull |
|
|
private static Hashtag getHashtag(@NonNull final Favorite favorite) { |
|
|
private static Hashtag getHashtag(@NonNull final Favorite favorite) { |
|
|
return new Hashtag( |
|
|
return new Hashtag( |
|
@ -250,6 +233,23 @@ public class SearchItem { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
|
|
private static Place getPlace(@NonNull final RecentSearch recentSearch) { |
|
|
|
|
|
final Location location = new Location( |
|
|
|
|
|
Long.parseLong(recentSearch.getIgId()), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
null, null, 0, 0 |
|
|
|
|
|
); |
|
|
|
|
|
return new Place( |
|
|
|
|
|
location, |
|
|
|
|
|
recentSearch.getName(), |
|
|
|
|
|
null, |
|
|
|
|
|
null, |
|
|
|
|
|
null |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Nullable |
|
|
@Nullable |
|
|
private static Place getPlace(@NonNull final Favorite favorite) { |
|
|
private static Place getPlace(@NonNull final Favorite favorite) { |
|
|
try { |
|
|
try { |
|
|