pip_services3_commons.reflect.TypeDescriptor module

pip_services3_commons.reflect.TypeDescriptor

Type descriptor implementation

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_commons.reflect.TypeDescriptor.TypeDescriptor(name: str, library: Optional[str, None])

Bases: object

Descriptor that points to specific object type by it’s name and optional library (or module) where this type is defined.

This class has symmetric implementation across all languages supported by Pip.Services toolkit and used to support dynamic data processing.

equals(other: Any)bool

Compares this descriptor to a args. If the args is also a TypeDescriptor it compares their name and library fields. Otherwise this method returns false.

Parameters

other – a args to compare.

Returns

true if args is identical TypeDescriptor and false otherwise.

static from_string(value: str) → Optional[pip_services3_commons.reflect.TypeDescriptor.TypeDescriptor, None]

Parses a string to get descriptor fields and returns them as a Descriptor. The string must have format name[,library]

Parameters

value – a string to parse.

Returns

a newly created Descriptor.

get_library()str

Gets the name of the library or module where the object type is defined.

Returns

the name of the library or module.

get_name()str

Get the name of the object type.

Returns

the name of the object type.

to_string()

Gets a string representation of the object. The result has format name[,library]

Returns

a string representation of the object.