[wpiutil] Add serializable marker interfaces (#6060)

This commit is contained in:
Peter Johnson
2023-12-23 08:20:26 -08:00
committed by GitHub
parent c1178d5add
commit aeb1a4aa33
27 changed files with 149 additions and 25 deletions

View File

@@ -0,0 +1,8 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.util;
/** Marker interface to indicate a class is serializable using WPI serialization methods. */
public interface WPISerializable<T> {}

View File

@@ -0,0 +1,15 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.util.protobuf;
import edu.wpi.first.util.WPISerializable;
/**
* Marker interface to indicate a class is serializable using Protobuf serialization.
*
* <p>While this cannot be enforced by the interface, any class implementing this interface should
* provide a public final static `proto` member variable.
*/
public interface ProtobufSerializable<T> extends WPISerializable<T> {}

View File

@@ -0,0 +1,15 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.util.struct;
import edu.wpi.first.util.WPISerializable;
/**
* Marker interface to indicate a class is serializable using Struct serialization.
*
* <p>While this cannot be enforced by the interface, any class implementing this interface should
* provide a public final static `struct` member variable.
*/
public interface StructSerializable<T> extends WPISerializable<T> {}