Source code for RiskQuantLib.Property.property

#!/usr/bin/python
#coding = utf-8

#<import>
#</import>

[docs]class property(object): """ This is the basic class of any kind of attribute, except string. Any attribute should have an effective date. """ #<init> def __init__(self,value): self.value = value self.belongToObject = None self.belongToAttrName = '' #</init> #<setBelongTo>
[docs] def setBelongTo(self,belongToObject,belongToAttrName:str): self.belongToObject = belongToObject self.belongToAttrName = belongToAttrName
#</setBelongTo> #<commit>
[docs] def commit(self): if getattr(self,'belongToObject',None) and getattr(self,'belongToAttrName','')!='': setattr(self.belongToObject,self.belongToAttrName,self.value)
#</commit> #<setValue>
[docs] def setValue(self,value): self.value = value
#</setValue> #<setEffectiveDate>
[docs] def setEffectiveDate(self,effectiveDateTimeStamp): self.effectiveDate = effectiveDateTimeStamp
#</setEffectiveDate> #<property> #</property>