Class SampleModelObject

java.lang.Object
com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
com.powerupsoftwareengineering.java.immutable.model.sample.SampleModelObject
All Implemented Interfaces:
com.powerupsoftwareengineering.java.immutable.model.ModelObject, Serializable

public final class SampleModelObject extends com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
A SampleModelObject is a sample model object designed to show how to use the Immutable model object functionality. It features use of both build and parameter validators. For parameter validators, it uses the soft length filter. See SampleChildModelObject for an example of the hard length filter.

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 Classes
    Modifier and Type
    Class
    Description
    static final class 
    The 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The max length of the object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Accessor for the name member variable.
    int
    Accessor for the order member variable.
    int
     
     

    Methods inherited from class com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs

    getId

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NAME_MAX_LENGTH

      public static final int NAME_MAX_LENGTH
      The max length of the object.
      See Also:
  • Method Details

    • getName

      public String getName()
      Accessor for the name member variable.
      Returns:
      Current value of the name member variable.
    • getOrder

      public int getOrder()
      Accessor for the order member variable.
      Returns:
      Current value of the order member variable.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs
    • toString

      public String toString()
      Overrides:
      toString in class com.powerupsoftwareengineering.java.immutable.model.ModelObjectAbs