func (b *BoolRule) Maximum() ctypes.ConfigValue {
	return nil
}
Maximum returns Maximum possible value of BoolRule
package cpolicy
import (
	"bytes"
	"encoding/gob"
	"encoding/json"
	"github.com/intelsdi-x/snap/core/ctypes"
)
const (
	BoolType = "bool"
)
type BoolRule struct {
	rule
	key      string
	required bool
	default_ *bool
}
func NewBoolRule(key string, req bool, opts ...bool) (*BoolRule, error) {
	if key == "" {
		return nil, EmptyKeyError
	}
	b := &BoolRule{
		key:      key,
		required: req,
	}
	if len(opts) != 0 {
		b.default_ = &opts[0]
	}
	return b, nil
}
func (b *BoolRule) Type() string {
	return BoolType
}
func (b *BoolRule) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Key      string             `json:"key"`
		Required bool               `json:"required"`
		Default  ctypes.ConfigValue `json:"default,omitempty"`
		Type     string             `json:"type"`
	}{
		Key:      b.key,
		Required: b.required,
		Default:  b.Default(),
		Type:     BoolType,
	})
}
func (b *BoolRule) GobEncode() ([]byte, error) {
	w := new(bytes.Buffer)
	encoder := gob.NewEncoder(w)
	if err := encoder.Encode(b.key); err != nil {
		return nil, err
	}
	if err := encoder.Encode(b.required); err != nil {
		return nil, err
	}
	if b.default_ == nil {
		encoder.Encode(false)
	} else {
		encoder.Encode(true)
		if err := encoder.Encode(&b.default_); err != nil {
			return nil, err
		}
	}
	return w.Bytes(), nil
}
func (b *BoolRule) GobDecode(buf []byte) error {
	r := bytes.NewBuffer(buf)
	decoder := gob.NewDecoder(r)
	if err := decoder.Decode(&b.key); err != nil {
		return err
	}
	if err := decoder.Decode(&b.required); err != nil {
		return err
	}
	var isDefaultSet bool
	decoder.Decode(&isDefaultSet)
	if isDefaultSet {
		return decoder.Decode(&b.default_)
	}
	return nil
}
func (b *BoolRule) Key() string {
	return b.key
}
func (b *BoolRule) Validate(cv ctypes.ConfigValue) error {
	if cv.Type() != BoolType {
		return wrongType(b.key, cv.Type(), BoolType)
	}
	return nil
}
func (b *BoolRule) Default() ctypes.ConfigValue {
	if b.default_ != nil {
		return ctypes.ConfigValueBool{Value: *b.default_}
	}
	return nil
}
func (b *BoolRule) Required() bool {
	return b.required
}
func (b *BoolRule) Minimum() ctypes.ConfigValue {
	return nil
}