Package com.jk.data.dataaccess.core
Class JKDbIdValue
java.lang.Object
com.jk.data.dataaccess.core.JKDbIdValue
- All Implemented Interfaces:
Serializable
This class represents a database record with an associated ID and value.
This class is used to store pairs of IDs and values retrieved from the database.
It provides utility methods for creating lists of such pairs and accessing their properties.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Vector<JKDbIdValue>
createList
(int[] ids, Object[] values) This method creates a list ofJKDbIdValue
instances from arrays of IDs and values.static Vector<JKDbIdValue>
createList
(Object[] values) This method creates a list ofJKDbIdValue
instances from an array of values.getId()
This method gets the ID associated with the database record.int
This method gets the ID associated with the database record as integer.getValue()
This method gets the value associated with the database record.void
This method sets the ID associated with the database record.void
This method sets the value associated with the database record.toString()
Returns a string representation of the object.
-
Constructor Details
-
JKDbIdValue
public JKDbIdValue()This method constructs a newJKDbIdValue
.
-
-
Method Details
-
createList
This method creates a list ofJKDbIdValue
instances from arrays of IDs and values.- Parameters:
ids
- Specifies an array of IDs.values
- Specifies an array of values.- Returns:
- the Vector containing
JKDbIdValue
instances.
-
createList
This method creates a list ofJKDbIdValue
instances from an array of values.Automatically assigns incremental IDs starting from 0.
- Parameters:
values
- Specifies an array of values.- Returns:
- the Vector containing
JKDbIdValue
instances with automatically assigned IDs.
-
getId
This method gets the ID associated with the database record.- Returns:
- the ID associated with the database record.
-
getIdAsInteger
public int getIdAsInteger()This method gets the ID associated with the database record as integer.- Returns:
- the ID associated with the database record as integer.
-
getValue
This method gets the value associated with the database record.- Returns:
- the value associated with the database record.
-
setId
This method sets the ID associated with the database record.- Parameters:
id
- Specifies the new ID associated with the database record.
-
setValue
This method sets the value associated with the database record.- Parameters:
value
- Specifies the new value associated with the database record.
-
toString
Returns a string representation of the object.
-