package org.sonar.server.computation.debt;
+import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
import static java.util.Objects.requireNonNull;
@Immutable
public class Characteristic {
-
private final int id;
private final String key;
}
@Override
- public boolean equals(Object o) {
+ public boolean equals(@Nullable Object o) {
if (this == o) {
return true;
}
}
Characteristic that = (Characteristic) o;
-
- if (id != that.id) {
- return false;
- }
- return key.equals(that.key);
-
+ return id == that.id && key.equals(that.key);
}
@Override
@Override
public String toString() {
- return "CharacteristicImpl{" +
+ return "Characteristic{" +
"id=" + id +
", key='" + key + '\'' +
'}';
@Test
public void test_to_string() throws Exception {
- assertThat(new Characteristic(1, "PORTABILITY").toString()).isEqualTo("CharacteristicImpl{id=1, key='PORTABILITY'}");
+ assertThat(new Characteristic(1, "PORTABILITY").toString()).isEqualTo("Characteristic{id=1, key='PORTABILITY'}");
}
@Test