serialVersionID
(a field) is not declared as a member the Serializable interface. The field name is merely a convention and the field is accessed by reflection at runtime. It is not possible to use interfaces to define a field contract.
The warning is "compiler magic" that knows it should emit a warning when encountering a type implementing Serializable that does not have such a field. This warning behavior cannot be emulated for other fields in application code alone - obtaining a similar warning requires using a [customized] compiler or lint/code-checker that understands the desired heuristics.