issetter

package
v1.3.55 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 14 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func IntegerEnumRanges added in v1.2.16

func IntegerEnumRanges() []int

func IsOutOfRange

func IsOutOfRange(n byte) bool

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

func MaxByte

func MaxByte() byte

func MinByte

func MinByte() byte

func RangeNamesCsv added in v1.2.9

func RangeNamesCsv() string

Types

type Value

type Value byte

Value

Used evaluate lazy boolean valuesNames.

Values:

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

func CombinedBooleans added in v1.1.6

func CombinedBooleans(
	isConditions ...bool,
) Value

CombinedBooleans

Any false, final result returns as False or else True

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 New added in v1.1.5

func New(name string) (Value, error)

func NewBool added in v1.1.6

func NewBool(isResult bool) Value

func NewBooleans added in v1.1.6

func NewBooleans(isResults ...bool) Value

NewBooleans

Any false, final result returns as False or else True

func NewMust added in v1.1.5

func NewMust(name string) Value

func (Value) Add

func (it Value) Add(n byte) Value

Add v + n

func (Value) AllNameValues added in v1.2.16

func (it Value) AllNameValues() []string

func (Value) And added in v0.4.1

func (it 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 (it Value) AndBool(inputBool bool) bool

AndBool

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return v. IsTrue() && inputBool

func (Value) Boolean added in v1.1.6

func (it Value) Boolean() bool

func (Value) Deserialize added in v1.3.28

func (it Value) Deserialize(
	jsonBytes []byte,
) (Value, error)

func (Value) EnumType added in v1.1.9

func (it Value) EnumType() enuminf.EnumTyper

func (Value) Format added in v1.1.9

func (it Value) Format(format string) (compiled string)

func (Value) GetErrorOnOutOfRange

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

func (*Value) GetSetBoolOnInvalid added in v1.1.5

func (it *Value) GetSetBoolOnInvalid(
	setterValue bool,
) bool

func (*Value) GetSetBoolOnInvalidFunc added in v1.1.5

func (it *Value) GetSetBoolOnInvalidFunc(
	setterFunc func() bool,
) bool

func (Value) HasInitialized

func (it Value) HasInitialized() bool

func (Value) HasInitializedAndSet

func (it Value) HasInitializedAndSet() bool

func (Value) HasInitializedAndTrue

func (it Value) HasInitializedAndTrue() bool

func (Value) IntegerEnumRanges added in v1.2.16

func (it Value) IntegerEnumRanges() []int

func (Value) Is

func (it Value) Is(n Value) bool

func (Value) IsAccept added in v1.1.9

func (it Value) IsAccept() bool

IsAccept

Returns true if True or Set

func (Value) IsAccepted added in v1.1.5

func (it Value) IsAccepted() bool

func (Value) IsAnyNamesOf added in v1.2.3

func (it Value) IsAnyNamesOf(names ...string) bool

func (Value) IsAnyValuesEqual added in v1.2.7

func (it Value) IsAnyValuesEqual(
	anyByteValues ...byte,
) bool

func (Value) IsAsk added in v1.1.9

func (it Value) IsAsk() bool

IsAsk

Returns true if Uninitialized or Wildcard

func (Value) IsBetween

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

IsBetween val >= start && val <= end

func (Value) IsBetweenInt

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

IsBetweenInt val >= start && val <= end

func (Value) IsByteValueEqual added in v1.2.4

func (it Value) IsByteValueEqual(value byte) bool

func (Value) IsCompareResult

func (it 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 (it Value) IsDefinedBoolean() bool

func (Value) IsDefinedLogically added in v1.1.5

func (it Value) IsDefinedLogically() bool

IsDefinedLogically

Not Uninitialized, Wildcard

func (Value) IsEqual

func (it Value) IsEqual(n byte) bool

func (Value) IsEqualInt

func (it Value) IsEqualInt(n int) bool

func (Value) IsFailed added in v1.2.16

func (it Value) IsFailed() bool

func (Value) IsFalse

func (it Value) IsFalse() bool

IsFalse v == False

func (Value) IsGreater

func (it Value) IsGreater(n byte) bool

IsGreater v.Value() > n

func (Value) IsGreaterEqual

func (it Value) IsGreaterEqual(n byte) bool

IsGreaterEqual v.Value() >= n

func (Value) IsGreaterEqualInt

func (it Value) IsGreaterEqualInt(n int) bool

IsGreaterEqualInt v.Value() >= n

func (Value) IsGreaterInt

func (it Value) IsGreaterInt(n int) bool

IsGreaterInt v.Value() > n

func (Value) IsIndeterminate added in v1.1.9

func (it Value) IsIndeterminate() bool

IsIndeterminate

Returns true if Uninitialized or Wildcard

func (Value) IsInit added in v0.9.3

func (it Value) IsInit() bool

func (Value) IsInitBoolean added in v0.9.3

func (it Value) IsInitBoolean() bool

func (Value) IsInitBooleanWild added in v0.9.3

func (it Value) IsInitBooleanWild() bool

func (Value) IsInitSet added in v0.9.3

func (it Value) IsInitSet() bool

func (Value) IsInitSetWild added in v0.9.3

func (it Value) IsInitSetWild() bool

func (Value) IsInitialized added in v1.1.5

func (it Value) IsInitialized() bool

func (Value) IsInvalid added in v1.1.5

func (it Value) IsInvalid() bool

func (Value) IsLater added in v1.2.4

func (it Value) IsLater() bool

func (Value) IsLess

func (it Value) IsLess(n byte) bool

IsLess v.Value() < n

func (Value) IsLessEqual

func (it Value) IsLessEqual(n byte) bool

IsLessEqual v.Value() <= n

func (Value) IsLessEqualInt

func (it Value) IsLessEqualInt(n int) bool

IsLessEqualInt v.Value() <= n

func (Value) IsLessInt

func (it Value) IsLessInt(n int) bool

IsLessInt v.Value() < n

func (Value) IsNameEqual added in v1.1.9

func (it Value) IsNameEqual(name string) bool

func (Value) IsNegative

func (it Value) IsNegative() bool

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

func (Value) IsNo added in v1.1.9

func (it Value) IsNo() bool

IsNo

Returns true if False or Unset

func (Value) IsOff added in v1.2.4

func (it Value) IsOff() bool

func (Value) IsOffLogically added in v1.1.5

func (it Value) IsOffLogically() bool

func (Value) IsOn added in v1.2.4

func (it Value) IsOn() bool

func (Value) IsOnLogically added in v1.1.5

func (it Value) IsOnLogically() bool

func (Value) IsPositive

func (it Value) IsPositive() bool

IsPositive v == True || v == Set

func (Value) IsReject added in v1.1.9

func (it Value) IsReject() bool

IsReject

Returns true if False or Unset

func (Value) IsRejected added in v1.1.5

func (it Value) IsRejected() bool

func (Value) IsSet

func (it Value) IsSet() bool

IsSet v == Set

func (Value) IsSkip added in v1.1.9

func (it Value) IsSkip() bool

IsSkip

Returns true if Uninitialized or Wildcard

func (Value) IsSuccess added in v1.2.16

func (it Value) IsSuccess() bool

func (Value) IsTrue

func (it Value) IsTrue() bool

IsTrue v == True

func (Value) IsTrueOrSet added in v0.8.1

func (it Value) IsTrueOrSet() bool

func (Value) IsUnSetOrUninitialized

func (it Value) IsUnSetOrUninitialized() bool

IsUnSetOrUninitialized v == Uninitialized || v == Unset

func (Value) IsUndefinedLogically added in v1.1.5

func (it Value) IsUndefinedLogically() bool

IsUndefinedLogically

Either Uninitialized, Wildcard

func (Value) IsUninitialized

func (it Value) IsUninitialized() bool

IsUninitialized v == Uninitialized

func (Value) IsUnset

func (it Value) IsUnset() bool

IsUnset v == Unset

func (Value) IsValid added in v1.1.5

func (it Value) IsValid() bool

func (Value) IsValueEqual added in v1.2.4

func (it Value) IsValueEqual(value byte) bool

func (Value) IsWildcard added in v0.4.1

func (it Value) IsWildcard() bool

func (Value) IsWildcardOrBool added in v0.6.2

func (it Value) IsWildcardOrBool(isBool bool) bool

IsWildcardOrBool

if v.IsWildcard() then returns true regardless

or else

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

func (Value) IsYes added in v1.1.5

func (it Value) IsYes() bool

func (*Value) LazyEvaluateBool added in v1.1.6

func (it *Value) LazyEvaluateBool(
	evaluatorFunc func(),
) (isCalled bool)

LazyEvaluateBool

Only execute evaluatorFunc if Uninitialized and then set True to self and returns t/f based on called or not

func (*Value) LazyEvaluateSet added in v1.1.6

func (it *Value) LazyEvaluateSet(
	evaluatorFunc func(),
) (isCalled bool)

LazyEvaluateSet

Only execute evaluatorFunc if Uninitialized and then set True to self and returns t/f based on called or not

func (Value) MarshalJSON added in v0.6.8

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

func (Value) MaxByte added in v1.2.7

func (it Value) MaxByte() byte

func (Value) MaxInt added in v1.2.15

func (it Value) MaxInt() int

func (Value) MaxValueString added in v1.2.15

func (it Value) MaxValueString() string

func (Value) MinByte added in v1.2.7

func (it Value) MinByte() byte

func (Value) MinInt added in v1.2.15

func (it Value) MinInt() int

func (Value) MinMaxAny added in v1.3.15

func (it Value) MinMaxAny() (min, max interface{})

func (Value) MinValueString added in v1.2.15

func (it Value) MinValueString() string

func (Value) Name added in v0.6.8

func (it Value) Name() string

func (Value) NameValue added in v1.1.9

func (it Value) NameValue() string

func (Value) OnOffLowercaseName added in v1.1.8

func (it Value) OnOffLowercaseName() string

func (Value) OnOffName added in v1.1.8

func (it Value) OnOffName() string

func (Value) OnlySupportedErr added in v1.2.16

func (it Value) OnlySupportedErr(names ...string) error

func (Value) OnlySupportedMsgErr added in v1.2.16

func (it Value) OnlySupportedMsgErr(message string, names ...string) error

func (Value) OrBool added in v0.4.1

func (it 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 (it Value) OrValue(inputVal Value) bool

OrValue

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

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

func (Value) PanicOnOutOfRange

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

func (Value) RangeNamesCsv added in v1.2.4

func (it Value) RangeNamesCsv() string

func (Value) RangesByte added in v1.2.7

func (it Value) RangesByte() []byte

func (Value) RangesDynamicMap added in v1.2.15

func (it Value) RangesDynamicMap() map[string]interface{}

func (Value) Serialize added in v1.2.4

func (it Value) Serialize() ([]byte, error)

func (Value) SetUnsetLowercaseName added in v1.1.5

func (it Value) SetUnsetLowercaseName() string

func (Value) String

func (it Value) String() string

func (Value) StringValue

func (it Value) StringValue() string

func (Value) ToBooleanValue added in v1.1.6

func (it Value) ToBooleanValue() Value

func (Value) ToByteCondition added in v0.6.2

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

func (Value) ToByteConditionWithWildcard added in v0.6.2

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

func (Value) ToNumberString added in v1.1.9

func (it Value) ToNumberString() string

func (Value) ToPtr added in v1.2.15

func (it Value) ToPtr() *Value

func (Value) ToSetUnsetValue added in v1.1.6

func (it Value) ToSetUnsetValue() Value

func (Value) TrueFalseLowercaseName added in v1.1.5

func (it Value) TrueFalseLowercaseName() string

func (Value) TrueFalseName added in v1.1.5

func (it Value) TrueFalseName() string

func (Value) TypeName added in v1.2.7

func (it Value) TypeName() string

func (*Value) UnmarshalJSON added in v0.6.8

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

func (Value) UnmarshallEnumToValue added in v1.2.7

func (it Value) UnmarshallEnumToValue(
	jsonUnmarshallingValue []byte,
) (byte, error)

func (Value) Value

func (it Value) Value() byte

func (Value) ValueByte added in v1.1.9

func (it Value) ValueByte() byte

func (Value) ValueInt added in v1.1.9

func (it Value) ValueInt() int

func (Value) ValueInt16 added in v1.1.9

func (it Value) ValueInt16() int16

func (Value) ValueInt32 added in v1.1.9

func (it Value) ValueInt32() int32

func (Value) ValueInt8 added in v1.1.9

func (it Value) ValueInt8() int8

func (Value) ValueString added in v1.1.9

func (it Value) ValueString() string

func (Value) ValueUInt16 added in v1.2.16

func (it Value) ValueUInt16() uint16

func (Value) WildcardApply added in v0.4.1

func (it 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 (it Value) WildcardValueApply(inputVal Value) bool

WildcardValueApply

if IsWildcard() || IsUnSetOrUninitialized() then

return inputVal

else

return v. IsTrue()

func (Value) YesNoLowercaseName added in v1.1.5

func (it Value) YesNoLowercaseName() string

func (Value) YesNoMappedValue added in v0.8.1

func (it Value) YesNoMappedValue() string

func (Value) YesNoName added in v1.1.5

func (it Value) YesNoName() string

Jump to

Keyboard shortcuts

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