-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...resolver/src/main/java/com/redhat/cloud/notifications/recipients/model/AuthzCriteria.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |