You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/vendor/github.com/antihax/optional/uint64.go

37 lines
490 B

package optional
type Uint64 struct {
isSet bool
value uint64
}
func NewUint64(value uint64) Uint64 {
return Uint64{
true,
value,
}
}
// EmptyUint64 returns a new Uint64 that does not have a value set.
func EmptyUint64() Uint64 {
return Uint64{
false,
0,
}
}
func (i Uint64) IsSet() bool {
return i.isSet
}
func (i Uint64) Value() uint64 {
return i.value
}
func (i Uint64) Default(defaultValue uint64) uint64 {
if i.isSet {
return i.value
}
return defaultValue
}