func NewCBMFromString(stateStr string) (*CBM, error) {
	state, ok := _CBMParsingStateMap[stateStr]
	if !ok {
		return nil, fmt.Errorf("state unknown for CBM: %s", stateStr)
	}
	return &CBM{state: state}, nil
}
NewCBMFromString can be used to deserialize  machine state
package examples
import "fmt"
type CBMState int
const (
	_          CBMState = iota
	Closed               
	Exit                 
	HalfOpened           
	Opened               
)
var _CBMStateMap = map[CBMState]string{
	Closed:     "Closed",
	Exit:       "Exit",
	HalfOpened: "HalfOpened",
	Opened:     "Opened",
}
var _CBMParsingStateMap = map[string]CBMState{
	"Closed":     Closed,
	"Exit":       Exit,
	"HalfOpened": HalfOpened,
	"Opened":     Opened,
}
func (s CBMState) String() string {
	return _CBMStateMap[s]
}
type CBMBehaviour interface {
	CBMClosedState
	CBMHalfOpenedState
	CBMOpenedState
}
type CBM struct {
	state CBMState
}
func NewCBM(state CBMState) *CBM {
	return &CBM{state: state}
}