Package com.github.dkfellows.notabuilder
Record Class ThingRecord
java.lang.Object
java.lang.Record
com.github.dkfellows.notabuilder.ThingRecord
- Record Components:
foo
- The foo field.bar
- The bar field.grill
- The grill field.quux
- The quux field.
A record that has four fields.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionThingRecord
(int foo, int bar, double grill, String quux) Creates an instance of aThingRecord
record class.ThingRecord
(ThingRecord.Args... args) Make an instance of the record. -
Method Summary
Modifier and TypeMethodDescriptionint
bar()
Returns the value of thebar
record component.final boolean
Indicates whether some other object is "equal to" this one.int
foo()
Returns the value of thefoo
record component.double
grill()
Returns the value of thegrill
record component.final int
hashCode()
Returns a hash code value for this object.quux()
Returns the value of thequux
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ThingRecord
Make an instance of the record.- Parameters:
args
- The labelled non-default arguments to pass.- See Also:
-
ThingRecord
Creates an instance of aThingRecord
record class.
-
-
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
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
foo
Returns the value of thefoo
record component.- Returns:
- the value of the
foo
record component
-
bar
Returns the value of thebar
record component.- Returns:
- the value of the
bar
record component
-
grill
Returns the value of thegrill
record component.- Returns:
- the value of the
grill
record component
-
quux
Returns the value of thequux
record component.- Returns:
- the value of the
quux
record component
-