pyrtma.validators.ByteArray

class ByteArray(len)[source]

Bases: ArrayField[Byte]

Validator class for Bytes arrays

Validator class for Bytes arrays

Parameters:

len (int) – Byte array length

Methods

count

index

Raises ValueError if the value is not present.

validate_array

Validate array

validate_many

Validate multiple values

validate_one

Validate one value

count(value) integer -- return number of occurrences of value
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

validate_array(value)

Validate array

Parameters:

value (ArrayField) – Array value to validate

Raises:

TypeError – Wrong type

validate_many(value)

Validate multiple values

Parameters:

value – Values to validate

validate_one(value)

Validate one value

Parameters:

value – Value to validate