From: Svjatoslav Agejenko Date: Sat, 25 Oct 2014 21:02:48 +0000 (+0300) Subject: further generics simplifications X-Git-Tag: svjatoslavcommons-1.8~92 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=2212fc002e4e8602550372a3115c2c1469be0729;p=svjatoslav_commons.git further generics simplifications --- diff --git a/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java b/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java index d95ba4f..57a7649 100755 --- a/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java +++ b/src/main/java/eu/svjatoslav/commons/network/navigation/NavigationItem.java @@ -17,30 +17,30 @@ import java.util.Map; import eu.svjatoslav.commons.network.Locale; import eu.svjatoslav.commons.string.WildCardMatcher; -public class NavigationItem { +public class NavigationItem { private String matchingPattern; private final Map localeToTitle = new HashMap(); - private final ArrayList subElements = new ArrayList(); - private final NI parent; - private final Navigation navigation; + private final ArrayList subElements = new ArrayList(); + private final NavigationItem parent; + private final Navigation navigation; private final String linkUrl; /** * CSS prefix is inherited to child menu items. */ private String cssPrefix; - public NavigationItem(final Navigation navigation) { + public NavigationItem(final Navigation navigation) { this.navigation = navigation; parent = null; matchingPattern = null; linkUrl = null; } - public NavigationItem(final NI parent, final String linkUrl, + public NavigationItem(final NavigationItem parent, final String linkUrl, final String... titles) { - this.navigation = parent.getNavigation(); + navigation = parent.getNavigation(); this.parent = parent; this.linkUrl = linkUrl; matchingPattern = linkUrl; @@ -50,7 +50,7 @@ public class NavigationItem { parent.addNavigationItem(this); } - public void addNavigationItem(final NI navigationItem) { + public void addNavigationItem(final NavigationItem navigationItem) { subElements.add(navigationItem); } @@ -68,12 +68,12 @@ public class NavigationItem { return linkUrl; } - NI getMatchingNavigationItem(final String requestPath) { + NavigationItem getMatchingNavigationItem(final String requestPath) { if (matchesUrl(requestPath)) - return (NI) this; + return this; - for (final NI childNavigationItem : subElements) { - final NI match = (NI) childNavigationItem + for (final NavigationItem childNavigationItem : subElements) { + final NavigationItem match = childNavigationItem .getMatchingNavigationItem(requestPath); if (match != null) @@ -82,11 +82,11 @@ public class NavigationItem { return null; } - public Navigation getNavigation() { + public Navigation getNavigation() { return navigation; } - public List getSubElements() { + public List getSubElements() { return subElements; }