PageTitle implements Parcelable { public boolean isFilePage() { return namespace().file(); } PageTitle(@Nullable final String namespace, @NonNull String text, @Nullable String fragment, @Nullable String thumbUrl, @NonNull WikiSite wiki);  PageTitle(@Nullable String text, @NonNull WikiSite wiki, @Nullable String thumbUrl, @Nullable String description, @Nullable PageProperties properties);  PageTitle(@Nullable String text, @NonNull WikiSite wiki, @Nullable String thumbUrl, @Nullable String description);  PageTitle(@Nullable String namespace, @NonNull String text, @NonNull WikiSite wiki);  PageTitle(@Nullable String text, @NonNull WikiSite wiki, @Nullable String thumbUrl);  PageTitle(@Nullable String text, @NonNull WikiSite wiki); private  PageTitle(@Nullable String text, @NonNull WikiSite wiki, @Nullable String thumbUrl,
                      @Nullable PageProperties properties); private  PageTitle(Parcel in); static PageTitle withSeparateFragment(@NonNull String prefixedText,
                                                 @Nullable String fragment, @NonNull WikiSite wiki); @Nullable String getNamespace(); @NonNull Namespace namespace(); @NonNull WikiSite getWikiSite(); @NonNull String getText(); @Nullable String getFragment(); @Nullable String getThumbUrl(); void setThumbUrl(@Nullable String thumbUrl); @Nullable String getDescription(); void setDescription(@Nullable String description); @NonNull String getConvertedText(); void setConvertedText(@Nullable String convertedText); @NonNull String getDisplayText(); @NonNull String getDisplayTextWithoutNamespace(); boolean hasProperties(); @Nullable PageProperties getProperties(); boolean isMainPage(); boolean isDisambiguationPage(); String getCanonicalUri(); String getMobileUri(); String getUriForAction(String action); String getPrefixedText(); boolean isFilePage(); boolean isSpecial(); boolean isTalkPage(); @Override void writeToParcel(Parcel parcel, int flags); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int describeContents(); static final Parcelable.Creator<PageTitle> CREATOR; }
@Test public void testFile() { assertThat(new PageTitle("File:SomethingSomething", WikiSite.forLanguageCode("en")).isFilePage(), is(true)); assertThat(new PageTitle("ファイル:Version", WikiSite.forLanguageCode("ja")).isFilePage(), is(true)); assertThat(new PageTitle("File:SomethingSomething", WikiSite.forLanguageCode("ja")).isFilePage(), is(true)); assertThat(new PageTitle("ファイル:Version", WikiSite.forLanguageCode("en")).isFilePage(), is(false)); }