/**
 * Copyright (C) 2009 - 2009 by OpenGamma Inc.
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.security.db;

import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 
 *
 * @author jim
 */
public class IdentifierBean {
  // Note: the reason that this doesn't have an id is that it's a hibernate
  // component of other beans so it doesn't need one
  private String _identifier;
  private String _scheme;
  
  public IdentifierBean() {
  }

  public IdentifierBean(String scheme, String identifier) {
    _scheme = scheme;
    _identifier = identifier;
  }
  
  public String getScheme() {
    return _scheme;
  }
  
  public void setScheme(String scheme) {
    _scheme = scheme;
  }
  
  public String getIdentifier() {
    return _identifier;
  }
  
  public void setIdentifier(String identifier) {
    _identifier = identifier;
  }
  
  public boolean equals(Object other) {
    if (other == null) return false;
    if (other == this) return true;
    if (!(other instanceof IdentifierBean)) return false;
    IdentifierBean otherBean = (IdentifierBean) other;
    return ObjectUtils.equals(otherBean.getScheme(), getScheme())
        && ObjectUtils.equals(otherBean.getIdentifier(), getIdentifier());
  }
  
  public String toString() {
    return ToStringBuilder.reflectionToString(this);
  }
}

@@ -908,32 +908,312 @@
 ntifier;%0A  %7D%0A  %0A
+  @Override%0A  public int hashCode() %7B%0A    final int prime = 31;%0A    int result = 1;%0A    result = prime * result + ((_identifier == null) ? 0 : _identifier.hashCode());%0A    result = prime * result + ((_scheme == null) ? 0 : _scheme.hashCode());%0A    return result;%0A  %7D%0A%0A  @Override%0A
   public boolean
@@ -1258,16 +1258,24 @@
 == null)
+ %7B%0A     
  return 
@@ -1277,24 +1277,30 @@
 turn false;%0A
+    %7D%0A
     if (othe
@@ -1309,16 +1309,25 @@
 == this)
+ %7B %0A     
  return 
@@ -1332,16 +1332,22 @@
 n true;%0A
+    %7D%0A
     if (
@@ -1381,16 +1381,24 @@
 erBean))
+ %7B%0A     
  return 
@@ -1400,24 +1400,30 @@
 turn false;%0A
+    %7D%0A
     Identifi
@@ -1606,26 +1606,24 @@
 ier());%0A  %7D%0A
-  
 %0A  public St

add hashcode() method