Skip to content

Commit

Permalink
Update AuthzCriteria.java
Browse files Browse the repository at this point in the history
  • Loading branch information
g-duval committed Jun 18, 2024
1 parent 1ca52b2 commit f01f9f3
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.redhat.cloud.notifications.recipients.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;

@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public class AuthzCriteria {

@NotNull
private String assetType;

@NotNull
private String assetId;

public AuthzCriteria(String assetType, String assetId) {
this.assetType = assetType;
this.assetId = assetId;
}

public @NotNull String getAssetType() {
return assetType;
}

public @NotNull String getAssetId() {
return assetId;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AuthzCriteria that = (AuthzCriteria) o;
return Objects.equals(assetType, that.assetType) && Objects.equals(assetId, that.assetId);
}

@Override
public int hashCode() {
return Objects.hash(assetType, assetId);
}
}

0 comments on commit f01f9f3

Please sign in to comment.