kenta-shimizu / secs4java8

This library is SEMI-SECS-communicate implementation on Java8.
Apache License 2.0
109 stars 54 forks source link

about build Secs2 Message quesion #7

Closed skay0424 closed 2 years ago

skay0424 commented 2 years ago

eg : Secs2.list( Secs2.uint2(portListRptId), //DATAID Secs2.uint4(eventId), Secs2.list( //L:a Secs2.list( //L:2 Secs2.uint4(portListRptId), //rptId Secs2.list( //L:b / V / Secs2.ascii(agvCode), // agvCode Secs2.list( Secs2.ascii(ports.get(0)), //port1 Secs2.ascii(ports.get(1)) // port2 ) ) ) )

        );

the params port1 and port2 is List, it maybe one or more ,how do i build him, does it support foreach

kenta-shimizu commented 2 years ago

Hi, interface Secs2 has static #list(List<? extends Secs2> values);

/ build Port List from String to Secs2 example /
List<String> ports = Arrays.asList("P1", "P2"); List<Secs2> ss = ports.stream().map(Secs2::ascii).collect(Collectors.toList()); Secs2 portList = Secs2.list(ss);

skay0424 commented 2 years ago

Hi, interface Secs2 has static #list(List<? extends Secs2> values);

/ build Port List from String to Secs2 example / List ports = Arrays.asList("P1", "P2"); List ss = ports.stream().map(Secs2::ascii).collect(Collectors.toList()); Secs2 portList = Secs2.list(ss);

Thanks very much