Record Class Observed
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.page.Observed
public record Observed(net.minecraft.resources.Identifier source, @Nullable String of, String row, String header, String footer, String separator, @Nullable String sort, @Nullable com.google.gson.JsonObject where, int limit, String empty)
extends Record
An element's
"observe": text written from a live list (FoliosSources), a line of markup for each of its
rows, put after the element's own text and written again whenever the list changes.
"observe": {
"source": "whycantisleep:sleep_modifiers", "of": "...",
"row": "- **{$name}** ({$points}): {$description}",
"sort": "name", "where": {"field": "points", "below": 0}, "limit": 10,
"header": "...", "footer": "...", "separator": "\n", "empty": "*None yet.*"
}
"of" narrows a source Folios gives itself (folios:items of a tag, say: see FoliosBuiltinSources).
{$field} is a row's field (its id too); a field holding a translation key is translated. sort
names a field ("-name" for the other way; numbers sort as numbers); where keeps rows whose field
is, is not, is above or below a value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionempty()Returns the value of theemptyrecord component.final booleanIndicates whether some other object is "equal to" this one.footer()Returns the value of thefooterrecord component.final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.intlimit()Returns the value of thelimitrecord component.@Nullable Stringof()Returns the value of theofrecord component.static @Nullable Observedread(com.google.gson.JsonObject json) What a page's or an element's JSON observes; null for one that observes nothing.row()Returns the value of therowrecord component.Returns the value of theseparatorrecord component.@Nullable Stringsort()Returns the value of thesortrecord component.net.minecraft.resources.Identifiersource()Returns the value of thesourcerecord component.text()The text as the list is now.final StringtoString()Returns a string representation of this record class.@Nullable com.google.gson.JsonObjectwhere()Returns the value of thewhererecord component.
-
Constructor Details
-
Observed
public Observed(net.minecraft.resources.Identifier source, @Nullable String of, String row, String header, String footer, String separator, @Nullable String sort, @Nullable com.google.gson.JsonObject where, int limit, String empty) Creates an instance of aObservedrecord class.- Parameters:
source- the value for thesourcerecord componentof- the value for theofrecord componentrow- the value for therowrecord componentheader- the value for theheaderrecord componentfooter- the value for thefooterrecord componentseparator- the value for theseparatorrecord componentsort- the value for thesortrecord componentwhere- the value for thewhererecord componentlimit- the value for thelimitrecord componentempty- the value for theemptyrecord component
-
-
Method Details
-
read
What a page's or an element's JSON observes; null for one that observes nothing. -
text
The text as the list is now. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
source
public net.minecraft.resources.Identifier source()Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
of
Returns the value of theofrecord component.- Returns:
- the value of the
ofrecord component
-
row
Returns the value of therowrecord component.- Returns:
- the value of the
rowrecord component
-
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
separator
Returns the value of theseparatorrecord component.- Returns:
- the value of the
separatorrecord component
-
sort
Returns the value of thesortrecord component.- Returns:
- the value of the
sortrecord component
-
where
public @Nullable com.google.gson.JsonObject where()Returns the value of thewhererecord component.- Returns:
- the value of the
whererecord component
-
limit
public int limit()Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-
empty
Returns the value of theemptyrecord component.- Returns:
- the value of the
emptyrecord component
-