001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: */
019:
020: package de.schlund.pfixcore.workflow;
021:
022: /**
023: * Describe class <code>PageRequest</code> here.
024: *
025: * @author <a href="mailto:jtl@schlund.de">Jens Lautenbacher</a>
026: */
027: public class PageRequest {
028: private PageRequestStatus status = PageRequestStatus.UNDEF;
029: private String preqname;
030: private String rootname;
031:
032: /**
033: * Describe <code>getName</code> method here.
034: *
035: * @return a <code>String</code> value
036: */
037: public String getName() {
038: return preqname;
039: }
040:
041: /**
042: * Describe <code>toString</code> method here.
043: *
044: * @return a <code>String</code> value
045: */
046: @Override
047: public String toString() {
048: return getName();
049: }
050:
051: /**
052: * Describe <code>setStatus</code> method here.
053: *
054: * @param status a <code>PageRequestStatus</code> value
055: */
056: public void setStatus(PageRequestStatus status) {
057: this .status = status;
058: }
059:
060: /**
061: * Describe <code>getStatus</code> method here.
062: *
063: * @return a <code>PageRequestStatus</code> value
064: */
065: public PageRequestStatus getStatus() {
066: return status;
067: }
068:
069: /**
070: * Describe <code>equals</code> method here.
071: *
072: * @param arg an <code>Object</code> value
073: * @return a <code>boolean</code> value
074: */
075: @Override
076: public boolean equals(Object arg) {
077: if ((arg != null) && (arg instanceof PageRequest)) {
078: return preqname.equals(((PageRequest) arg).getName());
079: } else {
080: return false;
081: }
082: }
083:
084: /**
085: * Describe <code>hashCode</code> method here.
086: *
087: * @return an <code>int</code> value
088: */
089: @Override
090: public int hashCode() {
091: if (preqname == null) {
092: return 0;
093: } else {
094: return preqname.hashCode();
095: }
096: }
097:
098: /**
099: * Describe <code>isEmpty</code> method here.
100: *
101: * @return a <code>boolean</code> value
102: */
103: // public boolean isEmpty() {
104: // if (preqname == null) {
105: // return true;
106: // } else {
107: // return false;
108: // }
109: // }
110: /**
111: * Creates a new <code>PageRequest</code> instance.
112: *
113: * @param name a <code>String</code> value
114: */
115: public PageRequest(String name) {
116: preqname = name;
117: if (name != null && name.indexOf("::") > 0) {
118: rootname = name.substring(0, name.indexOf("::"));
119: } else {
120: rootname = name;
121: }
122: // CAT.debug("=== PR: " + preqname + " (" + rootname + ") ===");
123: }
124:
125: public String getRootName() {
126: return rootname;
127: }
128:
129: }
|