class CredentialCollection:
    def __init__(self, username: str | None = None,
                 password: str | None = None,
                 private_keyfile: str | None = None,
                 public_keyfile: str | None = None,
                 ldap_base: str | None = None,
                 domainname: str | None = None):
        self.username: None | str = username
        self.password: None | str = password
        self.private_keyfile: None | str = private_keyfile
        self.public_keyfile: None | str = public_keyfile
        self.ldap_base: None | str = ldap_base
        self.domainname: None | str = domainname

    def set_username(self, username: str) -> None:
        """Set the username."""
        self.username = username

    def set_password(self, password: str) -> None:
        """Set the password."""
        self.password = password

    def set_private_keyfile(self, private_keyfile: str) -> None:
        """Set the path to the private key file."""
        self.private_keyfile = private_keyfile

    def set_public_keyfile(self, public_keyfile: str) -> None:
        """Set the path to the public key file."""
        self.public_keyfile = public_keyfile

    def set_ldap_base(self, ldap_base: str) -> None:
        """Set the LDAP base path"""
        self.ldap_base = ldap_base

    def set_domainname(self, domainname: str) -> None:
        """Set the domain name"""
        self.domainname = domainname

    def get_username(self) -> str:
        """Return the username.
        Raises:
            ValueError: If username is None.
        """
        if self.username is None:
            raise ValueError("username must be set before calling get_username")
        return self.username

    def get_password(self) -> str:
        """Return the password.
        Raises:
            ValueError: If password is None.
        """
        if self.password is None:
            raise ValueError("password must be set before calling get_password")
        return self.password

    def get_private_keyfile(self) -> str:
        """Return the path to the private key file.
        Raises:
            ValueError: If private_keyfile is None.
        """
        if self.private_keyfile is None:
            raise ValueError("private_keyfile must be set before calling get_private_keyfile")
        return self.private_keyfile

    def get_public_keyfile(self) -> str:
        """Return the path to the public key file.
        Raises:
            ValueError: If public_keyfile is None.
        """
        if self.public_keyfile is None:
            raise ValueError("public_keyfile must be set before calling get_public_keyfile")
        return self.public_keyfile

    def get_ldap_base(self) -> str:
        """Return the LDAP base
        Raises:
            ValueError: If LDAP base is None
        """
        if self.ldap_base is None:
            raise ValueError("ldap_base must be set before calling get_ldap_base")
        return self.ldap_base

    def get_domainname(self) -> str:
        """Return the domain name
        Raises:
            ValueError: If domain name base is None
        """
        if self.domainname is None:
            raise ValueError("domainname must be set before calling get_domainname")
        return self.domainname