A few methods, like this one, should be static and could also be moved to a `ConstraintSerialization` helper class.