-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #894 from simple-robot/streamable-api
增加模块与新的公共类型 Streamable, 用来简化部分针对 Sequence 类型的转化操作
- Loading branch information
Showing
22 changed files
with
552 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Project https://github.com/simple-robot/simpler-robot | ||
* Email [email protected] | ||
* | ||
* This file is part of the Simple Robot Library. | ||
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.). | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
|
@@ -23,6 +23,9 @@ | |
|
||
package love.forte.simbot.event | ||
|
||
import love.forte.simbot.common.streamable.Streamable | ||
import love.forte.simbot.common.streamable.Streamable.Companion.asStreamable | ||
|
||
|
||
/** | ||
* 事件监听器的“容器”接口,提供用于获取其中的所有 [EventListener] 的API。 | ||
|
@@ -37,5 +40,11 @@ public interface EventListenerContainer { | |
*/ | ||
public val listeners: Sequence<EventListener> | ||
|
||
|
||
/** | ||
* 获取到 [listeners] 并转化为 [Streamable] | ||
* | ||
* @see listeners | ||
*/ | ||
public fun listenersToStreamable(): Streamable<EventListener> = | ||
listeners.asStreamable() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
simbot-commons/simbot-common-streamable/api/simbot-common-streamable.api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
public final class love/forte/simbot/common/streamable/Streamable : java/lang/Iterable, kotlin/jvm/internal/markers/KMappedMarker { | ||
public static final field Companion Llove/forte/simbot/common/streamable/Streamable$Companion; | ||
public synthetic fun <init> (Lkotlin/sequences/Sequence;Lkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
public final fun asSequence ()Lkotlin/sequences/Sequence; | ||
public final fun asStream ()Ljava/util/stream/Stream; | ||
public final fun collectTo (Ljava/util/Collection;)Ljava/util/Collection; | ||
public final fun collectToList ()Ljava/util/List; | ||
public fun iterator ()Ljava/util/Iterator; | ||
public static final fun of (Lkotlin/sequences/Sequence;)Llove/forte/simbot/common/streamable/Streamable; | ||
} | ||
|
||
public final class love/forte/simbot/common/streamable/Streamable$Companion { | ||
public final fun of (Lkotlin/sequences/Sequence;)Llove/forte/simbot/common/streamable/Streamable; | ||
} | ||
|
Oops, something went wrong.