Package com.jk.core.jpa
Class JKBaseModel
java.lang.Object
com.jk.core.jpa.JKBaseModel
- All Implemented Interfaces:
 Serializable
This class represents a base model class for MongoDB documents.
 
This class provides a foundation for entities with common properties.
- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 - See Also:
 
- 
Constructor Summary
ConstructorsConstructorDescriptionThis method constructs a newJKBaseModelwith default properties.JKBaseModel(String uid) This method constructs a newJKBaseModelwith the provided unique identifier (UID). - 
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.Gets the name slug.static voidThis main method prints this entity unique identifier (UID) in the console.voidresetUid()This method resets the unique identifier to thisJKBaseModel.toString()Returns a string representation of the object.<T> TThis method sets the entity name to the specified name then return thisJKBaseModelobject. 
- 
Constructor Details
- 
JKBaseModel
public JKBaseModel()This method constructs a newJKBaseModelwith default properties. - 
JKBaseModel
This method constructs a newJKBaseModelwith the provided unique identifier (UID).- Parameters:
 uid- Specifies the unique identifier (UID).
 
 - 
 - 
Method Details
- 
getNameSlug
Gets the name slug.- Returns:
 - the name slug
 
 - 
equals
Indicates whether some other object is "equal to" this one.The
equalsmethod implements an equivalence relation on non-null object references:- It is reflexive: for any non-null reference value
 
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
 
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
 
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
 
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value 
x,x.equals(null)should returnfalse. 
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
 - It is reflexive: for any non-null reference value
 
 - 
toString
Returns a string representation of the object. - 
main
This main method prints this entity unique identifier (UID) in the console.- Parameters:
 args- the command line arguments.
 - 
resetUid
public void resetUid()This method resets the unique identifier to thisJKBaseModel.If this entity represents list holder, then it resets the unique identifiers (UIDs), to all the items within it as well.
 - 
withName
This method sets the entity name to the specified name then return thisJKBaseModelobject.- Type Parameters:
 T- Specifies the entity object type.- Parameters:
 name- Specifies the new entity name.- Returns:
 - the entity object with the newly changed name.
 
 
 -