Skip to content

Commit 27d709c

Browse files
committed
Rename methods for future improvements.
1 parent 0dedaed commit 27d709c

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

src/fbjava-impl/src/main/java/org/firebirdsql/fbjava/impl/ValuesImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class ValuesImpl implements Values
4040
}
4141

4242
@Override
43-
public Object get(int index)
43+
public Object getObject(int index)
4444
{
4545
//// TODO: read only values
4646

@@ -57,9 +57,9 @@ public Object get(int index)
5757
}
5858

5959
@Override
60-
public Object set(int index, Object value)
60+
public Object setObject(int index, Object value)
6161
{
62-
Object oldValue = get(index);
62+
Object oldValue = getObject(index);
6363

6464
if (outCount == -1)
6565
{

src/fbjava-tests/src/main/java/example/Functions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static String getValues(ValuesMetadata valuesMetadata, Values values) throws SQL
319319
if (i != 1)
320320
sb.append(", ");
321321

322-
sb.append(values.get(i));
322+
sb.append(values.getObject(i));
323323
}
324324

325325
return sb.toString();

src/fbjava-tests/src/main/java/example/Procedures.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,36 +139,37 @@ public static void p11(Object i1, Object i2, String[] o1) throws SQLException
139139
Values input = context.getInputValues();
140140
Values output = context.getOutputValues();
141141

142-
if (o1[0] != output.get(1))
142+
if (o1[0] != output.getObject(1))
143143
throw new RuntimeException("Error");
144144

145145
o1[0] = "a";
146146

147-
if (o1[0] != output.get(1))
147+
if (o1[0] != output.getObject(1))
148148
throw new RuntimeException("Error");
149149

150-
output.set(1, "b");
150+
output.setObject(1, "b");
151151

152-
if (o1[0] != output.get(1))
152+
if (o1[0] != output.getObject(1))
153153
throw new RuntimeException("Error");
154154

155-
output.set(1, Functions.getValues(inputMetadata, input) + " / " + Functions.getValues(outputMetadata, output));
155+
output.setObject(1,
156+
Functions.getValues(inputMetadata, input) + " / " + Functions.getValues(outputMetadata, output));
156157
}
157158

158159
public static ExternalResultSet p12()
159160
{
160161
ProcedureContext context = ProcedureContext.get();
161162
Values outValues = context.getOutputValues();
162163

163-
BigDecimal i = (BigDecimal) context.getInputValues().get(1);
164-
outValues.set(1, i);
164+
BigDecimal i = (BigDecimal) context.getInputValues().getObject(1);
165+
outValues.setObject(1, i);
165166

166167
return new ExternalResultSet() {
167168
@Override
168169
public boolean fetch() throws Exception
169170
{
170-
BigDecimal o = ((BigDecimal) outValues.get(1)).add(BigDecimal.ONE);
171-
outValues.set(1, o);
171+
BigDecimal o = ((BigDecimal) outValues.getObject(1)).add(BigDecimal.ONE);
172+
outValues.setObject(1, o);
172173
return o.subtract(i).intValue() <= 5;
173174
}
174175
};

src/fbjava-tests/src/main/java/example/Triggers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public static void trigger1() throws SQLException
4545
for (int i = 1; i <= count; ++i)
4646
{
4747
System.out.println(">>> " + i + ", " + fieldsMetadata.getName(i) + ", " +
48-
(oldValues == null ? null : oldValues.get(i)) + ", " +
49-
(newValues == null ? null : newValues.get(i)));
48+
(oldValues == null ? null : oldValues.getObject(i)) + ", " +
49+
(newValues == null ? null : newValues.getObject(i)));
5050

5151
/***
5252
if (newValues != null)

src/fbjava/src/main/java/org/firebirdsql/fbjava/Values.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public interface Values
3030
* Gets the value for a given index.
3131
* Index starts from 1.
3232
*/
33-
public Object get(int index);
33+
public Object getObject(int index);
3434

3535
/**
3636
* Sets the value for a given index.
3737
* Index starts from 1.
3838
*/
39-
public Object set(int index, Object value);
39+
public Object setObject(int index, Object value);
4040
}

0 commit comments

Comments
 (0)