// IsValidValue returns an error if the input value is not an integer.
551763
func (n *NullInt) IsValidValue(val string) error {
	_, err := strconv.Atoi(val)
	return err
}
468921
func (c *timeSeriesConfCache) IsValid() bool {
	return c.TimeSeriesConfs != nil && time.Since(c.Generated) < c.TTL
}
1104323
func (p Path) IsValid() bool {
	if len(p.Path) < 1 {
		return false
	}

	for _, n := range p.Path {
		if !n.IsValid() {
			return false
		}
	}

	return true
}
1179482
func (o ObjectPath) IsValid() bool {
	s := string(o)
	if len(s) == 0 {
		return false
	}
	if s[0] != '/' {
		return false
	}
	if s[len(s)-1] == '/' && len(s) != 1 {
		return false
	}
	// probably not used, but technically possible
	if s == "/" {
		return true
	}
	split := strings.Split(s[1:], "/")
	for _, v := range split {
		if len(v) == 0 {
			return false
		}
		for _, c := range v {
			if !isMemberChar(c) {
				return false
			}
		}
	}
	return true
}
115134
func (f *UUIDFuncs) IsValid(in interface{}) (bool, error) {
	_, err := f.Parse(in)
	return err == nil, nil
}
1294983
func (v *StringIsPresent) IsValid(errors *validate.Errors) {
	if strings.TrimSpace(v.Field) != "" {
		return
	}

	if len(v.Message) > 0 {
		errors.Add(GenerateKey(v.Name), v.Message)
		return
	}

	errors.Add(GenerateKey(v.Name), fmt.Sprintf("%s can not be blank.", v.Name))
}
977294
func (ls *LocalStore) isValid(chunk Chunk) bool {
	// by default chunks are valid. if we have 0 validators, then all chunks are valid.
	valid := true

	// ls.Validators contains a list of one validator per chunk type.
	// if one validator succeeds, then the chunk is valid
	for _, v := range ls.Validators {
		if valid = v.Validate(chunk); valid {
			break
		}
	}
	return valid
}
601355
func (idx *Index) IsInvalid(collPseudo bool) bool {
	return (collPseudo && idx.NotAccurate()) || idx.TotalRowCount() == 0
}
39989
func (m gwMetaV1) IsValid() bool {
	return ((m.Version == gwMetaVersion || m.Version == gwMetaVersion100) &&
		m.Format == gwMetaFormat)
}
808182
func IsValueValidAgainstRange(val interface{}, typeName, format, prefix, path string) error {
	kind := reflect.ValueOf(val).Type().Kind()

	// What is the string representation of val
	stringRep := ""
	switch kind {
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		stringRep = swag.FormatUint64(valueHelp.asUint64(val))
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		stringRep = swag.FormatInt64(valueHelp.asInt64(val))
	case reflect.Float32, reflect.Float64:
		stringRep = swag.FormatFloat64(valueHelp.asFloat64(val))
	default:
		return fmt.Errorf("%s value number range checking called with invalid (non numeric) val type in %s", prefix, path)
	}

	var errVal error

	switch typeName {
	case "integer":
		switch format {
		case "int32":
			_, errVal = swag.ConvertInt32(stringRep)
		case "uint32":
			_, errVal = swag.ConvertUint32(stringRep)
		case "uint64":
			_, errVal = swag.ConvertUint64(stringRep)
		case "int64":
			fallthrough
		default:
			_, errVal = swag.ConvertInt64(stringRep)
		}
	case "number":
		fallthrough
	default:
		switch format {
		case "float", "float32":
			_, errVal = swag.ConvertFloat32(stringRep)
		case "double", "float64":
			fallthrough
		default:
			// No check can be performed here since
			// no number beyond float64 is supported
		}
	}
	if errVal != nil { // We don't report the actual errVal from strconv
		if format != "" {
			errVal = fmt.Errorf("%s value must be of type %s with format %s in %s", prefix, typeName, format, path)
		} else {
			errVal = fmt.Errorf("%s value must be of type %s (default format) in %s", prefix, typeName, path)
		}
	}
	return errVal
}
529918
func (m mapRule) IsValid(value string) bool {
	_, ok := m[value]
	return ok
}
785565
func isValue(raw interface{}) (interface{}, bool) {
	if raw == nil {
		return raw, true
	}
	_, ook := isObject(raw)
	_, aok := isArray(raw)
	if ook || aok {
		return nil, false
	}
	return raw, true
}
872837
func (p *point) BooleanValue() (bool, error) {
	b, err := parseBoolBytes(p.it.valueBuf)
	if err != nil {
		return false, fmt.Errorf("unable to parse bool value %q: %v", p.it.valueBuf, err)
	}
	return b, nil
}
563793
func (d *Decoder) IsValidFile() bool {
	d.ReadInfo()
	if d.err != nil && d.err != io.EOF {
		return false
	}
	if d.NumChans < 1 {
		return false
	}
	if d.BitDepth < 8 {
		return false
	}
	if d, err := d.Duration(); err != nil || d <= 0 {
		return false
	}

	return true
}
113280
func (c Color) IsValid() bool {
	return 0.0 <= c.R && c.R <= 1.0 &&
		0.0 <= c.G && c.G <= 1.0 &&
		0.0 <= c.B && c.B <= 1.0
}
182169
func (enc *Encoding) IsValidByte(b byte) bool {
	return enc.decodeMap[b] != nil || enc.skipMap[b]
}
1324226
func (b IPv4) IsValid(pktSize int) bool {
	if len(b) < IPv4MinimumSize {
		return false
	}

	hlen := int(b.HeaderLength())
	tlen := int(b.TotalLength())
	if hlen > tlen || tlen > pktSize {
		return false
	}

	return true
}