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

zaber.motion.exceptions.StreamMovementFailedExceptionData 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.protobufs.Main;

/**
 * Contains additional data for StreamMovementFailedException.
 */
public final class StreamMovementFailedExceptionData {

    private String[] warnings;

    /**
     * The full list of warnings.
     */
    public void setWarnings(String[] warnings) {
        this.warnings = warnings;
    }

    /**
     * @return The full list of warnings.
     */
    public String[] getWarnings() {
        return this.warnings;
    }

    private String reason;

    /**
     * The reason for the Exception.
     */
    public void setReason(String reason) {
        this.reason = reason;
    }

    /**
     * @return The reason for the Exception.
     */
    public String getReason() {
        return this.reason;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("StreamMovementFailedExceptionData { ");
        sb.append("warnings: ");
        sb.append(Arrays.toString(this.warnings));
        sb.append(", ");
        sb.append("reason: ");
        sb.append(this.reason);
        sb.append(" }");
        return sb.toString();
    }

    public static StreamMovementFailedExceptionData fromProtobuf(Main.StreamMovementFailedExceptionData pbData) {
        StreamMovementFailedExceptionData obj = new StreamMovementFailedExceptionData();
        obj.setWarnings(pbData.getWarningsList().
            stream().toArray(String[]::new));
        obj.setReason(pbData.getReason());
        return obj;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy