Add visibility flag to badge storage

This commit is contained in:
Ehren Kret 2021-09-03 15:33:15 -05:00
parent 84b3d324bb
commit bc887ec6fa
1 changed files with 11 additions and 3 deletions

View File

@ -14,13 +14,16 @@ public class AccountBadge {
private final String name;
private final Instant expiration;
private final boolean visible;
@JsonCreator
public AccountBadge(
@JsonProperty("name") String name,
@JsonProperty("expiration") Instant expiration) {
@JsonProperty("expiration") Instant expiration,
@JsonProperty("visible") boolean visible) {
this.name = name;
this.expiration = expiration;
this.visible = visible;
}
public String getName() {
@ -31,6 +34,10 @@ public class AccountBadge {
return expiration;
}
public boolean isVisible() {
return visible;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
@ -40,13 +47,13 @@ public class AccountBadge {
return false;
}
AccountBadge that = (AccountBadge) o;
return Objects.equals(name, that.name)
return visible == that.visible && Objects.equals(name, that.name)
&& Objects.equals(expiration, that.expiration);
}
@Override
public int hashCode() {
return Objects.hash(name, expiration);
return Objects.hash(name, expiration, visible);
}
@Override
@ -54,6 +61,7 @@ public class AccountBadge {
return "AccountBadge{" +
"name='" + name + '\'' +
", expiration=" + expiration +
", visible=" + visible +
'}';
}
}