1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.util;
17
18 import org.apache.commons.lang.NumberUtils;
19 import org.apache.commons.lang.StringUtils;
20 import org.kuali.rice.core.api.util.collect.CollectionUtils;
21
22 import java.util.Enumeration;
23
24
25
26
27
28
29
30
31 @Deprecated
32 public final class PagingBannerUtils {
33
34
35 private PagingBannerUtils() {
36 throw new UnsupportedOperationException("do not call");
37 }
38
39
40
41
42
43
44
45
46
47 public static int getNumbericalValueAfterPrefix(String paramPrefix, Enumeration<String> parameterNames) {
48
49 for (String parameterName : CollectionUtils.toIterable(parameterNames)) {
50 if (parameterName.startsWith(paramPrefix)) {
51 parameterName = WebUtils.endsWithCoordinates(parameterName) ? parameterName : parameterName + ".x";
52 String numberStr = StringUtils.substringBetween(parameterName, paramPrefix, ".");
53 if (NumberUtils.isDigits(numberStr)) {
54 return Integer.parseInt(numberStr);
55 }
56 }
57 }
58
59 return -1;
60 }
61
62
63
64
65
66 public static String getStringValueAfterPrefix(String paramPrefix, Enumeration<String> parameterNames) {
67 for (String parameterName : CollectionUtils.toIterable(parameterNames)) {
68 if (parameterName.startsWith(paramPrefix)) {
69 parameterName = WebUtils.endsWithCoordinates(parameterName) ? parameterName : parameterName + ".x";
70 return StringUtils.substringBetween(parameterName, paramPrefix, ".");
71 }
72 }
73
74 return "";
75 }
76 }