001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/search/tags/sakai_2-4-1/search-model/src/java/org/sakaiproject/search/model/impl/SearchBuilderItemImpl.java $
003: * $Id: SearchBuilderItemImpl.java 12345 2006-07-16 09:51:56Z ian@caret.cam.ac.uk $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.search.model.impl;
021:
022: import java.util.Date;
023:
024: import org.sakaiproject.search.model.SearchBuilderItem;
025:
026: /**
027: * @author ieb
028: */
029: public class SearchBuilderItemImpl implements SearchBuilderItem {
030: private String id = null;
031:
032: private String name = null;
033:
034: private Integer searchaction = SearchBuilderItem.ACTION_UNKNOWN;
035:
036: private Integer searchstate = SearchBuilderItem.STATE_UNKNOWN;
037:
038: private Date version = null;
039:
040: private String context = null;
041:
042: /**
043: * @return Returns the action.
044: */
045: public Integer getSearchaction() {
046: return searchaction;
047: }
048:
049: /**
050: * @param action
051: * The action to set.
052: */
053: public void setSearchaction(Integer searchaction) {
054: this .searchaction = searchaction;
055: }
056:
057: /**
058: * @return Returns the id.
059: */
060: public String getId() {
061: return id;
062: }
063:
064: /**
065: * @param id
066: * The id to set.
067: */
068: public void setId(String id) {
069: this .id = id;
070: }
071:
072: /**
073: * @return Returns the version.
074: */
075: public Date getVersion() {
076: return version;
077: }
078:
079: /**
080: * @param version
081: * The version to set.
082: */
083: public void setVersion(Date version) {
084: this .version = version;
085: }
086:
087: /**
088: * @return Returns the state.
089: */
090: public Integer getSearchstate() {
091: return searchstate;
092: }
093:
094: /**
095: * @param state
096: * The state to set.
097: */
098: public void setSearchstate(Integer searchstate) {
099: this .searchstate = searchstate;
100: }
101:
102: /**
103: * @return Returns the name.
104: */
105: public String getName() {
106: return name;
107: }
108:
109: /**
110: * @param name
111: * The name to set.
112: */
113: public void setName(String name) {
114: this .name = name;
115: }
116:
117: public String getContext() {
118: return context;
119: }
120:
121: public void setContext(String context) {
122: this .context = context;
123:
124: }
125:
126: public String toString() {
127:
128: String action = "invalid";
129: if (searchaction != null
130: && searchaction.intValue() >= 0
131: && searchaction.intValue() < SearchBuilderItem.actions.length) {
132: action = SearchBuilderItem.actions[searchaction.intValue()];
133: }
134: String state = "invalid";
135: if (searchstate != null
136: && searchstate.intValue() >= 0
137: && searchstate.intValue() < SearchBuilderItem.states.length) {
138: state = SearchBuilderItem.states[searchstate.intValue()];
139: }
140:
141: return "Action:" + action + " State:" + state + " Resource:"
142: + name;
143: }
144:
145: }
|