Check whether the two Flags objects are equal. @return true if they're equal
(Object obj)
| 372 | * @return true if they're equal |
| 373 | */ |
| 374 | @Override |
| 375 | public boolean equals(Object obj) { |
| 376 | if (!(obj instanceof Flags)) |
| 377 | return false; |
| 378 | |
| 379 | Flags f = (Flags)obj; |
| 380 | |
| 381 | // Check system flags |
| 382 | if (f.system_flags != this.system_flags) |
| 383 | return false; |
| 384 | |
| 385 | // Check user flags |
| 386 | int size = this.user_flags == null ? 0 : this.user_flags.size(); |
| 387 | int fsize = f.user_flags == null ? 0 : f.user_flags.size(); |
| 388 | if (size == 0 && fsize == 0) |
| 389 | return true; |
| 390 | if (f.user_flags != null && this.user_flags != null && fsize == size) |
| 391 | return user_flags.keySet().equals(f.user_flags.keySet()); |
| 392 | |
| 393 | return false; |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Compute a hash code for this Flags object. |
no test coverage detected