use of org.apache.plc4x.java.api.value.PlcValue in project plc4x by apache.
the class DefaultPlcReadResponse method getAllDoubles.
@Override
@JsonIgnore
public Collection<Double> getAllDoubles(String name) {
PlcValue fieldInternal = getFieldInternal(name);
if (fieldInternal instanceof PlcList) {
PlcList plcList = (PlcList) fieldInternal;
List<Double> items = new ArrayList<>(plcList.getLength());
for (PlcValue plcValue : plcList.getList()) {
items.add(plcValue.getDouble());
}
return items;
}
return Collections.singletonList(fieldInternal.getDouble());
}
use of org.apache.plc4x.java.api.value.PlcValue in project plc4x by apache.
the class DefaultPlcReadResponse method getAllBigIntegers.
@Override
@JsonIgnore
public Collection<BigInteger> getAllBigIntegers(String name) {
PlcValue fieldInternal = getFieldInternal(name);
if (fieldInternal instanceof PlcList) {
PlcList plcList = (PlcList) fieldInternal;
List<BigInteger> items = new ArrayList<>(plcList.getLength());
for (PlcValue plcValue : plcList.getList()) {
items.add(plcValue.getBigInteger());
}
return items;
}
return Collections.singletonList(fieldInternal.getBigInteger());
}
use of org.apache.plc4x.java.api.value.PlcValue in project plc4x by apache.
the class DefaultPlcReadResponse method getAllLongs.
@Override
@JsonIgnore
public Collection<Long> getAllLongs(String name) {
PlcValue fieldInternal = getFieldInternal(name);
if (fieldInternal instanceof PlcList) {
PlcList plcList = (PlcList) fieldInternal;
List<Long> items = new ArrayList<>(plcList.getLength());
for (PlcValue plcValue : plcList.getList()) {
items.add(plcValue.getLong());
}
return items;
}
return Collections.singletonList(fieldInternal.getLong());
}
use of org.apache.plc4x.java.api.value.PlcValue in project plc4x by apache.
the class DefaultPlcReadResponse method getAllIntegers.
@Override
@JsonIgnore
public Collection<Integer> getAllIntegers(String name) {
PlcValue fieldInternal = getFieldInternal(name);
if (fieldInternal instanceof PlcList) {
PlcList plcList = (PlcList) fieldInternal;
List<Integer> items = new ArrayList<>(plcList.getLength());
for (PlcValue plcValue : plcList.getList()) {
items.add(plcValue.getInteger());
}
return items;
}
return Collections.singletonList(fieldInternal.getInteger());
}
use of org.apache.plc4x.java.api.value.PlcValue in project plc4x by apache.
the class DefaultPlcReadResponse method getAllShorts.
@Override
@JsonIgnore
public Collection<Short> getAllShorts(String name) {
PlcValue fieldInternal = getFieldInternal(name);
if (fieldInternal instanceof PlcList) {
PlcList plcList = (PlcList) fieldInternal;
List<Short> items = new ArrayList<>(plcList.getLength());
for (PlcValue plcValue : plcList.getList()) {
items.add(plcValue.getShort());
}
return items;
}
return Collections.singletonList(fieldInternal.getShort());
}
Aggregations