|
@@ -1,8 +1,8 @@ |
1 |
1 |
|
package com.temp.client.foundation.pavment; |
2 |
2 |
|
|
3 |
|
- |
import java.util.List; |
|
3 |
+ |
import com.google.gwt.place.shared.*; |
4 |
4 |
|
|
5 |
|
- |
import com.google.gwt.place.shared.Place; |
|
5 |
+ |
import java.util.*; |
6 |
6 |
|
|
7 |
7 |
|
/** |
8 |
8 |
|
* Token encoding and packing support for the Right part of the GWT History URL |
|
@@ -12,8 +12,8 @@ |
12 |
12 |
|
*/ |
13 |
13 |
|
public abstract class AbstractPlaceTokenizer<T extends Place> extends IdTokenizer<T> { |
14 |
14 |
|
|
15 |
|
- |
protected AbstractPlaceTokenizer(Object pPlaceId) { |
16 |
|
- |
super(pPlaceId); |
|
15 |
+ |
protected AbstractPlaceTokenizer( Object pPlaceId ) { |
|
16 |
+ |
super( pPlaceId ); |
17 |
17 |
|
} |
18 |
18 |
|
|
19 |
19 |
|
/** |
|
@@ -21,8 +21,8 @@ |
21 |
21 |
|
* |
22 |
22 |
|
* @return "" if null passed OR no strings, individual nulls treated as "" |
23 |
23 |
|
*/ |
24 |
|
- |
protected String encode(String... strings) { |
25 |
|
- |
return encodePacked(PlaceTokenPackaging.pack(strings)); |
|
24 |
+ |
protected String encode( String... strings ) { |
|
25 |
+ |
return encodePacked( PlaceTokenPackaging.pack( strings ) ); |
26 |
26 |
|
} |
27 |
27 |
|
|
28 |
28 |
|
/** |
|
@@ -30,38 +30,38 @@ |
30 |
30 |
|
* |
31 |
31 |
|
* @return "" if null passed OR no strings, individual nulls treated as "" |
32 |
32 |
|
*/ |
33 |
|
- |
protected String encode(List<String> strings) { |
34 |
|
- |
return encodePacked(PlaceTokenPackaging.pack(strings)); |
|
33 |
+ |
protected String encode( List<String> strings ) { |
|
34 |
+ |
return encodePacked( PlaceTokenPackaging.pack( strings ) ); |
35 |
35 |
|
} |
36 |
36 |
|
|
37 |
37 |
|
/** |
38 |
38 |
|
* Decode the passed String into multiple Strings. |
39 |
39 |
|
* |
40 |
40 |
|
* @return empty if "" or null passed OR the data can not be unpacked, |
41 |
|
- |
* otherwise the list will be at least one string and no entries |
42 |
|
- |
* will be null |
|
41 |
+ |
* otherwise the list will be at least one string and no entries |
|
42 |
+ |
* will be null |
43 |
43 |
|
*/ |
44 |
|
- |
protected List<String> decode(String encoded) { |
45 |
|
- |
return decode(encoded, 0); |
|
44 |
+ |
protected List<String> decode( String encoded ) { |
|
45 |
+ |
return decode( encoded, 0 ); |
46 |
46 |
|
} |
47 |
47 |
|
|
48 |
48 |
|
/** |
49 |
49 |
|
* Decode the passed String into multiple Strings. |
50 |
50 |
|
* |
51 |
51 |
|
* @return empty if minimumListSize < 1 AND (null or "" passed, OR the data |
52 |
|
- |
* can not be unpacked) otherwise the list will be at least |
53 |
|
- |
* minimumListSize (or 1 if minimumListSize < 1) and no entries will |
54 |
|
- |
* be null. |
|
52 |
+ |
* can not be unpacked) otherwise the list will be at least |
|
53 |
+ |
* minimumListSize (or 1 if minimumListSize < 1) and no entries will |
|
54 |
+ |
* be null. |
55 |
55 |
|
*/ |
56 |
|
- |
protected static List<String> decode(String encoded, int minimumListSize) { |
57 |
|
- |
return PlaceTokenPackaging.unpack(PlaceTokenCodecRegistry.decode(encoded), minimumListSize); |
|
56 |
+ |
protected static List<String> decode( String encoded, int minimumListSize ) { |
|
57 |
+ |
return PlaceTokenPackaging.unpack( PlaceTokenCodecRegistry.decode( encoded ), minimumListSize ); |
58 |
58 |
|
} |
59 |
59 |
|
|
60 |
|
- |
private String encodePacked(String packed) { |
61 |
|
- |
return PlaceTokenCodecRegistry.encode(packed); |
|
60 |
+ |
private String encodePacked( String packed ) { |
|
61 |
+ |
return PlaceTokenCodecRegistry.encode( packed ); |
62 |
62 |
|
} |
63 |
63 |
|
|
64 |
|
- |
protected String toString(Object object) { |
|
64 |
+ |
protected String toString( Object object ) { |
65 |
65 |
|
return (object != null) ? object.toString() : null; |
66 |
66 |
|
} |
67 |
67 |
|
} |