mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Add] Framework-API 为 BotCode 添加 'hasProperty(String)' 方法以用于检查某参数是否存在;
[Add] BotCode 添加 'hasProperty(String)' 方法以用于检查某参数是否存在; [Change] AbstractBotCode 添加新方法的实现;
This commit is contained in:
parent
c7d0ccb3ef
commit
62a46d9348
@ -133,4 +133,8 @@ public abstract class AbstractBotCode implements BotCode {
|
|||||||
return Collections.unmodifiableSet(functionProperties.keySet());
|
return Collections.unmodifiableSet(functionProperties.keySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasProperty(String key) {
|
||||||
|
return functionProperties.containsKey(Objects.requireNonNull(key));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,4 +68,12 @@ public interface BotCode extends Message {
|
|||||||
*/
|
*/
|
||||||
Set<String> getPropertiesKeys();
|
Set<String> getPropertiesKeys();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查指定参数是否存在.
|
||||||
|
* @param key 待检查的参数名.
|
||||||
|
* @return 如果存在, 返回 {@code true}.
|
||||||
|
* @throws NullPointerException 当 key 为 {@code null} 时抛出.
|
||||||
|
*/
|
||||||
|
boolean hasProperty(String key);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user