Record Class DateRange
java.lang.Object
java.lang.Record
com.vaadin.flow.component.datepicker.DateRange
- Record Components:
start- the first date of the range, notnullend- the last date of the range, notnull
- All Implemented Interfaces:
Serializable
A range of dates, inclusive on both ends. A range of a single date has the
same
start and end.- Since:
- 25.3
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DateRange
Creates a new date range with the given start and end date.- Parameters:
start- the first date of the range, notnullend- the last date of the range, notnull- Throws:
IllegalArgumentException- if start is after end
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-