class UserSerialization extends FileRepositorySerializer<User> {

    @Override
    protected String serialize( User user )
    {
        return String.join( userSeparator,
                user.name(),
                // Only used by FileRepository (InternalFlatFileRealm) so we can assume LegacyCredential here
                serialize( (LegacyCredential) user.credentials() ),
                String.join( ",", user.getFlags() )
            );
    }

}