func (j *JSON) MaybeBool() (bool, error) {
	if b, ok := (j.root).(bool); ok {
		return b, nil
	}
	return false, errors.New("type assertion to bool failed")
}
MaybeBool type asserts and parses an `bool`
package ujson
import (
	"errors"
	"log"
)
type JSON struct {
	root interface{}
}
func NewFromBytes(data []byte) (*JSON, error) {
	if len(data) < 2 {  
		return nil, errors.New("no data passed in")
	}
	j := &JSON{}
	dec := NewDecoder(simpleStore{}, data)
	root, err := dec.Decode()
	if err != nil {
		return nil, err
	}
	j.root = root
	return j, nil
}
func (j *JSON) Interface() interface{} {
	return j.root
}
func (j *JSON) Get(key string) *JSON {
	m, err := j.MaybeMap()
	if err == nil {
		if val, ok := m[key]; ok {
			return &JSON{val}
		}
	}
	return &JSON{nil}
}
func (j *JSON) Map(args ...map[string]interface{}) map[string]interface{} {
	var def map[string]interface{}
	switch len(args) {
	case 0:
	case 1:
		def = args[0]
	default:
		log.Panicf("Map() received too many arguments %d", len(args))
	}
	a, err := j.MaybeMap()
	if err == nil {
		return a
	}
	return def
}
func (j *JSON) MaybeMap() (map[string]interface{}, error) {
	if j == nil {
		return nil, errors.New("Cannot MaybeMap on a nil pointer")
	}
	if m, ok := (j.root).(map[string]interface{}); ok {
		return m, nil
	}
	return nil, errors.New("type assertion to map[string]interface{} failed")
}
func (j *JSON) String(args ...string) string {
	var def string
	switch len(args) {
	case 0:
	case 1:
		def = args[0]
	default:
		log.Panicf("String() received too many arguments %d", len(args))
	}
	s, err := j.MaybeString()
	if err == nil {
		return s
	}
	return def
}
func (j *JSON) MaybeString() (string, error) {
	if s, ok := (j.root).(string); ok {
		return s, nil
	}
	return "", errors.New("type assertion to string failed")
}
func (j *JSON) Int64(args ...int64) int64 {
	var def int64
	switch len(args) {
	case 0:
	case 1:
		def = args[0]
	default:
		log.Panicf("Int64() received too many arguments %d", len(args))
	}
	i, err := j.MaybeInt64()
	if err == nil {
		return i
	}
	return def
}
func (j *JSON) MaybeInt64() (int64, error) {
	if n, ok := (j.root).(numeric); ok {
		return n.Int64()
	}
	if n, ok := (j.root).(int); ok {
		return int64(n), nil
	}
	return -1, errors.New("type assertion to numeric failed")
}
func (j *JSON) Float64(args ...float64) float64 {
	var def float64
	switch len(args) {
	case 0:
	case 1:
		def = args[0]
	default:
		log.Panicf("float64() received too many arguments %d", len(args))
	}
	i, err := j.MaybeFloat64()
	if err == nil {
		return i
	}
	return def
}
func (j *JSON) MaybeFloat64() (float64, error) {
	if n, ok := (j.root).(numeric); ok {
		return n.Float64()
	}
	if n, ok := (j.root).(float64); ok {
		return n, nil
	}
	return -1, errors.New("type assertion to numeric failed")
}
func (j *JSON) Bool(args ...bool) bool {
	var def bool
	switch len(args) {
	case 0:
	case 1:
		def = args[0]
	default:
		log.Panicf("bool() received too many arguments %d", len(args))
	}
	b, err := j.MaybeBool()
	if err == nil {
		return b
	}
	return def
}