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, waitappendpublic CQAppendList()
public CQAppendList(CharSequence delimiter)
public AppendList append(long append)
append in interface AppendListpublic AppendList append(int append)
append in interface AppendListpublic AppendList append(double append)
append in interface AppendListpublic AppendList append(boolean append)
append in interface AppendListpublic AppendList append(char append)
append in interface AppendListpublic AppendList append(CharSequence append)
AppendList
* append("hello! [CQ:at,qq=123]");
* append(" [CQ:at,qq=123] ");
* 以上情况不会进行转化。
* append in interface AppendListpublic AppendList appendTrim(CharSequence append)
AppendListappendTrim in interface AppendListpublic AppendList append(AppendList append)
AppendListappend in interface AppendListpublic AppendList appendTrim(AppendList append)
AppendListappendTrim in interface AppendListpublic CQCode[] getCQCodes()
AppendListgetCQCodes in interface AppendListpublic CharSequence get(int index)
AppendListget in interface AppendListpublic CharSequence[] getAll()
AppendListgetAll in interface AppendListpublic int size()
AppendListsize in interface AppendListpublic boolean contains(Object o)
AppendListcontains in interface AppendListpublic boolean containsType(CQCodeTypes types)
AppendListcontainsType in interface AppendListpublic void forEach(Consumer<CharSequence> each)
AppendListforEach in interface AppendListpublic void forEachCQCode(BiConsumer<CQCode,Integer> each)
AppendListforEachCQCode in interface AppendListpublic Stream<CharSequence> stream()
AppendListstream in interface AppendListpublic Stream<CQCode> streamCQCode()
AppendListstreamCQCode in interface AppendListpublic String toString()
toString in interface AppendListtoString in class Objectpublic AppendList merge()
merge in interface AppendListCopyright © 2020. All rights reserved.