@@ -81,29 +81,7 @@ public TransferPair getTransferPair(
8181
8282 @ Override
8383 public TransferPair makeTransferPair (ValueVector target ) {
84- JsonVector to = (JsonVector ) target ;
85- TransferPair storagePair = getUnderlyingVector ().makeTransferPair (to .getUnderlyingVector ());
86- return new TransferPair () {
87- @ Override
88- public void transfer () {
89- storagePair .transfer ();
90- }
91-
92- @ Override
93- public void splitAndTransfer (int startIndex , int length ) {
94- storagePair .splitAndTransfer (startIndex , length );
95- }
96-
97- @ Override
98- public JsonVector getTo () {
99- return to ;
100- }
101-
102- @ Override
103- public void copyValueSafe (int fromIndex , int toIndex ) {
104- storagePair .copyValueSafe (fromIndex , toIndex );
105- }
106- };
84+ return new TransferImpl ((JsonVector ) target );
10785 }
10886
10987 @ Override
@@ -115,4 +93,34 @@ public int hashCode(int index) {
11593 public int hashCode (int index , ArrowBufHasher hasher ) {
11694 return getUnderlyingVector ().hashCode (index , hasher );
11795 }
96+
97+ private class TransferImpl implements TransferPair {
98+ private final JsonVector to ;
99+ private final TransferPair storagePair ;
100+
101+ TransferImpl (JsonVector to ) {
102+ this .to = to ;
103+ this .storagePair = getUnderlyingVector ().makeTransferPair (to .getUnderlyingVector ());
104+ }
105+
106+ @ Override
107+ public void transfer () {
108+ storagePair .transfer ();
109+ }
110+
111+ @ Override
112+ public void splitAndTransfer (int startIndex , int length ) {
113+ storagePair .splitAndTransfer (startIndex , length );
114+ }
115+
116+ @ Override
117+ public JsonVector getTo () {
118+ return to ;
119+ }
120+
121+ @ Override
122+ public void copyValueSafe (int fromIndex , int toIndex ) {
123+ storagePair .copyValueSafe (fromIndex , toIndex );
124+ }
125+ }
118126}
0 commit comments