from __future__ import annotations

from clarabot_nano.common.config.extract.base import AbstractExtractedConfig


class SolrExtractedConfig(AbstractExtractedConfig):
    def __init__(self, config):
        self.solr_port = config["state"].get("solr_port")
        self.solr_key = config["state"].get("solr_key")
        self.solr_core = config["state"].get("solr_core")

    def _matches(self, other: SolrExtractedConfig) -> bool:
        return (
            self.solr_port == other.solr_port and self.solr_key == other.solr_key and self.solr_core == other.solr_core
        )
