Package dk.gtz.graphedit.viewmodel
Record Class Tip
java.lang.Object
java.lang.Record
dk.gtz.graphedit.viewmodel.Tip
- Record Components:
category- The category of the tipdescription- The description / message of the tipimageWidth- The width of the image to be shown with the tip, ignored if no image is provided.image- The image to be shown with the tip, optional.
public record Tip(String category, String description, Integer imageWidth, Optional<String> image)
extends Record
Represents a tip that can be shown to the user.
Note, not to be confused with a
Tooltip, this represents a tip object for the TipOfTheDayController view.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new tip with the given category and description.Creates a new tip with the given category, description and image.Creates an instance of aTiprecord class.Creates a new tip with the given category, description and image. -
Method Summary
Modifier and TypeMethodDescriptioncategory()Returns the value of thecategoryrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.Returns the value of theimageWidthrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Tip
Creates a new tip with the given category and description.- Parameters:
category- The category of the tipdescription- The description / message of the tip
-
Tip
Creates a new tip with the given category, description and image.- Parameters:
category- The category of the tipdescription- The description / message of the tipimage- The image to be shown with the tip
-
Tip
Creates a new tip with the given category, description and image.- Parameters:
category- The category of the tipdescription- The description / message of the tipimageWidth- The width of the image to be shown with the tipimage- The image to be shown with the tip
-
Tip
Creates an instance of aTiprecord class.- Parameters:
category- the value for thecategoryrecord componentdescription- the value for thedescriptionrecord componentimageWidth- the value for theimageWidthrecord componentimage- the value for theimagerecord 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). -
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
imageWidth
Returns the value of theimageWidthrecord component.- Returns:
- the value of the
imageWidthrecord component
-
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-