コード例 #1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (!(obj instanceof LayoutSetBranch)) {
      return false;
    }

    LayoutSetBranch layoutSetBranch = (LayoutSetBranch) obj;

    long primaryKey = layoutSetBranch.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }
コード例 #2
0
  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }

    LayoutSetBranch layoutSetBranch = null;

    try {
      layoutSetBranch = (LayoutSetBranch) obj;
    } catch (ClassCastException cce) {
      return false;
    }

    long primaryKey = layoutSetBranch.getPrimaryKey();

    if (getPrimaryKey() == primaryKey) {
      return true;
    } else {
      return false;
    }
  }