zaber.motion.exceptions.DeviceAddressConflictExceptionData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of motion-library Show documentation
Show all versions of motion-library Show documentation
A library that aims to provide easy-to-use API for communication with Zaber devices using Zaber ASCII Protocol.
// ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== //
// ============== DO NOT EDIT DIRECTLY ============== //
package zaber.motion.exceptions;
import java.util.Arrays;
import zaber.motion.ArrayUtility;
import zaber.motion.protobufs.Main;
/**
* Contains additional data for DeviceAddressConflictException.
*/
public final class DeviceAddressConflictExceptionData {
private int[] deviceAddresses;
/**
* The full list of detected device addresses.
*/
public void setDeviceAddresses(int[] deviceAddresses) {
this.deviceAddresses = deviceAddresses;
}
/**
* @return The full list of detected device addresses.
*/
public int[] getDeviceAddresses() {
return this.deviceAddresses;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("DeviceAddressConflictExceptionData { ");
sb.append("deviceAddresses: ");
sb.append(Arrays.toString(this.deviceAddresses));
sb.append(" }");
return sb.toString();
}
public static DeviceAddressConflictExceptionData fromProtobuf(Main.DeviceAddressConflictExceptionData pbData) {
DeviceAddressConflictExceptionData obj = new DeviceAddressConflictExceptionData();
obj.setDeviceAddresses(ArrayUtility.toPrimitiveArray(pbData.getDeviceAddressesList().
stream().toArray(Integer[]::new)));
return obj;
}
}