Since I'm working with a framework that uses the Serializable interface in like every class, I want to make sure that the annotation interfaces in the project I'm working for are serializable as well. However, I can't neither implement nor extend Serializable in any @interface java file. This is why I'm wondering if these files are serializable by default (like enums for example) and if not, if there is a way to implement it in these files. (Even if it isn't an elegant way to code. Just want to know if it's possible in the first place). It's hard to find out where the NotSerializableExceptions come from, since the project has many fields that are not serializable (Lamdas etc.)
The Annotations are mostly structured like this in my case:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface RandomAnnotation {
//random code
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface RandomA {
// no value
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface RandomB {
// no value
}
}