Add constructor to create empty RoleInfo
Change-Id: If16483fb20d8d0010a22982e0d8f20a295017e62
Showing
1 changed file
with
6 additions
and
1 deletions
| ... | @@ -35,6 +35,11 @@ public class RoleInfo { | ... | @@ -35,6 +35,11 @@ public class RoleInfo { |
| 35 | this.backups = ImmutableList.copyOf(backups); | 35 | this.backups = ImmutableList.copyOf(backups); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | + public RoleInfo() { | ||
| 39 | + this.master = null; | ||
| 40 | + this.backups = ImmutableList.of(); | ||
| 41 | + } | ||
| 42 | + | ||
| 38 | public NodeId master() { | 43 | public NodeId master() { |
| 39 | return master; | 44 | return master; |
| 40 | } | 45 | } |
| ... | @@ -63,7 +68,7 @@ public class RoleInfo { | ... | @@ -63,7 +68,7 @@ public class RoleInfo { |
| 63 | 68 | ||
| 64 | @Override | 69 | @Override |
| 65 | public int hashCode() { | 70 | public int hashCode() { |
| 66 | - return Objects.hash(master, backups.hashCode()); | 71 | + return Objects.hash(master, backups); |
| 67 | } | 72 | } |
| 68 | 73 | ||
| 69 | @Override | 74 | @Override | ... | ... |
-
Please register or login to post a comment