issetter

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Yes = "yes"
	No  = "no"
)

Functions

func IsOutOfRange

func IsOutOfRange(n byte) bool

IsOutOfRange n < Uninitialized.Value() || n > Set.Value()

func MaxByte

func MaxByte() byte

func MinByte

func MinByte() byte

Types

type Value

type Value byte
const (
	Uninitialized Value = 0
	True          Value = 1
	False         Value = 2
	Unset         Value = 3
	Set           Value = 4
	Wildcard      Value = 5
)

func GetBool added in v0.1.0

func GetBool(
	isCondition bool,
) Value

func GetSet added in v0.0.8

func GetSet(
	isCondition bool,
	trueValue Value,
	falseValue Value,
) Value

func GetSetByte added in v0.0.8

func GetSetByte(
	isCondition bool,
	trueValue byte,
	falseValue byte,
) Value

func GetSetUnset added in v0.1.0

func GetSetUnset(
	isCondition bool,
) Value

func GetSetterByComparing added in v0.6.2

func GetSetterByComparing(
	trueVal, falseVal Value,
	expectedVal interface{},
	trueRanges ...interface{},
) Value

GetSetterByComparing

returns true value if any of ranges value matches

func Max

func Max() Value

func Min

func Min() Value

func (Value) Add

func (v Value) Add(n byte) Value

Add v + n

func (Value) And added in v0.4.1

func (v Value) And(inputVal Value) Value

And

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return GetBool(v. IsTrue() && inputVal. IsTrue())

func (Value) AndBool added in v0.4.1

func (v Value) AndBool(inputBool bool) bool

AndBool

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return v. IsTrue() && inputBool

func (Value) GetErrorOnOutOfRange

func (v Value) GetErrorOnOutOfRange(n byte, msg string) error

func (Value) HasInitialized

func (v Value) HasInitialized() bool

func (Value) HasInitializedAndSet

func (v Value) HasInitializedAndSet() bool

func (Value) HasInitializedAndTrue

func (v Value) HasInitializedAndTrue() bool

func (Value) Is

func (v Value) Is(n Value) bool

func (Value) IsBetween

func (v Value) IsBetween(start, end byte) bool

IsBetween val >= start && val <= end

func (Value) IsBetweenInt

func (v Value) IsBetweenInt(start, end int) bool

IsBetweenInt val >= start && val <= end

func (Value) IsCompareResult

func (v Value) IsCompareResult(n byte, compare corecomparator.Compare) bool

IsCompareResult Here left is v, and right is `n`

func (Value) IsDefinedBoolean added in v0.9.5

func (v Value) IsDefinedBoolean() bool

func (Value) IsEqual

func (v Value) IsEqual(n byte) bool

func (Value) IsEqualInt

func (v Value) IsEqualInt(n int) bool

func (Value) IsFalse

func (v Value) IsFalse() bool

IsFalse v == False

func (Value) IsGreater

func (v Value) IsGreater(n byte) bool

IsGreater v.Value() > n

func (Value) IsGreaterEqual

func (v Value) IsGreaterEqual(n byte) bool

IsGreaterEqual v.Value() >= n

func (Value) IsGreaterEqualInt

func (v Value) IsGreaterEqualInt(n int) bool

IsGreaterEqualInt v.Value() >= n

func (Value) IsGreaterInt

func (v Value) IsGreaterInt(n int) bool

IsGreaterInt v.Value() > n

func (Value) IsInit added in v0.9.3

func (v Value) IsInit() bool

func (Value) IsInitBoolean added in v0.9.3

func (v Value) IsInitBoolean() bool

func (Value) IsInitBooleanWild added in v0.9.3

func (v Value) IsInitBooleanWild() bool

func (Value) IsInitSet added in v0.9.3

func (v Value) IsInitSet() bool

func (Value) IsInitSetWild added in v0.9.3

func (v Value) IsInitSetWild() bool

func (Value) IsLess

func (v Value) IsLess(n byte) bool

IsLess v.Value() < n

func (Value) IsLessEqual

func (v Value) IsLessEqual(n byte) bool

IsLessEqual v.Value() <= n

func (Value) IsLessEqualInt

func (v Value) IsLessEqualInt(n int) bool

IsLessEqualInt v.Value() <= n

func (Value) IsLessInt

func (v Value) IsLessInt(n int) bool

IsLessInt v.Value() < n

func (Value) IsNegative

func (v Value) IsNegative() bool

IsNegative v == Uninitialized || v == Unset || v == False

func (Value) IsPositive

func (v Value) IsPositive() bool

IsPositive v == True || v == Set

func (Value) IsSet

func (v Value) IsSet() bool

IsSet v == Set

func (Value) IsTrue

func (v Value) IsTrue() bool

IsTrue v == True

func (Value) IsTrueOrSet added in v0.8.1

func (v Value) IsTrueOrSet() bool

func (Value) IsUnSetOrUninitialized

func (v Value) IsUnSetOrUninitialized() bool

IsUnSetOrUninitialized v == Uninitialized || v == Unset

func (Value) IsUninitialized

func (v Value) IsUninitialized() bool

IsUninitialized v == Uninitialized

func (Value) IsUnset

func (v Value) IsUnset() bool

IsUnset v == Unset

func (Value) IsWildcard added in v0.4.1

func (v Value) IsWildcard() bool

func (Value) IsWildcardOrBool added in v0.6.2

func (v Value) IsWildcardOrBool(isBool bool) bool

IsWildcardOrBool

if v.IsWildcard() then returns true regardless

or else

returns (isBool && v.IsTrue()) || (!isBool && v.IsFalse())

func (Value) MarshalJSON added in v0.6.8

func (v Value) MarshalJSON() ([]byte, error)

func (Value) Name added in v0.6.8

func (v Value) Name() string

func (Value) OrBool added in v0.4.1

func (v Value) OrBool(inputBool bool) bool

OrBool

if IsWildcard() || IsUnSetOrUninitialized() then

return inputBool

else

return v. IsTrue() || inputBool

func (Value) OrValue added in v0.4.1

func (v Value) OrValue(inputVal Value) bool

OrValue

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return v. IsTrue() || inputVal. IsTrue()

func (Value) PanicOnOutOfRange

func (v Value) PanicOnOutOfRange(n byte, msg string)

func (Value) String

func (v Value) String() string

func (Value) StringValue

func (v Value) StringValue() string

func (Value) ToByteCondition added in v0.6.2

func (v Value) ToByteCondition(trueVal, falseVal, invalid byte) byte

func (Value) ToByteConditionWithWildcard added in v0.6.2

func (v Value) ToByteConditionWithWildcard(wildcard, trueVal, falseVal, invalid byte) byte

func (*Value) UnmarshalJSON added in v0.6.8

func (v *Value) UnmarshalJSON(data []byte) error

func (Value) Value

func (v Value) Value() byte

func (Value) WildcardApply added in v0.4.1

func (v Value) WildcardApply(inputBool bool) bool

WildcardApply

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return v. IsTrue()

func (Value) WildcardValueApply added in v0.4.1

func (v Value) WildcardValueApply(inputVal Value) bool

WildcardValueApply

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return v. IsTrue()

func (Value) YesNoMappedValue added in v0.8.1

func (v Value) YesNoMappedValue() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL