Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from maskaravivek/allImages
Browse files Browse the repository at this point in the history
Add allimages prop in MwQueryPage
  • Loading branch information
dbrant authored Jun 17, 2019
2 parents 7f1e030 + d6f23a2 commit 0b98917
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/wikipedia/dataclient/mwapi/MwQueryPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.wikipedia.model.BaseModel;
import org.wikipedia.page.Namespace;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

Expand All @@ -32,6 +33,7 @@ public class MwQueryPage extends BaseModel {
@SuppressWarnings("unused") @Nullable private Thumbnail thumbnail;
@SuppressWarnings("unused") @Nullable private String description;
@SuppressWarnings("unused") @SerializedName("descriptionsource") @Nullable private String descriptionSource;
@SuppressWarnings("unused") @SerializedName("allimages") @Nullable private List<ImageInfo> allImages;
@SuppressWarnings("unused") @SerializedName("imageinfo") @Nullable private List<ImageInfo> imageInfo;
@SuppressWarnings("unused") @SerializedName("videoinfo") @Nullable private List<VideoInfo> videoInfo;
@Nullable private String redirectFrom;
Expand Down Expand Up @@ -100,6 +102,11 @@ public String descriptionSource() {
return descriptionSource;
}

@NonNull
public List<ImageInfo> allImages() {
return allImages == null ? new ArrayList<>() : allImages;
}

@Nullable public ImageInfo imageInfo() {
return imageInfo != null ? imageInfo.get(0) : null;
}
Expand Down

0 comments on commit 0b98917

Please sign in to comment.