Package com.dua3.utility.application
Record Class LicenseData
java.lang.Object
java.lang.Record
com.dua3.utility.application.LicenseData
- Record Components:
licensee- the Name of the licenseevalidUntil- the last date of the license periodlicenseId- the license IDlicenseText- the license text
public record LicenseData(String licensee, LocalDate validUntil, String licenseId, Optional<Supplier<CharSequence>> licenseText)
extends Record
A simple recored of license data for a software.
-
Constructor Summary
ConstructorsConstructorDescriptionLicenseData(String licensee, LocalDate validUntil, String licenseId, Optional<Supplier<CharSequence>> licenseText) Creates an instance of aLicenseDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.licensee()Returns the value of thelicenseerecord component.Returns the value of thelicenseIdrecord component.Returns the value of thelicenseTextrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalidUntilrecord component.
-
Constructor Details
-
LicenseData
public LicenseData(String licensee, LocalDate validUntil, String licenseId, Optional<Supplier<CharSequence>> licenseText) Creates an instance of aLicenseDatarecord class.- Parameters:
licensee- the value for thelicenseerecord componentvalidUntil- the value for thevalidUntilrecord componentlicenseId- the value for thelicenseIdrecord componentlicenseText- the value for thelicenseTextrecord component
-
-
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). -
licensee
Returns the value of thelicenseerecord component.- Returns:
- the value of the
licenseerecord component
-
validUntil
Returns the value of thevalidUntilrecord component.- Returns:
- the value of the
validUntilrecord component
-
licenseId
Returns the value of thelicenseIdrecord component.- Returns:
- the value of the
licenseIdrecord component
-
licenseText
Returns the value of thelicenseTextrecord component.- Returns:
- the value of the
licenseTextrecord component
-