Skip to content

Commit 66d734b

Browse files
committed
Added copy/consume constructor for JdbcRow.
1 parent 8dad602 commit 66d734b

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version '3.0.0'
33

44
apply plugin: 'java'
55

6-
sourceCompatibility = 1.8
6+
sourceCompatibility = JavaVersion.VERSION_1_8
77

88
task makeJar(type: Jar) {
99
manifest {
@@ -58,12 +58,12 @@ tasks.withType(Javadoc) {
5858
}
5959

6060
task sourcesJar(type: Jar, dependsOn: classes) {
61-
archiveClassifier = 'sources'
61+
archiveFileName = project.name + '-' + version + '-sources.jar'
6262
from sourceSets.main.allSource
6363
}
6464

6565
task javadocJar(type: Jar, dependsOn: javadoc) {
66-
archiveClassifier = 'javadoc'
66+
archiveFileName = project.name + '-' + version + '-javadoc.jar'
6767
from javadoc.destinationDir
6868
}
6969

src/main/java/com/softwareverde/database/row/JdbcRow.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,21 @@ public class JdbcRow implements Row {
2525
CHARSET = charset;
2626
}
2727

28-
protected final List<String> _orderedColumnNames = new ArrayList<String>();
29-
protected final Map<String, TypedParameter> _columnValues = new HashMap<String, TypedParameter>();
28+
protected final List<String> _orderedColumnNames;
29+
protected final Map<String, TypedParameter> _columnValues;
3030

31-
protected JdbcRow() { }
31+
protected JdbcRow() {
32+
_orderedColumnNames = new ArrayList<String>();
33+
_columnValues = new HashMap<String, TypedParameter>();
34+
}
35+
36+
/**
37+
* Consumes the internal values of the provided jdbcRow.
38+
*/
39+
protected JdbcRow(final JdbcRow jdbcRow) {
40+
_orderedColumnNames = jdbcRow._orderedColumnNames;
41+
_columnValues = jdbcRow._columnValues;
42+
}
3243

3344
protected TypedParameter _getValue(final String columnName) throws IllegalArgumentException {
3445
final String lowerCaseColumnName = columnName.toLowerCase();

0 commit comments

Comments
 (0)