Package io.higson.runtime.model
Class DomainObjectImpl
java.lang.Object
io.higson.runtime.model.DomainObjectImpl
- All Implemented Interfaces:
DomainObject,Comparable<DomainObjectImpl>
Klasa przechowuje dane produktu. W przypadku odczytu pełnych danych produktu cała jego struktura
jest zachowana w sekwencji atrybutów children, tzn. lista dzieci ma w sobie kolejną listę dzieci
itd. aż do wypełnienia pełnej struktury.
- Author:
- Ania
-
Constructor Summary
ConstructorsConstructorDescriptionWykorzystywany do utworzenia specjalnego obiektu przechowującego obiekty rootDomainObjectImpl(Integer id, String code, String name, String description, DomainObjectTypeImpl type, Integer parentId, boolean head) Do utworzenia obiektu odczytanego z bazy -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllTags(List<Tag> tagList) voidaddChildren(List<DomainObjectImpl> children) voidaddReference(DomainObjectImpl referenced, String referenceInCollectionCode) voidintbooleanbooleangetAttrBoolean(String code, HigsonContext ctx) getAttrDate(String code, HigsonContext ctx) getAttrDecimal(String code, HigsonContext ctx) getAttribute(String code) getAttribute(String path, String attributeCode) getAttributeValue(String path, String attributeCode, ParamContext ctx, Object... args) getAttrInteger(String code, HigsonContext ctx) doublegetAttrNumber(String code, HigsonContext ctx) getAttrString(String code, HigsonContext ctx) path to this object in the form in which it was used (the object can be reached using different paths).getChildren(String propCode) calculates and returns element's digest.getDynamicAttribute(String code) getFromAllAttributes(String code) getReferenceCollectionCode(Integer referenceId) static IntegergetTmpId()inthashCode()booleanbooleanisAttrDefined(String code) booleanbooleanisLocalAttr(String code) booleanisRealChild(Integer id) booleanisReferenceInCollection(String collectionCode, Integer id) booleanisRoot()voidreload(DomainObject child) voidremoveChild(DomainObjectImpl child) voidsetAttributes(List<DomainAttribute> attributes) UWAGA: jedne miejsce, ktore modyfikuje kolekcje [attributes]voidsetChildren(List<DomainObjectImpl> children) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.higson.runtime.model.DomainObject
getAttributes, getCode, getDescription, getId, getName, getParentId, getPath, getRegion
-
Constructor Details
-
DomainObjectImpl
public DomainObjectImpl()Wykorzystywany do utworzenia specjalnego obiektu przechowującego obiekty root -
DomainObjectImpl
public DomainObjectImpl(Integer id, String code, String name, String description, DomainObjectTypeImpl type, Integer parentId, boolean head) Do utworzenia obiektu odczytanego z bazy- Parameters:
id- idcode- codename- namedescription- descriptiontype- type - HigsonDomainObjectTypeImpl objectparentId- parent idhead- is head control flag
-
-
Method Details
-
getDomain
- Specified by:
getDomainin interfaceDomainObject
-
getTypeCollection
- Specified by:
getTypeCollectionin interfaceDomainObject- Returns:
- collection type of HigsonDomainObjectType object
-
getTagList
- Specified by:
getTagListin interfaceDomainObject- Returns:
- collection with tags attached to domain object
-
getDigest
Description copied from interface:DomainObjectcalculates and returns element's digest. It includes element's code, type code, attributes digests and region info, if element is attached- Specified by:
getDigestin interfaceDomainObject- Returns:
- domain element's digest
-
getTagsName
-
addAllTags
-
isRoot
public boolean isRoot()- Specified by:
isRootin interfaceDomainObject
-
isAttrDefined
- Specified by:
isAttrDefinedin interfaceDomainObject
-
isLocalAttr
- Specified by:
isLocalAttrin interfaceDomainObject
-
getAttr
- Specified by:
getAttrin interfaceDomainObject- Parameters:
code- code- Returns:
- attribute of type HigsonDomainAttribute
-
getAttrString
- Specified by:
getAttrStringin interfaceDomainObject- Parameters:
code- attribute codectx- context- Returns:
- attribute as String object
-
getAttrDecimal
- Specified by:
getAttrDecimalin interfaceDomainObject- Parameters:
code- attribute codectx- context- Returns:
- attribute as BigDecimal object
-
getAttrNumber
- Specified by:
getAttrNumberin interfaceDomainObject- Parameters:
code- attribute codectx- context- Returns:
- attribute as double value
-
getAttrInteger
- Specified by:
getAttrIntegerin interfaceDomainObject- Parameters:
code- attribute codectx- context- Returns:
- attribute as Integer object
-
getAttrDate
- Specified by:
getAttrDatein interfaceDomainObject- Parameters:
code- attribute codectx- context- Returns:
- attribute as Data object
-
getAttrBoolean
- Specified by:
getAttrBooleanin interfaceDomainObject- Parameters:
code- attribute codectx- context- Returns:
- attribute as boolean value
-
getTypeName
- Specified by:
getTypeNamein interfaceDomainObject
-
getTypeCode
- Specified by:
getTypeCodein interfaceDomainObject
-
getAttribute
- Specified by:
getAttributein interfaceDomainObject
-
getDynamicAttribute
- Specified by:
getDynamicAttributein interfaceDomainObject
-
getFromAllAttributes
- Specified by:
getFromAllAttributesin interfaceDomainObject- Parameters:
code- attribute code to look for- Returns:
- found attribute or
Optional.empty()if not found
-
getDynamicAttributes
- Specified by:
getDynamicAttributesin interfaceDomainObject
-
getChild
- Specified by:
getChildin interfaceDomainObject
-
getChildren
- Specified by:
getChildrenin interfaceDomainObject
-
getParent
- Specified by:
getParentin interfaceDomainObject
-
hasParent
public boolean hasParent() -
getAttribute
- Specified by:
getAttributein interfaceDomainObject
-
getAttributeValue
public ParamValue getAttributeValue(String path, String attributeCode, ParamContext ctx, Object... args) - Specified by:
getAttributeValuein interfaceDomainObject
-
getCallPath
Description copied from interface:DomainObjectpath to this object in the form in which it was used (the object can be reached using different paths). path is normalized and has the form: / a / b / c- Specified by:
getCallPathin interfaceDomainObject- Returns:
- call path
-
setChildren
-
setAttributes
UWAGA: jedne miejsce, ktore modyfikuje kolekcje [attributes]- Parameters:
attributes- list with HigsonDomainAttribute objects
-
getFullElementCode
-
toString
-
hashCode
public int hashCode() -
equals
-
getCollection
-
addReference
-
getTypeNature
-
getCollectionType
-
isRealChild
-
isReferenceInCollection
-
getReferenceCollectionCode
-
compareTo
- Specified by:
compareToin interfaceComparable<DomainObjectImpl>
-
getTmpId
-
isAttrSet
- Specified by:
isAttrSetin interfaceDomainObject
-
removeChild
-
reload
-
getNotRefChildren
-
addChildren
-
getFullPath
-
addTag
-
getCollectionCodeOrNull
-