PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/v3.2/nimbits-model/src/com/nimbits/client/model/common/impl/CommonIdentifierImpl.java

http://nimbits-server.googlecode.com/
Java | 69 lines | 34 code | 17 blank | 18 comment | 3 complexity | c71cba3fcebf678bb36d69395694cf5b MD5 | raw file
 1/*
 2 * Copyright (c) 2010 Tonic Solutions LLC.
 3 *
 4 * http://www.nimbits.com
 5 *
 6 *
 7 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 8 *
 9 * http://www.gnu.org/licenses/gpl.html
10 *
11 * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
12 */
13
14package com.nimbits.client.model.common.impl;
15
16import com.nimbits.client.model.common.CommonIdentifier;
17
18import java.io.Serializable;
19
20/**
21 * Created by bsautner
22 * User: benjamin
23 * Date: 8/6/11
24 * Time: 11:07 AM
25 */
26public abstract  class CommonIdentifierImpl implements CommonIdentifier, Serializable{
27
28    private String value;
29
30    protected CommonIdentifierImpl(final String value) {
31        this.value = value;
32    }
33
34    @Override
35    public boolean equals(Object o) {
36        if (this == o) {
37        return true;
38        }
39
40        if (!(o instanceof CommonIdentifierImpl)){
41            return false;
42        }
43
44        CommonIdentifierImpl that = (CommonIdentifierImpl) o;
45
46        return value.equals(that.value);
47
48    }
49
50    @Override
51    public int hashCode() {
52        return value.hashCode();
53    }
54
55    @Override
56    public String getValue() {
57        return value;
58
59    }
60
61    @Override
62    public String toString() {
63        return  this.value;
64    }
65
66    protected CommonIdentifierImpl() {
67
68    }
69}