Package net.solarnetwork.central.domain
Class BasePK
java.lang.Object
net.solarnetwork.central.domain.BasePK
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
KeyTypePK,LongIntegerCompositePK,LongStringCompositePK,UserLongCompositePK,UserLongIntegerCompositePK,UserLongStringCompositePK,UserStringCompositePK,UserUuidIntegerCompositePK,UserUuidLongCompositePK,UserUuidPK
Base class for primary key values.
- Since:
- 1.39
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BasePKclone()final StringgetId()Get a computed string ID value for this primary key.protected abstract voidPopulate a string builder with an ID value.protected abstract voidPopulate a string builder with a friendly string value.final StringtoString()Generate a string value.
-
Constructor Details
-
BasePK
public BasePK()
-
-
Method Details
-
populateIdValue
Populate a string builder with an ID value.This method is called from
getId().- Parameters:
buf- the buffer to populate
-
getId
Get a computed string ID value for this primary key.Note this value is derived from the properties of this class, and not assigned by the system. This method calls
populateIdValue(StringBuilder)and then computes a hex-encoded SHA1 value from that as the final ID value.- Returns:
- computed ID string
-
populateStringValue
Populate a string builder with a friendly string value.This method is called from
toString(). The buffer will be initially empty when invoked.- Parameters:
buf- the buffer to populate
-
toString
Generate a string value.This method generates a string like
Class{data}wheredatais generated viapopulateStringValue(StringBuilder). -
clone
-