class MetadataCommandDescriptionProvider implements CommandDescriptionProvider {

    @Override
    public @Nullable CommandDescription getCommandDescription(String itemName, @Nullable Locale locale) {
        Metadata metadata = metadataRegistry.get(new MetadataKey(COMMANDDESCRIPTION_METADATA_NAMESPACE, itemName));

        if (metadata != null) {
            try {
                CommandDescriptionImpl commandDescription = new CommandDescriptionImpl();
                if (metadata.getConfiguration().containsKey("options")) {
                    Stream.of(metadata.getConfiguration().get("options").toString().split(",")).forEach(o -> {
                        if (o.contains("=")) {
                            commandDescription.addCommandOption(
                                    new CommandOption(o.split("=")[0].trim(), o.split("=")[1].trim()));
                        } else {
                            commandDescription.addCommandOption(new CommandOption(o.trim(), null));
                        }
                    });

                    return commandDescription;
                }
            } catch (Exception e) {
                logger.warn("Unable to parse the commandDescription from metadata for item {}, ignoring it", itemName);
                return null;
            }
        }

        return null;
    }

    @Activate public  MetadataCommandDescriptionProvider(final @Reference MetadataRegistry metadataRegistry,
            Map<String, Object> properties);

}