String
- class String
Bases:
CommonBaseModel
Represents a string data type with enhanced attributes for engineering applications.
- value
The actual string value. It must have at least 1 character.
- Type:
str
- default
A default value for the variable, if any. Defaults to None.
- Type:
Optional[str]
- metadata
Additional metadata providing further context or details about the variable. Defaults to a new instance of Metadata.
- Type:
- Raises:
ValidationError – If the input value does not meet the validation criteria.
Attributes Summary
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Summary
validate_value_not_empty
(value)Validate that the string value is not empty or just whitespace.
Attributes Documentation
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- classmethod validate_value_not_empty(value)
Validate that the string value is not empty or just whitespace.
- Parameters:
value (str) – The string value to validate.
- Returns:
The validated string value.
- Raises:
ValueError – If the value is empty or just whitespace.
- Return type:
str
Methods:
validate_value_not_empty
(value)Validate that the string value is not empty or just whitespace.
Attributes:
__setattr__ handlers.
- classmethod validate_value_not_empty(value)
Validate that the string value is not empty or just whitespace.
- Parameters:
value (str) – The string value to validate.
- Returns:
The validated string value.
- Raises:
ValueError – If the value is empty or just whitespace.
- Return type:
str
- __pydantic_setattr_handlers__: ClassVar[Dict[str, Callable[[BaseModel, str, Any], None]]] = {}
__setattr__ handlers. Memoizing the handlers leads to a dramatic performance improvement in __setattr__