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 aTip
record class.Creates a new tip with the given category, description and image. -
Method Summary
Modifier and TypeMethodDescriptioncategory()
Returns the value of thecategory
record component.Returns the value of thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.image()
Returns the value of theimage
record component.Returns the value of theimageWidth
record component.final String
toString()
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 aTip
record class.- Parameters:
category
- the value for thecategory
record componentdescription
- the value for thedescription
record componentimageWidth
- the value for theimageWidth
record componentimage
- the value for theimage
record 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 thecategory
record component.- Returns:
- the value of the
category
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
imageWidth
Returns the value of theimageWidth
record component.- Returns:
- the value of the
imageWidth
record component
-
image
Returns the value of theimage
record component.- Returns:
- the value of the
image
record component
-