Interface Table<R extends Record>
public interface Table<R extends Record>
Rows of type
R, each under a String key. Every write commits immediately,
unless it runs inside ModStorage.transaction(Runnable). Calls block; on the main thread they
are only allowed during startup.-
Method Summary
Modifier and TypeMethodDescriptionbooleanlongcount()booleanintdeleteAll(Collection<String> keys) voidforEach(BiConsumer<String, R> action) Callsactionfor every row, sorted by key, without loading all rows at once.getAll(Collection<String> keys) The rows of the given keys that exist.keys()Every key, sorted.voidStoresvalueunderkey, replacing an existing row.voidStores every entry in one transaction.Replaces the row underkeywithchangeapplied to it, or toinitialwhen there is none, in one transaction: no other write comes in between.
-
Method Details
-
set
-
setAll
-
get
-
getAll
The rows of the given keys that exist. -
contains
-
delete
- Returns:
- whether a row was removed
-
deleteAll
- Returns:
- the number of rows removed
-
keys
-
forEach
Callsactionfor every row, sorted by key, without loading all rows at once. Storage of every mod waits until it returns, soactionmust not wait for other threads. -
count
long count() -
update
Replaces the row underkeywithchangeapplied to it, or toinitialwhen there is none, in one transaction: no other write comes in between. As inModStorage.transaction(Runnable),changeandinitialmust not wait for other threads.- Returns:
- the stored value
-