MECO™ API Reference
|
[ ABSTRACT CLASS ] - Abstract class for enum classes. More...
Public Member Functions | |
def | listAttributes (cls, stringOnly=True, getValues=True, removeK=True, startAttrNamesLower=False) |
List static public attributes of the class. More... | |
def | listAttributeElements (cls, attribute) |
List elements of a static public attribute. More... | |
def | getAttributeNameFromValue (cls, value, removeK=True, defaultAttributeName=None, startLower=False) |
Get the name of the attribute for given value. More... | |
def | getValueFromAttributeName (cls, attribute, removeK=False, defaultValue=None) |
Get value from attribute name. More... | |
def | asDict (cls, removeK=True) |
Get all the attributes and their values in a dict instance. More... | |
[ ABSTRACT CLASS ] - Abstract class for enum classes.
def mCore.enumAbs.Enum.listAttributes | ( | cls, | |
stringOnly = True , |
|||
getValues = True , |
|||
removeK = True , |
|||
startAttrNamesLower = False |
|||
) |
List static public attributes of the class.
cls | [ object | None | in ] - Class object. |
stringOnly | [ bool | True | in ] - List attributes only with string values. |
getValues | [ bool | True | in ] - Get values of the attributes instead of their names. |
removeK | [ bool | True | in ] - Remove k character from the attribute names if getValues is provided False. |
startAttrNamesLower | [ bool | False | in ] - Start attribute names with lower case. |
N/A |
Reimplemented in mApplication.parentApplicationLib.Application.
def mCore.enumAbs.Enum.listAttributeElements | ( | cls, | |
attribute | |||
) |
List elements of a static public attribute.
cls | [ object | None | in ] - Class object. |
attribute | [ str | None | in ] - Name of the attribute. |
N/A |
def mCore.enumAbs.Enum.getAttributeNameFromValue | ( | cls, | |
value, | |||
removeK = True , |
|||
defaultAttributeName = None , |
|||
startLower = False |
|||
) |
Get the name of the attribute for given value.
cls | [ object | None | in ] - Class object. |
value | [ None | None | in ] - Value. |
removeK | [ bool | True | in ] - Remove k character from the name of the attribute. |
defaultAttributeName | [ None | None | in ] - Default value to return if given value doesn't exist. |
startLower | [ bool | False | in ] - Start attribute names with lower case. |
N/A |
defaultAttributeName
argument. def mCore.enumAbs.Enum.getValueFromAttributeName | ( | cls, | |
attribute, | |||
removeK = False , |
|||
defaultValue = None |
|||
) |
Get value from attribute name.
cls | [ object | None | in ] - Class object. |
attribute | [ str | None | in ] - Name of the attribute. |
removeK | [ bool | False | in ] - Remove k character from the name of the attribute. |
defaultValue | [ None | None | in ] - Default value to return if requested value doesn't exist. |
N/A |
defaultValue
argument. def mCore.enumAbs.Enum.asDict | ( | cls, | |
removeK = True |
|||
) |
Get all the attributes and their values in a dict instance.
cls | [ object | None | in ] - Class object. |
removeK | [ bool | True | in ] - Remove k characters from the name of the attributes. |
N/A |