org.jboss.dna.jcr.cache
Class ImmutableNodeInfo

java.lang.Object
  extended by org.jboss.dna.jcr.cache.ImmutableNodeInfo
All Implemented Interfaces:
NodeInfo

@Immutable
public class ImmutableNodeInfo
extends Object
implements NodeInfo

The information that describes a node. This is the information that is kept in the cache.


Constructor Summary
ImmutableNodeInfo(Location originalLocation, Name primaryTypeName, List<Name> mixinTypeNames, NodeDefinitionId definition, UUID parent, Children children, Map<Name,PropertyInfo> properties)
          Create an immutable NodeInfo instance.
 
Method Summary
 Children getChildren()
          Get the children for this node.
 NodeDefinitionId getDefinitionId()
          
 List<Name> getMixinTypeNames()
          Get the names of the mixin types for this node.
 Location getOriginalLocation()
          
 UUID getParent()
          
 Name getPrimaryTypeName()
          
 PropertyInfo getProperty(Name name)
          Get this node's property that has the supplied name.
 int getPropertyCount()
          Return the number of properties on this node.
 Set<Name> getPropertyNames()
          Get the names of the properties that are owned by this node.
 UUID getUuid()
          
 boolean hasProperties()
          Return true of this node has at least one property.
 boolean isModified()
          Indicates whether the node represented by this NodeInfo is modified (i.e., exists in the persistent repository with different child items).
 boolean isNew()
          Indicates whether the node represented by this NodeInfo is new (i.e., does not yet exist in the persistent repository).
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmutableNodeInfo

public ImmutableNodeInfo(Location originalLocation,
                         Name primaryTypeName,
                         List<Name> mixinTypeNames,
                         NodeDefinitionId definition,
                         UUID parent,
                         Children children,
                         Map<Name,PropertyInfo> properties)
Create an immutable NodeInfo instance.

Parameters:
originalLocation - the original location
primaryTypeName - the name of the node's primary type
mixinTypeNames - the names of the mixin types for this node, or null if there are none
definition - the definition used when creating the node
parent - the parent
children - the immutable children; may be null if there are no children
properties - the unmodifiable map of properties; may be null if there are no properties
Method Detail

getOriginalLocation

public Location getOriginalLocation()

Specified by:
getOriginalLocation in interface NodeInfo
Returns:
location
See Also:
NodeInfo.getOriginalLocation()

getUuid

public UUID getUuid()

Specified by:
getUuid in interface NodeInfo
Returns:
uuid
See Also:
NodeInfo.getUuid()

getParent

public UUID getParent()

Specified by:
getParent in interface NodeInfo
Returns:
parent
See Also:
NodeInfo.getParent()

getPrimaryTypeName

public Name getPrimaryTypeName()

Specified by:
getPrimaryTypeName in interface NodeInfo
Returns:
primaryTypeName
See Also:
NodeInfo.getPrimaryTypeName()

getMixinTypeNames

public List<Name> getMixinTypeNames()
Get the names of the mixin types for this node.

Specified by:
getMixinTypeNames in interface NodeInfo
Returns:
the unmodifiable list of mixin type names; never null but possibly empty
See Also:
NodeInfo.getMixinTypeNames()

getDefinitionId

public NodeDefinitionId getDefinitionId()

Specified by:
getDefinitionId in interface NodeInfo
Returns:
definition
See Also:
NodeInfo.getDefinitionId()

getChildren

public Children getChildren()
Get the children for this node. Generally, clients should not hold onto the returned object but instead should simply use it and discard the reference. This is because implementations are not required to return the same instance with each call (although immutable implementations are expected to always return the same instance).

Specified by:
getChildren in interface NodeInfo
Returns:
the immutable children; never null but possibly empty
See Also:
NodeInfo.getChildren()

hasProperties

public boolean hasProperties()
Return true of this node has at least one property.

Specified by:
hasProperties in interface NodeInfo
Returns:
true if there is at least one property, or false if there are none
See Also:
NodeInfo.hasProperties()

getPropertyCount

public int getPropertyCount()
Return the number of properties on this node.

Specified by:
getPropertyCount in interface NodeInfo
Returns:
the number of properties; never negative
See Also:
NodeInfo.getPropertyCount()

getPropertyNames

public Set<Name> getPropertyNames()
Get the names of the properties that are owned by this node.

Specified by:
getPropertyNames in interface NodeInfo
Returns:
the unmodifiable set of property names
See Also:
NodeInfo.getPropertyNames()

getProperty

public PropertyInfo getProperty(Name name)
Get this node's property that has the supplied name.

Specified by:
getProperty in interface NodeInfo
Parameters:
name - the property name; may not be null
Returns:
the property information, or null if this node has no property with the supplied name
See Also:
NodeInfo.getProperty(org.jboss.dna.graph.property.Name)

isNew

public boolean isNew()
Indicates whether the node represented by this NodeInfo is new (i.e., does not yet exist in the persistent repository).

Specified by:
isNew in interface NodeInfo
Returns:
false always as this object represents unmodified nodes only
See Also:
NodeInfo.isNew()

isModified

public boolean isModified()
Indicates whether the node represented by this NodeInfo is modified (i.e., exists in the persistent repository with different child items).

Specified by:
isModified in interface NodeInfo
Returns:
false always as this object represents unmodified nodes only
See Also:
NodeInfo.isModified()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.