Class ConfiguredText<MSG,RECEIVER>
- java.lang.Object
-
- cc.carm.lib.configuration.value.ValueManifest<T,U>
-
- cc.carm.lib.configuration.value.ConfigValue<T,U>
-
- cc.carm.lib.configuration.value.impl.CachedConfigValue<V,V>
-
- cc.carm.lib.configuration.value.standard.ConfiguredValue<TextContents>
-
- cc.carm.lib.configuration.value.text.ConfiguredText<MSG,RECEIVER>
-
- Type Parameters:
MSG- The type of the messageRECEIVER- The type of the receiver
public class ConfiguredText<MSG,RECEIVER> extends ConfiguredValue<TextContents>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfiguredText.Builder<MSG,RECEIVER,SELF extends ConfiguredText.Builder<MSG,RECEIVER,SELF>>static classConfiguredText.StardardBuilder<MSG,RECEIVER>
-
Field Summary
Fields Modifier and Type Field Description protected @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,MSG>compilerprotected @NotNull java.util.function.BiConsumer<RECEIVER,java.util.List<MSG>>dispatcherprotected @NotNull java.lang.String[]paramsprotected @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,java.lang.String>parserstatic ValueAdapter<TextContents>TEXT_ADAPTERstatic ValueType<TextContents>TEXT_TYPE-
Fields inherited from class cc.carm.lib.configuration.value.standard.ConfiguredValue
adapter
-
Fields inherited from class cc.carm.lib.configuration.value.impl.CachedConfigValue
cachedValue, parsedTime
-
Fields inherited from class cc.carm.lib.configuration.value.ValueManifest
defaultSupplier, holder, initializer, path, type, validator
-
-
Constructor Summary
Constructors Constructor Description ConfiguredText(@NotNull ValueManifest<TextContents,TextContents> manifest, @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,java.lang.String> parser, @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,MSG> compiler, @NotNull java.util.function.BiConsumer<RECEIVER,java.util.List<MSG>> dispatcher, @NotNull java.lang.String[] params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MSG>compile(RECEIVER receiver, @NotNull java.lang.Object... values)Compile the message for the receiver.MSGcompileLine(RECEIVER receiver, @NotNull java.lang.Object... values)Compile the message for the receiver and send it.static <M,R>
ConfiguredText.Builder<M,R,?>create()java.util.List<java.lang.String>parse(RECEIVER receiver, @NotNull java.lang.Object... values)Parse the message for the receiver.java.lang.StringparseLine(RECEIVER receiver, @NotNull java.lang.Object... values)Parse the message for the receiver and send it.PreparedText<MSG,RECEIVER>prepare(@NotNull java.lang.Object... values)voidsendTo(RECEIVER receiver, @NotNull java.lang.Object... values)Send the message to the receiver.voidsendToAll(@NotNull java.lang.Iterable<? extends RECEIVER> receivers, @NotNull java.lang.Object... values)Send the message to the multiple receivers.-
Methods inherited from class cc.carm.lib.configuration.value.standard.ConfiguredValue
adapter, builderOf, builderOf, get, of, of, of, of, of, of, of, of, parser, serializer, set, with, with
-
Methods inherited from class cc.carm.lib.configuration.value.impl.CachedConfigValue
cacheExpired, getCachedOrDefault, getCachedOrDefault, getCachedValue, getDefaultFirst, parserFor, serializerFor, updateCache
-
Methods inherited from class cc.carm.lib.configuration.value.ConfigValue
getNotNull, getOrDefault, isDefault, optional, resolve, save, setDefault, setDefault
-
Methods inherited from class cc.carm.lib.configuration.value.ValueManifest
config, defaults, defaults, defaults, getData, hasDefaults, holder, holder, initialize, initialize, metadata, path, path, setData, throwing, throwing, type, validate, validator, validator, withValidated
-
-
-
-
Field Detail
-
TEXT_TYPE
public static final ValueType<TextContents> TEXT_TYPE
-
TEXT_ADAPTER
public static final ValueAdapter<TextContents> TEXT_ADAPTER
-
parser
@NotNull protected final @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,java.lang.String> parser
-
compiler
@NotNull protected final @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,MSG> compiler
-
dispatcher
@NotNull protected final @NotNull java.util.function.BiConsumer<RECEIVER,java.util.List<MSG>> dispatcher
-
params
@NotNull protected final @NotNull java.lang.String[] params
-
-
Constructor Detail
-
ConfiguredText
public ConfiguredText(@NotNull @NotNull ValueManifest<TextContents,TextContents> manifest, @NotNull @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,java.lang.String> parser, @NotNull @NotNull java.util.function.BiFunction<RECEIVER,java.lang.String,MSG> compiler, @NotNull @NotNull java.util.function.BiConsumer<RECEIVER,java.util.List<MSG>> dispatcher, @NotNull @NotNull java.lang.String[] params)
-
-
Method Detail
-
create
public static <M,R> ConfiguredText.Builder<M,R,?> create()
-
prepare
public PreparedText<MSG,RECEIVER> prepare(@NotNull @NotNull java.lang.Object... values)
-
parse
public java.util.List<java.lang.String> parse(@Nullable RECEIVER receiver, @NotNull @NotNull java.lang.Object... values)Parse the message for the receiver.- Parameters:
receiver- The receiver of the message.values- The values to replace theparams.- Returns:
- The parsed message.
-
parseLine
public java.lang.String parseLine(@Nullable RECEIVER receiver, @NotNull @NotNull java.lang.Object... values)Parse the message for the receiver and send it.- Parameters:
receiver- The receiver of the message.values- The values to replace theparams.- Returns:
- The parsed message.
-
compile
public java.util.List<MSG> compile(@Nullable RECEIVER receiver, @NotNull @NotNull java.lang.Object... values)
Compile the message for the receiver.- Parameters:
receiver- The receiver of the message.values- The values to replace theparams.- Returns:
- The compiled message.
-
compileLine
public MSG compileLine(@Nullable RECEIVER receiver, @NotNull @NotNull java.lang.Object... values)
Compile the message for the receiver and send it.- Parameters:
receiver- The receiver of the message.values- The values to replace theparams.- Returns:
- The compiled message.
-
sendTo
public void sendTo(@NotNull RECEIVER receiver, @NotNull @NotNull java.lang.Object... values)Send the message to the receiver.- Parameters:
receiver- The receiver of the message.values- The values to replace theparams.
-
-