Package dev.twilite.game.stream
Class ServerView
Lazy view over loaded server-list entries.
-
Constructor Summary
ConstructorsConstructorDescriptionServerView(Supplier<Stream<Server>> source) Creates a server view backed by a stream supplier. -
Method Summary
Modifier and TypeMethodDescriptionFilters servers by activity text.Returns a new server view with an additional filter.flag(Server.Flag... flags) Filters servers by property flag.id(int... ids) Filters servers by world id.Includes the current server in this view.location(Server.Location... locations) Filters servers by location.members()Filters members-only servers.next()Returns the next matching server after the current server, wrapping to the lowest id when needed.not()Returns a new server view with the most recent filter negated.Returns a new server view with the supplied filter OR'ed with the most recent filter.population(int min, int max) Filters servers by inclusive population range.previous()Returns the previous matching server before the current server, wrapping to the highest id when needed.random()Returns a random matching server.stream()Opens a stream of matching servers.Methods inherited from class dev.twilite.game.stream.View
count, exists, first, iterator, map, mapToInt, toListMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ServerView
Creates a server view backed by a stream supplier.
-
-
Method Details
-
filter
Returns a new server view with an additional filter. -
not
Returns a new server view with the most recent filter negated. -
or
Returns a new server view with the supplied filter OR'ed with the most recent filter. -
includeCurrent
Includes the current server in this view. -
id
Filters servers by world id. -
activity
Filters servers by activity text. -
location
Filters servers by location. -
members
Filters members-only servers. -
flag
Filters servers by property flag. -
population
Filters servers by inclusive population range. -
next
Returns the next matching server after the current server, wrapping to the lowest id when needed. -
previous
Returns the previous matching server before the current server, wrapping to the highest id when needed. -
random
Returns a random matching server. -
stream
Opens a stream of matching servers.
-