Class SampleParentModelObject
java.lang.Object
com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
com.powerupsoftwareengineering.java.immutable.model.sample.SampleParentModelObject
- All Implemented Interfaces:
com.powerupsoftwareengineering.java.immutable.model.ModelObject, Serializable
- Direct Known Subclasses:
SampleChildModelObject
public abstract class SampleParentModelObject
extends com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
A
SampleParentModelObject is a sample of a parent object that implements the immutable object pattern.
This object is immutable. To modify use the object's builder class. You can use the @{link Builder#copyValues} method to initialize the builder to the original values.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe builder class provides the ability to populate all the values of a model object, validate if the model object content, and provide an immutable version of the model object. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe max length of the object's name. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBase constructor that will populate theSampleParentModelObjectwith the values from the provided builder. -
Method Summary
Methods inherited from class com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
getId
-
Field Details
-
NAME_MAX_LENGTH
public static final int NAME_MAX_LENGTHThe max length of the object's name.- See Also:
-
-
Constructor Details
-
SampleParentModelObject
Base constructor that will populate theSampleParentModelObjectwith the values from the provided builder. This method is protected to ensure that child classes can extend this class, but should not be called to instantiate the class.- Parameters:
builder- Fully populated builder that has been validated.
-
-
Method Details
-
getName
Accessor for thenamemember variable.- Returns:
- Current value of the
namemember variable.
-
equals
- Overrides:
equalsin classcom.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
-
toString
- Overrides:
toStringin classcom.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
-