Skip to content

Commit 054a588

Browse files
committed
Use switch for different protocol value
1 parent 1aff4a5 commit 054a588

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed
Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
package com.uid2.shared.secure;
22

33
public enum Protocol {
4-
GCP_OIDC("gcp-oidc"),
5-
GCP_VMID("gcp-vmid"),
6-
AWS_NITRO("aws-nitro"),
7-
AZURE_CC_ACI("azure-cc"),
8-
AZURE_CC_AKS("azure-cc-aks");
9-
10-
private final String protocolValue;
11-
12-
Protocol(String protocolValue) {
13-
this.protocolValue = protocolValue;
14-
}
4+
GCP_OIDC,
5+
GCP_VMID,
6+
AWS_NITRO,
7+
AZURE_CC_ACI,
8+
AZURE_CC_AKS;
159

1610
public String toString() {
17-
return this.protocolValue;
11+
switch(this) {
12+
case GCP_OIDC:
13+
return "gcp-oidc";
14+
case GCP_VMID:
15+
return "gcp-vmid";
16+
case AWS_NITRO:
17+
return "aws-nitro";
18+
case AZURE_CC_ACI:
19+
return "azure-cc";
20+
case AZURE_CC_AKS:
21+
return "azure-cc-aks";
22+
default:
23+
return "unknown-protocol";
24+
}
25+
1826
}
1927
}

0 commit comments

Comments
 (0)