Class ContributionLedger
java.lang.Object
com.ultikits.ultitools.bootstrap.ContributionLedger
- All Implemented Interfaces:
ModuleContentLedger
The framework-owned
bootstrap/contributions.json record, read once and atomically replaced
before Paper's write events. It describes declarations, not a snapshot of world data. This is a
derived record, not operator configuration; neither the write nor quarantine targets other files.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final record(package private) static interface(package private) static final recordprivate static final record(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LedgerContentAnswersprivate final Map<String, List<ContentEntry>> (package private) static final ContributionLedgerprivate static final com.google.gson.Gsonprivate static final intprivate static final Stringprivate final Map<String, List<ContentEntry>> private final Map<String, ContributionLedger.Row> private static final intprivate final booleanprivate static final StringFields inherited from interface ModuleContentLedger
NONE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateContributionLedger(Map<String, ContributionLedger.Row> rows, Map<String, List<ContentEntry>> dropped, Map<String, List<ContentEntry>> removed, Set<String> successful, boolean unreadable, Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionReturns the custom content the module added.private static Map<String, ContributionLedger.Row> decode(com.google.gson.JsonObject json) (package private) Map<String, List<ContentEntry>> dropped()private static ContributionLedgermerge(ContributionLedger.ReadResult previous, ContributionLedger.Start start, Instant instant, Logger logger) private static voidquarantine(Path file, Instant now, Logger logger) private static ContributionLedger.ReadResult(package private) Map<String, List<ContentEntry>> removed()private static voidreplace(Path file, Map<String, ContributionLedger.Row> rows, ContributionLedger.RecordWriter writer) private static voidreplaceRow(Map<String, ContributionLedger.Row> rows, Map<String, List<ContentEntry>> dropped, String name, List<ContentEntry> entries, String now) (package private) Map<String, ContributionLedger.Row> rows()private static List<ContentEntry> union(List<ContentEntry> first, List<ContentEntry> second) (package private) boolean(package private) static ContributionLedgerupdate(Path dataFolder, ContributionLedger.Start start, Instant now, Logger logger, ContributionLedger.RecordWriter writer) (package private) static ContributionLedgerupdate(Path dataFolder, ModuleJarAdmission admission, ContributionRegistry registry, Logger logger) (package private) static voidwriteBytes(FileChannel channel, byte[] bytes)
-
Field Details
-
NAME
- See Also:
-
UNREADABLE
- See Also:
-
SCHEMA
private static final int SCHEMA- See Also:
-
KEEP_UNREADABLE
private static final int KEEP_UNREADABLE- See Also:
-
GSON
private static final com.google.gson.Gson GSON -
EMPTY
-
rows
-
dropped
-
removed
-
successful
-
unreadable
private final boolean unreadable -
answers
-
-
Constructor Details
-
ContributionLedger
private ContributionLedger(Map<String, ContributionLedger.Row> rows, Map<String, List<ContentEntry>> dropped, Map<String, List<ContentEntry>> removed, Set<String> successful, boolean unreadable, Logger logger)
-
-
Method Details
-
rows
Map<String, ContributionLedger.Row> rows() -
dropped
Map<String, List<ContentEntry>> dropped() -
removed
Map<String, List<ContentEntry>> removed() -
successful
-
unreadable
boolean unreadable() -
contentOf
Description copied from interface:ModuleContentLedgerReturns the custom content the module added.- Specified by:
contentOfin interfaceModuleContentLedger- Parameters:
identifyString- the module's normalised identify string, ornullwhen unknownmoduleName- thenamefrom the module'splugin.yml; the primary lookup key- Returns:
- the content; never
null
-
update
static ContributionLedger update(Path dataFolder, ModuleJarAdmission admission, ContributionRegistry registry, Logger logger) -
union
-
update
static ContributionLedger update(Path dataFolder, ContributionLedger.Start start, Instant now, Logger logger, ContributionLedger.RecordWriter writer) -
merge
private static ContributionLedger merge(ContributionLedger.ReadResult previous, ContributionLedger.Start start, Instant instant, Logger logger) -
replaceRow
private static void replaceRow(Map<String, ContributionLedger.Row> rows, Map<String, List<ContentEntry>> dropped, String name, List<ContentEntry> entries, String now) -
read
-
decode
private static Map<String, ContributionLedger.Row> decode(com.google.gson.JsonObject json) throws IOException - Throws:
IOException
-
quarantine
-
replace
private static void replace(Path file, Map<String, ContributionLedger.Row> rows, ContributionLedger.RecordWriter writer) throws IOException - Throws:
IOException
-
writeBytes
- Throws:
IOException
-