Add missing Javadocs to License, Media, and Utils classes (#1965)

* Add missing Javadocs to License, Media, and Utils classes
This commit is contained in:
Reid 2018-12-20 16:12:18 -05:00 committed by Adam Jones
parent f521e8886d
commit 809c0c32d7
6 changed files with 43 additions and 2 deletions

View file

@ -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)