Add category to badges

This commit is contained in:
Ehren Kret
2021-09-15 17:34:16 -05:00
parent ce3835e176
commit 08c6a8c2e5
6 changed files with 34 additions and 13 deletions

View File

@@ -16,13 +16,16 @@ import javax.validation.constraints.NotNull;
public class BadgeConfiguration {
private final String id;
private final URL imageUrl;
private final String category;
@JsonCreator
public BadgeConfiguration(
@JsonProperty("id") final String id,
@JsonProperty("imageUrl") @JsonDeserialize(converter = URLDeserializationConverter.class) final URL imageUrl) {
@JsonProperty("imageUrl") @JsonDeserialize(converter = URLDeserializationConverter.class) final URL imageUrl,
@JsonProperty("category") final String category) {
this.id = id;
this.imageUrl = imageUrl;
this.category = category;
}
@NotEmpty
@@ -35,4 +38,9 @@ public class BadgeConfiguration {
public URL getImageUrl() {
return imageUrl;
}
@NotEmpty
public String getCategory() {
return category;
}
}