@Override public String getToken(Place place) { if (place == null) { return null; } String parentToken = null; if (place instanceof ViewPlace && ((ViewPlace) place).getParent() != null) { parentToken = this.getToken(((ViewPlace) place).getParent()); } String prefix = MvpUtils.getPlacePrefix(place); String token = null; ActivityFactory activityFactory = this.activityFactories.get(prefix); if (activityFactory instanceof PlaceTokenizer) { token = ((PlaceTokenizer) activityFactory).getToken(place); } String result = ""; if (parentToken != null) { result = parentToken + MvpController.PLACE_SEPARATOR; if (prefix.startsWith("!")) { prefix = prefix.substring(1); } } if (token != null) { result += prefix.length() == 0 ? token : prefix + MvpController.PLACE_TOKEN_SEPARATOR + token; } else { result += prefix; } return result; }
@Override public String getToken(Place place) { if (place == null) { return null; } String parentToken = null; if (place instanceof ViewPlace && ((ViewPlace) place).getParent() != null) { parentToken = this.getToken(((ViewPlace) place).getParent()); } String prefix = MvpUtils.getPlacePrefix(place); String token = null; ActivityFactory activityFactory = this.activityFactories.get(prefix); if (activityFactory instanceof PlaceTokenizer) { token = ((PlaceTokenizer) activityFactory).getToken(place); } String result = ""; if (parentToken != null) { result = parentToken + MvpController.PLACE_SEPARATOR; if (prefix.startsWith("!")) { prefix = prefix.substring(1); } } if (token != null) { result += prefix.length() == 0 ? token : prefix + MvpController.PLACE_TOKEN_SEPARATOR + token; } else { result += prefix; } return result; }