Record Class DayMark
- Record Components:
dot- the dot's colour; nevernulldescription- what a reader is told about the day, ornullfor a mark that is decoration
A dot under the day's number and, optionally, a phrase that joins what a screen reader says about that cell. Both halves matter and the second is the one that is usually forgotten: a coloured dot is invisible to a reader and to anyone who cannot tell the colours apart, so a mark that carries no description is a mark half the users of a form cannot perceive at all. It is still allowed — a dot that only repeats what the surrounding screen already says is decoration, and naming it would be noise — but it is the caller's decision rather than the default.
The colour is the application's. A holiday is red in a payroll screen and green in a
booking one, and the toolkit has no opinion about which; what it does have is
Theme, so Theme.of(this).danger and its neighbours are the
colours a mark should normally be built from rather than a literal that will not follow a
palette.
-
Constructor Summary
ConstructorsConstructorDescriptionDayMark(Color dot, @Nullable I18nString description) Creates an instance of aDayMarkrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable I18nStringReturns the value of thedescriptionrecord component.dot()Returns the value of thedotrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static DayMarkA mark that is only a dot: nothing is added to what a reader hears.static DayMarkof(Color dot, I18nString description) A mark with a phrase a reader hears after the date.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DayMark
Creates an instance of aDayMarkrecord class.- Parameters:
dot- the value for thedotrecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
of
A mark that is only a dot: nothing is added to what a reader hears.- Parameters:
dot- the dot's colour- Returns:
- the mark
-
of
A mark with a phrase a reader hears after the date.- Parameters:
dot- the dot's colourdescription- what the day is; resolved in the calendar's own language, like every other name in the accessible tree- Returns:
- the mark
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
dot
Returns the value of thedotrecord component.- Returns:
- the value of the
dotrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-