/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. package com.nimbits.client.model.common.impl;
  14. import com.nimbits.client.model.common.CommonIdentifier;
  15. import java.io.Serializable;
  16. /**
  17. * Created by bsautner
  18. * User: benjamin
  19. * Date: 8/6/11
  20. * Time: 11:07 AM
  21. */
  22. public abstract class CommonIdentifierImpl implements CommonIdentifier, Serializable{
  23. private String value;
  24. protected CommonIdentifierImpl(final String value) {
  25. this.value = value;
  26. }
  27. @Override
  28. public boolean equals(Object o) {
  29. if (this == o) {
  30. return true;
  31. }
  32. if (!(o instanceof CommonIdentifierImpl)){
  33. return false;
  34. }
  35. CommonIdentifierImpl that = (CommonIdentifierImpl) o;
  36. return value.equals(that.value);
  37. }
  38. @Override
  39. public int hashCode() {
  40. return value.hashCode();
  41. }
  42. @Override
  43. public String getValue() {
  44. return value;
  45. }
  46. @Override
  47. public String toString() {
  48. return this.value;
  49. }
  50. protected CommonIdentifierImpl() {
  51. }
  52. }