mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
Add missing Javadocs to License, Media, and Utils classes (#1965)
* Add missing Javadocs to License, Media, and Utils classes
This commit is contained in:
parent
f521e8886d
commit
809c0c32d7
6 changed files with 43 additions and 2 deletions
|
|
@ -24,6 +24,11 @@ public class NotificationUtils {
|
|||
private static final String WIKIDATA_WIKI = "wikidatawiki";
|
||||
private static final String WIKIPEDIA_WIKI = "enwiki";
|
||||
|
||||
/**
|
||||
* Returns true if the wiki attribute corresponds to commonswiki
|
||||
* @param document
|
||||
* @return boolean representing whether the wiki attribute corresponds to commonswiki
|
||||
*/
|
||||
public static boolean isCommonsNotification(Node document) {
|
||||
if (document == null || !document.hasAttributes()) {
|
||||
return false;
|
||||
|
|
@ -35,7 +40,7 @@ public class NotificationUtils {
|
|||
/**
|
||||
* Returns true if the wiki attribute corresponds to wikidatawiki
|
||||
* @param document
|
||||
* @return
|
||||
* @return boolean representing whether the wiki attribute corresponds to wikidatawiki
|
||||
*/
|
||||
public static boolean isWikidataNotification(Node document) {
|
||||
if (document == null || !document.hasAttributes()) {
|
||||
|
|
@ -58,6 +63,11 @@ public class NotificationUtils {
|
|||
return WIKIPEDIA_WIKI.equals(element.getAttribute("wiki"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns document notification type
|
||||
* @param document
|
||||
* @return the document's NotificationType
|
||||
*/
|
||||
public static NotificationType getNotificationType(Node document) {
|
||||
Element element = (Element) document;
|
||||
String type = element.getAttribute("type");
|
||||
|
|
@ -99,7 +109,7 @@ public class NotificationUtils {
|
|||
* Currently the app is interested in showing notifications just from the following three wikis: commons, wikidata, wikipedia
|
||||
* This function returns true only if the notification belongs to any of the above wikis and is of a known notification type
|
||||
* @param node
|
||||
* @return
|
||||
* @return whether a notification is from one of Commons, Wikidata or Wikipedia
|
||||
*/
|
||||
private static boolean isUsefulNotification(Node node) {
|
||||
return (isCommonsNotification(node)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue