示例#1
0
文件: parameter.go 项目: TMaYaD/clif
// Int representation of the value (will be 0, if not given or not parsable)
func (this *parameter) Int() int {
	if this.Values == nil {
		return 0
	} else {
		return reflekt.AsInt(this.Values[0])
	}
}
示例#2
0
文件: parameter.go 项目: TMaYaD/clif
// Ints returns values as int array (values will be 0, if not parsable to int)
func (this *parameter) Ints() []int {
	if this.Values == nil {
		return nil
	} else {
		res := make([]int, this.Count())
		for i, v := range this.Values {
			res[i] = reflekt.AsInt(v)
		}
		return res
	}
}