Package megamek.common.copy
Record Class CrewRefBreak
java.lang.Object
java.lang.Record
megamek.common.copy.CrewRefBreak
-
Constructor Summary
ConstructorsConstructorDescriptionCrewRefBreak(Crew originalCrew) Creates an instance of aCrewRefBreakrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Copy the object, creating a new instance with the same values.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoriginalCrewrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CrewRefBreak
Creates an instance of aCrewRefBreakrecord class.- Parameters:
originalCrew- the value for theoriginalCrewrecord component
-
-
Method Details
-
copy
Description copied from interface:RefBreakCopy the object, creating a new instance with the same values. This is NOT a deep or a perfect copy, it is instead a "serviceable" copy. It allows to create a new instance that has NO references to the previous one, so it can run on a different thread or be modified without affecting the original object. If the object it returns is incomplete for your purposes, you should override this method and complete it or expand the implementation. -
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). -
originalCrew
Returns the value of theoriginalCrewrecord component.- Returns:
- the value of the
originalCrewrecord component
-