001: /**
002: * $Id: TwoParamBean.java,v 1.3 2005/10/04 09:13:58 fa151985 Exp $
003: * Copyright 2005 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.admin.console.sra.gateway;
014:
015: import java.io.Serializable;
016:
017: public class TwoParamBean implements Serializable {
018:
019: private String firstParam;
020: private String secondParam;
021:
022: private String _id = null;
023:
024: boolean _selected;
025:
026: private static final String EMPTY_URL = "empty";
027:
028: private static final String SEPARATOR = "%:%";
029:
030: private static int INT = 0;
031:
032: public TwoParamBean() {
033: _id = EMPTY_URL + SEPARATOR + INT++;
034: }
035:
036: /**
037: * @param firstParam
038: * @param secondParam
039: */
040: public TwoParamBean(String firstParam, String secondParam) {
041: this .firstParam = firstParam;
042: this .secondParam = secondParam;
043: }
044:
045: /**
046: * @return Returns the proxyserver.
047: */
048: public String getFirstParam() {
049: return firstParam;
050: }
051:
052: /**
053: * @param firstParam The _firstParam to set.
054: */
055: public void setFirstParam(String firstParam) {
056: this .firstParam = firstParam;
057: }
058:
059: public void setSecondParam(String secondParam) {
060: this .secondParam = secondParam;
061: }
062:
063: /**
064: * @return Returns the _secondParam.
065: */
066: public String getSecondParam() {
067: return secondParam;
068: }
069:
070: public String getId() {
071: return _id;
072: }
073:
074: public void setId(String id) {
075: _id = id;
076: }
077:
078: public boolean isEmpty() {
079: return _id.startsWith(EMPTY_URL);
080: }
081:
082: public String toString() {
083: StringBuffer sb = new StringBuffer();
084: sb.append(firstParam).append(SEPARATOR).append(secondParam);
085: return sb.toString();
086: }
087:
088: public boolean isInvalid() {
089: return firstParam.trim().equals("")
090: || secondParam.trim().equals("");
091: }
092:
093: public boolean getSelected() {
094: return _selected;
095: }
096:
097: /**
098: * @param selected
099: * The selected to set.
100: */
101: public void setSelected(boolean selected) {
102: _selected = selected;
103: }
104:
105: }
|