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

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

/**
 * Contains additional data for the InvalidPacketException.
 */
public final class InvalidPacketExceptionData {

    private String packet;

    /**
     * The invalid packet that caused the exception.
     */
    public void setPacket(String packet) {
        this.packet = packet;
    }

    /**
     * @return The invalid packet that caused the exception.
     */
    public String getPacket() {
        return this.packet;
    }

    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("InvalidPacketExceptionData { ");
        sb.append("packet: ");
        sb.append(this.packet);
        sb.append(", ");
        sb.append("reason: ");
        sb.append(this.reason);
        sb.append(" }");
        return sb.toString();
    }

    public static InvalidPacketExceptionData fromProtobuf(Main.InvalidPacketExceptionData pbData) {
        InvalidPacketExceptionData obj = new InvalidPacketExceptionData();
        obj.setPacket(pbData.getPacket());
        obj.setReason(pbData.getReason());
        return obj;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy