final public static function objectField(
        FieldNameBuilder $fieldBuilder,
        IIdentifiableObjectSet $dataSource,
        callable $objectValidationCallback = null
    ) : FieldBuilderBase
    {
        $field = $fieldBuilder
            ->name(IObjectAction::OBJECT_FIELD_NAME)
            ->label('Object');

        if ($dataSource instanceof IEntitySet) {
            $field = $field->entityFrom($dataSource);
        } elseif ($dataSource instanceof IObjectSetWithIdentityByIndex) {
            $field = $field->objectFromIndex($dataSource);
        } else {
            throw InvalidArgumentException::format(
                'Unknown object data source type: %s', get_class($dataSource)
            );
        }

        $field = $field->required();

        if ($objectValidationCallback) {
            $field->assert($objectValidationCallback, self::INVALID_OBJECT_MESSAGE);
        }

        return $field;
    }