
// is this stupid or is it fun?
export class StateManagerBuilder {

	constructor(state_manager_constructor, hakuban_exchange, mountpoint, expose, shortener_url, navigation_state_sanitizer, dynamic_pathname) {
		Object.assign(this, { state_manager_constructor, hakuban_exchange, shortener_url, mountpoint, expose, navigation_state_sanitizer, dynamic_pathname })
	}

	with_hakuban_exchange(hakuban_exchange) {
		return new StateManagerBuilder(this.state_manager_constructor, hakuban_exchange, this.mountpoint, this.expose, this.shortener_url, this.navigation_state_sanitizer, this.dynamic_pathname)
	}

	with_mountpoint(mountpoint) {
		return new StateManagerBuilder(this.state_manager_constructor, this.hakuban_exchange, mountpoint, this.expose, this.shortener_url, this.navigation_state_sanitizer, this.dynamic_pathname)
	}

	exposing(expose) {
		return new StateManagerBuilder(this.state_manager_constructor, this.hakuban_exchange, this.mountpoint, expose, this.shortener_url, this.navigation_state_sanitizer, this.dynamic_pathname)
	}

	with_url_shortener(shortener_url) {
		return new StateManagerBuilder(this.state_manager_constructor, this.hakuban_exchange, this.mountpoint, this.expose, shortener_url || true, this.navigation_state_sanitizer, this.dynamic_pathname)
	}

	with_navigation_state_sanitizer(navigation_state_sanitizer) {
		return new StateManagerBuilder(this.state_manager_constructor, this.hakuban_exchange, this.mountpoint, this.expose, this.shortener_url, navigation_state_sanitizer, this.dynamic_pathname)
	}

	with_dynamic_pathname() {
		return new StateManagerBuilder(this.state_manager_constructor, this.hakuban_exchange, this.mountpoint, this.expose, this.shortener_url, this.navigation_state_sanitizer, true)
	}

	with_static_pathname() {
		return new StateManagerBuilder(this.state_manager_constructor, this.hakuban_exchange, this.mountpoint, this.expose, this.shortener_url, this.navigation_state_sanitizer, false)
	}

	run() {
		return new this.state_manager_constructor(this.hakuban_exchange, this.mountpoint, this.expose, this.shortener_url, this.navigation_state_sanitizer, this.dynamic_pathname)
	}

}
