Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FlowReference |
|
| 2.7142857142857144;2.714 |
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one | |
3 | * or more contributor license agreements. See the NOTICE file | |
4 | * distributed with this work for additional information | |
5 | * regarding copyright ownership. The ASF licenses this file | |
6 | * to you under the Apache License, Version 2.0 (the | |
7 | * "License"); you may not use this file except in compliance | |
8 | * with the License. You may obtain a copy of the License at | |
9 | * | |
10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
11 | * | |
12 | * Unless required by applicable law or agreed to in writing, | |
13 | * software distributed under the License is distributed on an | |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
15 | * KIND, either express or implied. See the License for the | |
16 | * specific language governing permissions and limitations | |
17 | * under the License. | |
18 | */ | |
19 | package org.apache.myfaces.flow; | |
20 | ||
21 | import java.io.Serializable; | |
22 | ||
23 | /** | |
24 | * This class works as a reference that can be stored into session to | |
25 | * the current flow. | |
26 | * | |
27 | * @author Leonardo Uribe | |
28 | */ | |
29 | public class FlowReference implements Serializable | |
30 | { | |
31 | ||
32 | private String _documentId; | |
33 | ||
34 | private String _id; | |
35 | ||
36 | public FlowReference(String documentId, String id) | |
37 | 0 | { |
38 | 0 | this._documentId = documentId; |
39 | 0 | this._id = id; |
40 | 0 | } |
41 | ||
42 | /** | |
43 | * @return the documentId | |
44 | */ | |
45 | public String getDocumentId() | |
46 | { | |
47 | 0 | return _documentId; |
48 | } | |
49 | ||
50 | /** | |
51 | * @param documentId the documentId to set | |
52 | */ | |
53 | public void setDocumentId(String documentId) | |
54 | { | |
55 | 0 | this._documentId = documentId; |
56 | 0 | } |
57 | ||
58 | /** | |
59 | * @return the id | |
60 | */ | |
61 | public String getId() | |
62 | { | |
63 | 0 | return _id; |
64 | } | |
65 | ||
66 | /** | |
67 | * @param id the id to set | |
68 | */ | |
69 | public void setId(String id) | |
70 | { | |
71 | 0 | this._id = id; |
72 | 0 | } |
73 | ||
74 | @Override | |
75 | public int hashCode() | |
76 | { | |
77 | 0 | int hash = 3; |
78 | 0 | hash = 23 * hash + (this._documentId != null ? this._documentId.hashCode() : 0); |
79 | 0 | hash = 23 * hash + (this._id != null ? this._id.hashCode() : 0); |
80 | 0 | return hash; |
81 | } | |
82 | ||
83 | @Override | |
84 | public boolean equals(Object obj) | |
85 | { | |
86 | 0 | if (obj == null) |
87 | { | |
88 | 0 | return false; |
89 | } | |
90 | 0 | if (getClass() != obj.getClass()) |
91 | { | |
92 | 0 | return false; |
93 | } | |
94 | 0 | final FlowReference other = (FlowReference) obj; |
95 | 0 | if ((this._documentId == null) ? (other._documentId != null) : !this._documentId.equals(other._documentId)) |
96 | { | |
97 | 0 | return false; |
98 | } | |
99 | 0 | if ((this._id == null) ? (other._id != null) : !this._id.equals(other._id)) |
100 | { | |
101 | 0 | return false; |
102 | } | |
103 | 0 | return true; |
104 | } | |
105 | ||
106 | } |