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