/**
  * Get the public fields with the default values applied to them.
  *
  * @param array $field_definitions
  *   The field definitions to process.
  *
  * @throws \Drupal\restful\Exception\ServerConfigurationException
  *   For resources without ID field.
  *
  * @return array
  *   The field definition array.
  */
 protected function processPublicFields(array $field_definitions)
 {
     // The fields that only contain a property need to be set to be
     // ResourceFieldEntity. Otherwise they will be considered regular
     // ResourceField.
     return array_map(function ($field_definition) {
         $field_entity_class = '\\Drupal\\restful\\Plugin\\resource\\Field\\ResourceFieldEntity';
         $class_name = ResourceFieldEntity::fieldClassName($field_definition);
         if (!$class_name || is_subclass_of($class_name, $field_entity_class)) {
             $class_name = $field_entity_class;
         }
         return $field_definition + array('class' => $class_name, 'entityType' => $this->getEntityType());
     }, $field_definitions);
 }