Record Class DateMetadata
java.lang.Object
java.lang.Record
com.vaadin.flow.component.datepicker.DateMetadata
- Record Components:
date- the date the metadata applies to, notnulldisabled- whether the date cannot be selectedpartName- custom CSS part names for the date, ornullfor none. Either a single name, or several names separated by spaces. Do not use the names the component sets itself, such asdisabled,selectedortoday: a theme already styles those, and borrowing one can make a date look and behave as if it were in that state.
- All Implemented Interfaces:
Serializable
public record DateMetadata(LocalDate date, boolean disabled, String partName)
extends Record
implements Serializable
Metadata for a single date, returned from a
DateMetadataProvider.- Since:
- 25.3
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDateMetadata(LocalDate date, boolean disabled) Creates new metadata that only marks the date as disabled or not, without any custom part names.DateMetadata(LocalDate date, boolean disabled, String partName) Creates new metadata for the given date.DateMetadata(LocalDate date, String partName) Creates new metadata that only adds custom part names to the date, leaving it selectable. -
Method Summary
Modifier and TypeMethodDescriptiondate()Returns the value of thedaterecord component.booleandisabled()Returns the value of thedisabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.partName()Returns the value of thepartNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DateMetadata
Creates new metadata for the given date.- Parameters:
date- the date the metadata applies to, notnulldisabled- whether the date cannot be selectedpartName- custom CSS part names for the date, ornullfor none
-
DateMetadata
Creates new metadata that only marks the date as disabled or not, without any custom part names.- Parameters:
date- the date the metadata applies to, notnulldisabled- whether the date cannot be selected
-
DateMetadata
Creates new metadata that only adds custom part names to the date, leaving it selectable.- Parameters:
date- the date the metadata applies to, notnullpartName- custom CSS part names for the date, ornullfor none
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
date
Returns the value of thedaterecord component.- Returns:
- the value of the
daterecord component
-
disabled
public boolean disabled()Returns the value of thedisabledrecord component.- Returns:
- the value of the
disabledrecord component
-
partName
Returns the value of thepartNamerecord component.- Returns:
- the value of the
partNamerecord component
-