Class Entity

  • All Implemented Interfaces:
    com.rapiddweller.common.Composite
    Direct Known Subclasses:
    XmlEntity

    public class Entity
    extends java.lang.Object
    implements com.rapiddweller.common.Composite
    Instance of a composite data type as described by a ComplexTypeDescriptor.

    Created: 20.08.2007 19:20:22
    Since:
    0.3
    Author:
    Volker Bergmann
    • Constructor Summary

      Constructors 
      Constructor Description
      Entity​(ComplexTypeDescriptor descriptor, java.lang.Object... componentKeyValuePairs)
      Instantiates a new Entity.
      Entity​(Entity prototype)
      Instantiates a new Entity.
      Entity​(java.lang.String name, DescriptorProvider descriptorProvider)
      Instantiates a new Entity.
      Entity​(java.lang.String name, DescriptorProvider descriptorProvider, java.lang.Object... componentKeyValuePairs)
      Instantiates a new Entity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean componentIsSet​(java.lang.String componentName)
      Component is set boolean.
      java.lang.Object componentValues​(java.lang.String[] idComponentNames)
      Component values object.
      ComplexTypeDescriptor descriptor()
      Descriptor complex type descriptor.
      boolean equals​(java.lang.Object o)  
      java.lang.Object get​(java.lang.String componentName)
      Allows for generic 'map-like' access to component values, e.g.
      java.lang.Object getComponent​(java.lang.String componentName)  
      com.rapiddweller.common.collection.OrderedNameMap<java.lang.Object> getComponents()  
      int hashCode()  
      java.lang.Object idComponentValues()
      Id component values object.
      void remove​(java.lang.String componentName)
      Remove.
      void removeComponent​(java.lang.String componentName)
      Remove component.
      void set​(java.lang.String componentName, java.lang.Object component)
      Set.
      void setComponent​(java.lang.String componentName, java.lang.Object component)  
      void setComponents​(com.rapiddweller.common.collection.OrderedNameMap<java.lang.Object> components)
      Sets components.
      java.lang.String toString()  
      java.lang.String type()
      Type string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Entity

        public Entity​(java.lang.String name,
                      DescriptorProvider descriptorProvider)
        Instantiates a new Entity.
        Parameters:
        name - the name
        descriptorProvider - the descriptor provider
      • Entity

        public Entity​(java.lang.String name,
                      DescriptorProvider descriptorProvider,
                      java.lang.Object... componentKeyValuePairs)
        Instantiates a new Entity.
        Parameters:
        name - the name
        descriptorProvider - the descriptor provider
        componentKeyValuePairs - the component key value pairs
      • Entity

        public Entity​(ComplexTypeDescriptor descriptor,
                      java.lang.Object... componentKeyValuePairs)
        Instantiates a new Entity.
        Parameters:
        descriptor - the name of the entity, it may be null
        componentKeyValuePairs - content of Entity column and value
      • Entity

        public Entity​(Entity prototype)
        Instantiates a new Entity.
        Parameters:
        prototype - the prototype
    • Method Detail

      • type

        public java.lang.String type()
        Type string.
        Returns:
        the string
      • descriptor

        public ComplexTypeDescriptor descriptor()
        Descriptor complex type descriptor.
        Returns:
        the complex type descriptor
      • get

        public java.lang.Object get​(java.lang.String componentName)
        Allows for generic 'map-like' access to component values, e.g. by FreeMarker.
        Parameters:
        componentName - the name of the component whose value to return.
        Returns:
        the value of the specified component.
        Since:
        0.4.0
      • getComponent

        public java.lang.Object getComponent​(java.lang.String componentName)
        Specified by:
        getComponent in interface com.rapiddweller.common.Composite
      • componentIsSet

        public boolean componentIsSet​(java.lang.String componentName)
        Component is set boolean.
        Parameters:
        componentName - the component name
        Returns:
        the boolean
      • getComponents

        public com.rapiddweller.common.collection.OrderedNameMap<java.lang.Object> getComponents()
        Specified by:
        getComponents in interface com.rapiddweller.common.Composite
      • setComponents

        public void setComponents​(com.rapiddweller.common.collection.OrderedNameMap<java.lang.Object> components)
        Sets components.
        Parameters:
        components - the components
      • set

        public void set​(java.lang.String componentName,
                        java.lang.Object component)
        Set.
        Parameters:
        componentName - the component name
        component - the component
      • setComponent

        public void setComponent​(java.lang.String componentName,
                                 java.lang.Object component)
        Specified by:
        setComponent in interface com.rapiddweller.common.Composite
      • remove

        public void remove​(java.lang.String componentName)
        Remove.
        Parameters:
        componentName - the component name
      • removeComponent

        public void removeComponent​(java.lang.String componentName)
        Remove component.
        Parameters:
        componentName - the component name
      • idComponentValues

        public java.lang.Object idComponentValues()
        Id component values object.
        Returns:
        the object
      • componentValues

        public java.lang.Object componentValues​(java.lang.String[] idComponentNames)
        Component values object.
        Parameters:
        idComponentNames - the id component names
        Returns:
        the object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object