Class AbstractNode<N extends AbstractNode<N>>
java.lang.Object
net.datenwerke.treedb.service.treedb.AbstractNode<N>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractTsDiskNode,SecuredAbstractNode
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@GenerateDto(dtoPackage="net.datenwerke.treedb.client.treedb.dto",abstractDto=true,poso2DtoPostProcessors=AbstractNode2DtoPostProcessor.class,createDecorator=true,additionalFields={,,,,})
public abstract class AbstractNode<N extends AbstractNode<N>>
extends Object
implements Serializable
This class provides a generic tree-like structure to entities
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdd a new childnode to this node.final voidvoidaddFlag(long bitfield) voidbooleanfinal Class<?> Returns the tree's base class;Returns the children unsorted.getChildrenOfType(Class<T> type) Get all of this nodes childnodes sorted by position.final Class<?>[]Returns a list with denied child typesRetrieves all children nodes of this node, also transitively.<T extends AbstractNode<N>>
List<T> getDescendants(Class<T> type) Retrieves all children nodes of this node having this type, also transitively.longgetFlags()getId()final Class<? extends TreeDBManager> abstract StringGet this nodes parent node.intabstract Stringfinal Class<?>[]Returns a list with supported childrenbooleanbooleanhasChildrenOfType(Class<? extends AbstractNode<?>> type) booleanhasDescendantsOfType(Class<? extends AbstractNode<?>> type) booleanhasFlag(long flag) inthashCode()booleanidsMatch(AbstractNode<?> node) booleanisAncestorOf(N node) booleanbooleanisFolder()final booleanisRoot()Tells whether this entity is a rootbooleanbooleanremoveChild(N child) Method does not remove the child from the databasevoidremoveFlag(long bitfield) voidsetChildren(List<N> children) Do never call unless with a very good causevoidsetConfigurationProtection(boolean w) voidsetCreatedOn(Date createdOn) voidsetFlags(long flags) voidvoidsetLastUpdated(Date lastUpdated) voidsetOldTransientId(Long oldTransientId) voidsetOldTransientKey(String oldTransientKey) voidsetParent(AbstractNode<N> abstractNode) Should not be called.voidsetPosition(int position) voidsetUpdateLastUpdated(boolean updateLastUpdated) voidsetVersion(Long version) voidsetWriteProtection(boolean w) toString()booleanwouldContainFlag(long flag, long newFlag)
-
Field Details
-
FLAG_WRITE_PROTECTION
public static final long FLAG_WRITE_PROTECTION- See Also:
-
FLAG_CONFIGURATION_PROTECTION
public static final long FLAG_CONFIGURATION_PROTECTION- See Also:
-
-
Constructor Details
-
AbstractNode
public AbstractNode()
-
-
Method Details
-
getId
-
setId
-
getVersion
-
setVersion
-
getPosition
public int getPosition() -
setPosition
public void setPosition(int position) -
getChildrenSorted
Get all of this nodes childnodes sorted by position. -
setChildren
Do never call unless with a very good cause- Parameters:
children-
-
getChildren
Returns the children unsorted.- See Also:
-
getChildrenOfType
-
getDescendants
Retrieves all children nodes of this node, also transitively. I.e. if there are any child folders, also all their children nodes are retrieved.- Returns:
- all (transitive) children nodes
-
getDescendants
Retrieves all children nodes of this node having this type, also transitively. I.e. if there are any child folders, also all their children nodes are retrieved.- Parameters:
type- the type of the (transitive) children nodes we are filtering for- Returns:
- all (transitive) children nodes
-
hasChildren
public boolean hasChildren() -
hasChildrenOfType
-
hasDescendantsOfType
-
getParent
Get this nodes parent node. Returns null for the root element -
setParent
Should not be called. Always go for (root.addChild()) -
isRoot
public final boolean isRoot()Tells whether this entity is a root -
isAncestorOf
-
getRootLine
-
addChild
Add a new childnode to this node. Childnode will become detached from old parent node if necessary- Parameters:
child-
-
addChild
-
getBaseType
Returns the tree's base class; -
getManagerClass
-
getSupportedChildren
Returns a list with supported children -
getDeniedChildren
Returns a list with denied child types -
removeChild
Method does not remove the child from the database -
equals
-
hashCode
public int hashCode() -
setCreatedOn
-
getCreatedOn
-
setLastUpdated
-
getLastUpdated
-
setOldTransientId
-
getOldTransientId
-
setOldTransientKey
-
getOldTransientKey
-
getIdOrOldTransient
-
setFlags
public void setFlags(long flags) -
getFlags
public long getFlags() -
addFlag
public void addFlag(long bitfield) -
removeFlag
public void removeFlag(long bitfield) -
hasFlag
public boolean hasFlag(long flag) -
wouldContainFlag
public boolean wouldContainFlag(long flag, long newFlag) -
clearFlags
public void clearFlags() -
isWriteProtected
public boolean isWriteProtected() -
setWriteProtection
public void setWriteProtection(boolean w) -
isConfigurationProtected
public boolean isConfigurationProtected() -
setConfigurationProtection
public void setConfigurationProtection(boolean w) -
isFolder
public boolean isFolder() -
setUpdateLastUpdated
public void setUpdateLastUpdated(boolean updateLastUpdated) -
isUpdateLastUpdated
public boolean isUpdateLastUpdated() -
getNodeName
-
getRootNodeName
-
idsMatch
-
toString
-