All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zaber.motion.exceptions.DeviceAddressConflictExceptionData Maven / Gradle / Ivy

Go to download

A library that aims to provide easy-to-use API for communication with Zaber devices using Zaber ASCII Protocol.

There is a newer version: 6.7.0
Show newest version
// ===== 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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy