public class CQAppendList extends Object implements AppendList
Constructor and Description |
---|
CQAppendList()
无参构造,默认拼接符为一个空字符
|
CQAppendList(CharSequence delimiter)
指定拼接符的构造
|
Modifier and Type | Method and Description |
---|---|
AppendList |
append(AppendList append)
拼接另一个AppendList
|
AppendList |
append(boolean append) |
AppendList |
append(char append) |
AppendList |
append(CharSequence append)
拼接一个CharSequence类型对象
如果字符串可以转化为CQCode则会进行转化。
* 一个append中如果包含而不是整个都是的话将不会进行转化。
* 例如:
*
* append("hello! [CQ:at,qq=123]");
* append(" [CQ:at,qq=123] ");
* 以上情况不会进行转化。
* |
AppendList |
append(double append) |
AppendList |
append(int append) |
AppendList |
append(long append) |
AppendList |
appendTrim(AppendList append)
批量加载,且都去空处理
|
AppendList |
appendTrim(CharSequence append)
转化为字符串后会前后去空处理
|
boolean |
contains(Object o)
是否包含
|
boolean |
containsType(CQCodeTypes types)
是否包含某个CQ码类型
|
void |
forEach(Consumer<CharSequence> each)
foreach方法
|
void |
forEachCQCode(BiConsumer<CQCode,Integer> each)
只遍历CQCode的foreach,携带索引参数
|
CharSequence |
get(int index)
获取某个索引上的值
|
CharSequence[] |
getAll()
获取所有的值
|
CQCode[] |
getCQCodes()
获取拼接列表中的CQCode对象
|
AppendList |
merge()
字符串合并,有时候如果前后两个都是字符串,则直接合并这两个为一个元素。
合并的只有String类型
|
int |
size()
获取长度
|
Stream<CharSequence> |
stream()
转化为流对象
|
Stream<CQCode> |
streamCQCode()
转化为仅保留CQCode的流对象
|
String |
toString()
转为拼接字符串
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
append
public CQAppendList()
public CQAppendList(CharSequence delimiter)
public AppendList append(long append)
append
in interface AppendList
public AppendList append(int append)
append
in interface AppendList
public AppendList append(double append)
append
in interface AppendList
public AppendList append(boolean append)
append
in interface AppendList
public AppendList append(char append)
append
in interface AppendList
public AppendList append(CharSequence append)
AppendList
* append("hello! [CQ:at,qq=123]");
* append(" [CQ:at,qq=123] ");
* 以上情况不会进行转化。
*
append
in interface AppendList
public AppendList appendTrim(CharSequence append)
AppendList
appendTrim
in interface AppendList
public AppendList append(AppendList append)
AppendList
append
in interface AppendList
public AppendList appendTrim(AppendList append)
AppendList
appendTrim
in interface AppendList
public CQCode[] getCQCodes()
AppendList
getCQCodes
in interface AppendList
public CharSequence get(int index)
AppendList
get
in interface AppendList
public CharSequence[] getAll()
AppendList
getAll
in interface AppendList
public int size()
AppendList
size
in interface AppendList
public boolean contains(Object o)
AppendList
contains
in interface AppendList
public boolean containsType(CQCodeTypes types)
AppendList
containsType
in interface AppendList
public void forEach(Consumer<CharSequence> each)
AppendList
forEach
in interface AppendList
public void forEachCQCode(BiConsumer<CQCode,Integer> each)
AppendList
forEachCQCode
in interface AppendList
public Stream<CharSequence> stream()
AppendList
stream
in interface AppendList
public Stream<CQCode> streamCQCode()
AppendList
streamCQCode
in interface AppendList
public String toString()
toString
in interface AppendList
toString
in class Object
public AppendList merge()
merge
in interface AppendList
Copyright © 2020. All rights reserved.