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

Commit

Permalink
Merge branch 'master' of github.com:wikimedia/wikimedia-android-data-…
Browse files Browse the repository at this point in the history
…client
  • Loading branch information
dbrant committed Jun 17, 2019
2 parents e16f7e1 + 841f10d commit d7b854a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
17 changes: 17 additions & 0 deletions src/main/java/org/wikipedia/dataclient/mwapi/ImageDetails.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.wikipedia.dataclient.mwapi;

import androidx.annotation.NonNull;

public class ImageDetails {

@SuppressWarnings("unused") private String name;
@SuppressWarnings("unused") private String title;

@NonNull public String getName() {
return name;
}

@NonNull public String getTitle() {
return title;
}
}
6 changes: 0 additions & 6 deletions src/main/java/org/wikipedia/dataclient/mwapi/MwQueryPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ 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 @@ -101,11 +100,6 @@ public String descriptionSource() {
return descriptionSource;
}

@NonNull
public List<ImageInfo> allImages() {
return allImages == null ? Collections.emptyList() : allImages;
}

@Nullable public ImageInfo imageInfo() {
return imageInfo != null ? imageInfo.get(0) : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.wikipedia.settings.SiteInfo;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -36,6 +37,7 @@ public class MwQueryResult extends BaseModel implements PostProcessingTypeAdapte
@SerializedName("general") @Nullable private SiteInfo generalSiteInfo;
@Nullable private List<RecentChange> recentchanges;
@SerializedName("wikimediaeditortaskscounts") @Nullable private EditorTaskCounts editorTaskCounts;
@SerializedName("allimages") @Nullable private List<ImageDetails> allImages;

@Nullable public List<MwQueryPage> pages() {
return pages;
Expand All @@ -48,6 +50,11 @@ public class MwQueryResult extends BaseModel implements PostProcessingTypeAdapte
return null;
}

@NonNull
public List<ImageDetails> allImages() {
return allImages == null ? Collections.emptyList() : allImages;
}

@Nullable public UserInfo userInfo() {
return userInfo;
}
Expand Down

0 comments on commit d7b854a

Please sign in to comment.