01: package com.sun.portal.admin.console.sra.proxylet;
02:
03: import java.util.StringTokenizer;
04:
05: /**
06: * author: Noble Paul
07: * Date: Jul 26, 2005, 2:52:03 PM
08: */
09: public class AppUrl {
10: boolean selected;
11: String appName = "", url = "";
12:
13: public AppUrl() {
14: }
15:
16: public AppUrl(String appName, boolean selected, String url) {
17: this .appName = appName;
18: this .selected = selected;
19: this .url = url;
20: }
21:
22: public String getAppName() {
23: return appName;
24: }
25:
26: public void setAppName(String appName) {
27: this .appName = appName;
28: }
29:
30: public boolean getSelected() {
31: return selected;
32: }
33:
34: public void setSelected(boolean selected) {
35: this .selected = selected;
36: }
37:
38: public String getUrl() {
39: return url;
40: }
41:
42: public void setUrl(String url) {
43: this .url = url;
44: }
45:
46: public String toString() {
47: return super .toString();
48: }
49:
50: public static AppUrl decode(String s) {
51: StringTokenizer st = new StringTokenizer(s, "=", false);
52: AppUrl appUrl = new AppUrl();
53: if (st.hasMoreTokens())
54: appUrl.setAppName(st.nextToken());
55: if (st.hasMoreTokens())
56: appUrl.setUrl(st.nextToken());
57:
58: return appUrl;
59:
60: }
61:
62: public static String encode(AppUrl au) {
63: return au.appName + "=" + au.url;
64: }
65:
66: public boolean isEmpty() {
67: return "".equals(appName) && "".equals(url);
68: }
69: }
|