[*] 日常优化
This commit is contained in:
@@ -48,6 +48,13 @@ public enum ClientType {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return 是否是媒体服务
|
||||||
|
*/
|
||||||
|
public boolean isMedia() {
|
||||||
|
return this == MEDIA;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 是否是媒体终端
|
* @return 是否是媒体终端
|
||||||
*/
|
*/
|
||||||
@@ -58,13 +65,6 @@ public enum ClientType {
|
|||||||
this == MOBILE;
|
this == MOBILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return 是否是媒体服务
|
|
||||||
*/
|
|
||||||
public boolean isMedia() {
|
|
||||||
return this == MEDIA;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return 是否是应用服务
|
* @return 是否是应用服务
|
||||||
*/
|
*/
|
||||||
@@ -79,7 +79,7 @@ public enum ClientType {
|
|||||||
*/
|
*/
|
||||||
public static final ClientType of(String value) {
|
public static final ClientType of(String value) {
|
||||||
final ClientType[] types = ClientType.values();
|
final ClientType[] types = ClientType.values();
|
||||||
for (ClientType type : types) {
|
for (final ClientType type : types) {
|
||||||
if(type.name().equalsIgnoreCase(value)) {
|
if(type.name().equalsIgnoreCase(value)) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@@ -87,18 +87,19 @@ public enum ClientType {
|
|||||||
throw MessageCodeException.of("未知终端类型:" + value);
|
throw MessageCodeException.of("未知终端类型:" + value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 媒体终端类型列表
|
|
||||||
*/
|
|
||||||
public static final ClientType[] MEDIA_CLIENT_TYPE
|
|
||||||
=
|
|
||||||
Stream.of(ClientType.values()).filter(ClientType::isClient).toArray(ClientType[]::new);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 媒体服务类型列表
|
* 媒体服务类型列表
|
||||||
*/
|
*/
|
||||||
public static final ClientType[] MEDIA_SERVER_TYPE
|
public static final ClientType[] MEDIA_TYPE = Stream.of(ClientType.values()).filter(ClientType::isMedia).toArray(ClientType[]::new);
|
||||||
=
|
|
||||||
Stream.of(ClientType.values()).filter(ClientType::isMedia).toArray(ClientType[]::new);
|
/**
|
||||||
|
* 媒体终端类型列表
|
||||||
|
*/
|
||||||
|
public static final ClientType[] CLIENT_TYPE = Stream.of(ClientType.values()).filter(ClientType::isClient).toArray(ClientType[]::new);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用服务类型列表
|
||||||
|
*/
|
||||||
|
public static final ClientType[] SERVER_TYPE = Stream.of(ClientType.values()).filter(ClientType::isServer).toArray(ClientType[]::new);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user