Record Class DateMetadata

java.lang.Object
java.lang.Record
com.vaadin.flow.component.datepicker.DateMetadata
Record Components:
date - the date the metadata applies to, not null
disabled - whether the date cannot be selected
partName - custom CSS part names for the date, or null for none. Either a single name, or several names separated by spaces. Do not use the names the component sets itself, such as disabled, selected or today: 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

    Constructors
    Constructor
    Description
    DateMetadata(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 Type
    Method
    Description
    Returns the value of the date record component.
    boolean
    Returns the value of the disabled record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the partName record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DateMetadata

      public DateMetadata(LocalDate date, boolean disabled, String partName)
      Creates new metadata for the given date.
      Parameters:
      date - the date the metadata applies to, not null
      disabled - whether the date cannot be selected
      partName - custom CSS part names for the date, or null for none
    • DateMetadata

      public DateMetadata(LocalDate date, boolean disabled)
      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, not null
      disabled - whether the date cannot be selected
    • DateMetadata

      public DateMetadata(LocalDate date, String partName)
      Creates new metadata that only adds custom part names to the date, leaving it selectable.
      Parameters:
      date - the date the metadata applies to, not null
      partName - custom CSS part names for the date, or null for none
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • date

      public LocalDate date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • disabled

      public boolean disabled()
      Returns the value of the disabled record component.
      Returns:
      the value of the disabled record component
    • partName

      public String partName()
      Returns the value of the partName record component.
      Returns:
      the value of the partName record component