public abstract class ConfigMessage<M,T extends AbstractText<R>,R> extends cc.carm.lib.configuration.core.value.type.ConfiguredValue<T> implements BaseMessage<R,M>
限定符和类型 | 类和说明 |
---|---|
class |
ConfigMessage.PreparedMessage<P,N> |
限定符和类型 | 字段和说明 |
---|---|
protected @NotNull java.util.function.BiFunction<R,java.lang.String,M> |
messageParser |
protected @NotNull java.lang.String[] |
params |
protected @NotNull java.util.function.BiConsumer<R,M> |
sendFunction |
protected @NotNull java.util.function.Function<java.lang.String,T> |
textBuilder |
构造器和说明 |
---|
ConfigMessage(@NotNull cc.carm.lib.configuration.core.value.ValueManifest<T> manifest,
@NotNull java.lang.Class<T> textClazz,
@NotNull java.lang.String[] params,
@NotNull java.util.function.BiFunction<R,java.lang.String,M> messageParser,
@NotNull java.util.function.BiConsumer<R,M> sendFunction,
@NotNull java.util.function.Function<java.lang.String,T> textBuilder) |
限定符和类型 | 方法和说明 |
---|---|
void |
apply(R receiver,
M message)
向接收者发送消息的根方法。
|
protected T |
buildText(java.lang.String value) |
java.lang.String[] |
getParams()
得到消息中的通过
MessageValueBuilder.params(String...) 已定变量名(按定义顺序) |
M |
parse(R sender,
@NotNull java.util.Map<java.lang.String,java.lang.Object> placeholders)
为某位接收者解析此消息。
|
@Nullable java.lang.String |
parseString(R sender,
@NotNull java.util.Map<java.lang.String,java.lang.Object> placeholders) |
protected <N> N |
parseTo(R sender,
@NotNull java.util.Map<java.lang.String,java.lang.Object> placeholders,
@NotNull java.util.function.BiFunction<R,java.lang.String,N> parser) |
void |
set(@Nullable java.lang.String value) |
builderOf, get, getParser, getSerializer, getValueClass, of, of, of, set
getCachedOrDefault, getCachedOrDefault, getCachedValue, getDefaultFirst, isExpired, updateCache
builder, getNotNull, getOptional, getOrDefault, initialize, isDefault, setDefault, setDefault
getConfigPath, getConfiguration, getDefaultValue, getHeaderComments, getInlineComment, getProvider, getValue, initialize, of, of, setDefaultValue, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
broadcast, broadcast, getAllReceivers, parse, prepare, send, send, sendToAll, sendToAll, sendToEach, sendToEach
@NotNull protected final @NotNull java.lang.String[] params
@NotNull protected final @NotNull java.util.function.BiFunction<R,java.lang.String,M> messageParser
@NotNull protected final @NotNull java.util.function.Function<java.lang.String,T extends AbstractText<R>> textBuilder
public ConfigMessage(@NotNull @NotNull cc.carm.lib.configuration.core.value.ValueManifest<T> manifest, @NotNull @NotNull java.lang.Class<T> textClazz, @NotNull @NotNull java.lang.String[] params, @NotNull @NotNull java.util.function.BiFunction<R,java.lang.String,M> messageParser, @NotNull @NotNull java.util.function.BiConsumer<R,M> sendFunction, @NotNull @NotNull java.util.function.Function<java.lang.String,T> textBuilder)
public java.lang.String[] getParams()
BaseMessage
MessageValueBuilder.params(String...)
已定变量名(按定义顺序)getParams
在接口中 BaseMessage<R,M>
public void apply(@NotNull R receiver, @NotNull M message)
BaseMessage
apply
在接口中 BaseMessage<R,M>
receiver
- 接收者message
- 消息内容@Nullable protected <N> N parseTo(@Nullable R sender, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> placeholders, @NotNull @NotNull java.util.function.BiFunction<R,java.lang.String,N> parser)
@Nullable public @Nullable java.lang.String parseString(@Nullable R sender, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> placeholders)
@Nullable public M parse(@Nullable R sender, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.Object> placeholders)
BaseMessage
parse
在接口中 BaseMessage<R,M>
sender
- 接收者placeholders
- 消息中的变量与对应参数public void set(@Nullable @Nullable java.lang.String value)
protected T buildText(java.lang.String value)
Copyright © 2024. All rights reserved.