blob: 4370097bf214db90f12f5d6d1b5cc697c766e542 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.athenz.api;
import java.util.Objects;
public class AthenzGroup implements AthenzIdentity {
private final AthenzDomain domain;
private final String groupName;
public AthenzGroup(AthenzDomain domain, String groupName) {
this.domain = domain;
this.groupName = groupName;
}
public AthenzGroup(String domain, String groupName) {
this.domain = new AthenzDomain(domain);
this.groupName = groupName;
}
public AthenzDomain domain() {
return domain;
}
public String groupName() {
return groupName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AthenzGroup that = (AthenzGroup) o;
return Objects.equals(domain, that.domain) && Objects.equals(groupName, that.groupName);
}
@Override
public int hashCode() {
return Objects.hash(domain, groupName);
}
@Override
public AthenzDomain getDomain() {
return domain;
}
@Override
public String getName() {
return groupName;
}
@Override
public String getFullName() {
return getDomainName() + ":group." + getName();
}
}
|