com.yahoo.vespa.flags.custom.Role Maven / Gradle / Ivy
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.flags.custom;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class Role {
@JsonProperty("name")
private final String name;
@JsonProperty("members")
private final List members;
@JsonCreator
public Role(@JsonProperty("name") String name, @JsonProperty("members") List members) {
this.name = name;
this.members = members;
}
public String getName() {
return name;
}
public List getMembers() {
return members;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Role that = (Role) o;
return Objects.equals(name, that.name) && Objects.equals(members, that.members);
}
@Override
public int hashCode() {
return Objects.hash(name, members);
}
@Override
public String toString() {
return "RoleDefinition{" +
"name='" + name + '\'' +
", members=" + members +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy