Package net.ixdarklord.folios.api
Class FoliosFormat
java.lang.Object
net.ixdarklord.folios.api.FoliosFormat
The JSON formats books are written in. A book says which in its book.json,
"format_version": "3.0": the
Folios version it was written for. A format is numbered by the Folios release that changed the JSON, and a release
that changes nothing keeps the format before it, so any Folios version can be named: the newest format at or below
it is used ("3.2" reads as 3.0 while the formats are 3.0 and 3.5).
A book without "format_version" was written for Folios 2.x: it is read as format LEGACY, upgraded to
the current format as it loads, with a warning in the log.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe format this Folios reads, and writes its upgrades in.Every format so far, oldest first.static final StringThe format of books written for Folios 2.x, and of any book that doesn't say.static final StringThe Folios release this is: a book naming a later one needs a newer Folios. -
Method Summary
Modifier and TypeMethodDescriptionstatic intCompares two versions number by number, a missing number counting as 0 ("3"is"3.0").static booleanWhether a book namingversionwas written for a Folios newer than this one.static StringThe format a book namingversionis read in: the newest known at or below it,LEGACYbelow them all.static int @Nullable []A version's numbers ("3.10"is 3 then 10); null when it isn't dot-separated numbers.
-
Field Details
-
LEGACY
The format of books written for Folios 2.x, and of any book that doesn't say.- See Also:
-
CURRENT
The format this Folios reads, and writes its upgrades in.- See Also:
-
KNOWN
Every format so far, oldest first. -
RELEASE
The Folios release this is: a book naming a later one needs a newer Folios.- See Also:
-
-
Method Details
-
parse
A version's numbers ("3.10"is 3 then 10); null when it isn't dot-separated numbers. -
compare
Compares two versions number by number, a missing number counting as 0 ("3"is"3.0"). -
of
The format a book namingversionis read in: the newest known at or below it,LEGACYbelow them all. -
isNewer
Whether a book namingversionwas written for a Folios newer than this one.
-