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

zaber.motion.exceptions.MovementInterruptedExceptionData 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 MovementInterruptedException.
 */
public final class MovementInterruptedExceptionData {

    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("MovementInterruptedExceptionData { ");
        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 MovementInterruptedExceptionData fromProtobuf(Main.MovementInterruptedExceptionData pbData) {
        MovementInterruptedExceptionData obj = new MovementInterruptedExceptionData();
        obj.setWarnings(pbData.getWarningsList().
            stream().toArray(String[]::new));
        obj.setReason(pbData.getReason());
        return obj;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy