Commit 2d0890ed by 王欣伟

支持List数据结构,业务在使用中需要自己控制list的长度

1 parent 98a2aee6
...@@ -7,6 +7,7 @@ import java.math.BigInteger; ...@@ -7,6 +7,7 @@ import java.math.BigInteger;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
...@@ -232,6 +233,14 @@ public class Ocpp16Helper { ...@@ -232,6 +233,14 @@ public class Ocpp16Helper {
byte[] bs = build(v); byte[] bs = build(v);
byteBuf.writeBytes(bs); byteBuf.writeBytes(bs);
} else if (v instanceof List) {
ListIterator listIterator = ((List<?>) v).listIterator();
while(listIterator.hasNext()){
Object iv = listIterator.next();
byte[] bs = build(v);
byteBuf.writeBytes(bs);
}
} }
// log.info("build:{} field:{} value:{} -- {}", d.getClass().getSimpleName(), f.getName(), v, byteBuf.readableBytes()); // log.info("build:{} field:{} value:{} -- {}", d.getClass().getSimpleName(), f.getName(), v, byteBuf.readableBytes());
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!