2024-10-09 22:21:57 +03:00
|
|
|
package _VisualDVM.Repository.Server;
|
2024-10-07 14:22:52 +03:00
|
|
|
import Common.Utils.CommonUtils;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
public class ServerExchangeUnit_2021 implements Serializable {
|
|
|
|
|
public String codeName;
|
|
|
|
|
public String arg;
|
|
|
|
|
public Serializable object;
|
|
|
|
|
//--------
|
|
|
|
|
public ServerExchangeUnit_2021(ServerCode code_in, String arg_in, Serializable object_in) {
|
|
|
|
|
codeName = code_in.toString();
|
|
|
|
|
arg = arg_in;
|
|
|
|
|
object = object_in;
|
|
|
|
|
}
|
|
|
|
|
public ServerExchangeUnit_2021(ServerCode code_in, String arg_in) {
|
|
|
|
|
codeName = code_in.toString();
|
|
|
|
|
arg = arg_in;
|
|
|
|
|
object = null;
|
|
|
|
|
}
|
|
|
|
|
public ServerExchangeUnit_2021(ServerCode code_in) {
|
|
|
|
|
codeName = code_in.toString();
|
|
|
|
|
arg = null;
|
|
|
|
|
object = null;
|
|
|
|
|
}
|
|
|
|
|
//--------
|
|
|
|
|
public ServerCode getCode() throws Exception {
|
|
|
|
|
return ServerCode.valueOf(codeName);
|
|
|
|
|
}
|
|
|
|
|
//--------
|
|
|
|
|
public void Unpack() throws Exception {
|
2024-10-07 22:04:09 +03:00
|
|
|
CommonUtils.bytesToFile((byte[]) object, new File(arg));
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
public void Unpack(File file) throws Exception {
|
2024-10-07 22:04:09 +03:00
|
|
|
CommonUtils.bytesToFile((byte[]) object, file);
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
public void Print() {
|
2024-10-07 14:22:52 +03:00
|
|
|
System.out.println("codeName=" + CommonUtils.Brackets(codeName));
|
2023-09-17 22:13:42 +03:00
|
|
|
System.out.println(arg);
|
|
|
|
|
}
|
|
|
|
|
}
|