-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from qzhello/main
Make metadata-config https compatible
- Loading branch information
Showing
2 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
src/main/java/com/ly/ckibana/constants/SecurityProtocolEnum.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,43 @@ | ||
package com.ly.ckibana.constants; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* 协议枚举类 | ||
*/ | ||
public enum SecurityProtocolEnum { | ||
/** | ||
* HTTP | ||
*/ | ||
HTTP("http", 80), | ||
/** | ||
* HTTPS | ||
*/ | ||
HTTPS("https", 443); | ||
|
||
/** | ||
* 协议名 | ||
*/ | ||
private final String scheme; | ||
/** | ||
* 默认端口号 | ||
*/ | ||
private final int port; | ||
|
||
SecurityProtocolEnum(String scheme, int port) { | ||
this.scheme = scheme; | ||
this.port = port; | ||
} | ||
|
||
public String getScheme() { | ||
return scheme; | ||
} | ||
|
||
public int getPort() { | ||
return port; | ||
} | ||
|
||
public SecurityProtocolEnum get(String scheme) { | ||
return Arrays.stream(values()).filter(n -> n.getScheme().equals(scheme)).findFirst().orElse(null); | ||
} | ||
} |
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