private fun providerToJson(provider: Provider?): SimpleObject? { val jsonForm = SimpleObject() if (provider != null) { jsonForm.add(USER_ID, provider.getUuid()) jsonForm.add(FULL_NAME, provider.getName()) val person: Person = provider.getPerson() if (person != null) { jsonForm.add(GIVEN_NAME, person.getGivenName()) jsonForm.add(FAMILY_NAME, person.getFamilyName()) } } return jsonForm }
Builds a SimpleObject describing the given Provider .