File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,22 @@ public void setColName (final List<String> colNames) {
120120 }
121121 }
122122
123- }
123+ /**
124+ * replace a specific colName.
125+ * @param originalColName
126+ * @param newColName
127+ */
128+ public void replaceColName (String originalColName , String newColName ) {
129+ if (Utils .isEmpty (originalColName ))
130+ throw new RuntimeException ("colName cannot be null." );
131+
132+ if (this .colNames .contains (originalColName )) {
133+ int index = colNames .indexOf (originalColName );
134+ colNames .set (index , newColName );
135+ } else {
136+ throw new RuntimeException ("colName '" + originalColName +"' does not exist in table." );
137+ }
138+ }
124139
125140 public void setColumns (final List <Vector > cols ) {
126141 columns .clear ();
You can’t perform that action at this time.
0 commit comments