KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > conversation > impl > SimpleConversationId


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.springframework.webflow.conversation.impl;
17
18 import java.io.Serializable JavaDoc;
19
20 import org.springframework.webflow.conversation.ConversationId;
21 import org.springframework.webflow.conversation.ConversationManager;
22
23 /**
24  * An id that uniquely identifies a conversation managed by a
25  * {@link ConversationManager}.
26  * <p>
27  * This key consists of a unique string that is typically a GUID.
28  *
29  * @author Ben Hale
30  */

31 public class SimpleConversationId extends ConversationId {
32
33     /**
34      * The id value.
35      */

36     private Serializable JavaDoc id;
37
38     /**
39      * Creates a new simple conversation id.
40      * @param id the id value
41      */

42     public SimpleConversationId(Serializable JavaDoc id) {
43         this.id = id;
44     }
45
46     public boolean equals(Object JavaDoc o) {
47         if (!(o instanceof SimpleConversationId)) {
48             return false;
49         }
50         return id.equals(((SimpleConversationId)o).id);
51     }
52
53     public int hashCode() {
54         return id.hashCode();
55     }
56
57     public String JavaDoc toString() {
58         return id.toString();
59     }
60 }
Popular Tags