Class ExtensibleData

    • Field Detail

      • extensionElements

        protected List<Object> extensionElements
      • transientProperties

        protected final Map<String,​Object> transientProperties
    • Constructor Detail

      • ExtensibleData

        public ExtensibleData()
    • Method Detail

      • getId

        public String getId()
        A local, context-specific id for the data.
        Returns:
        A local, context-specific id for the data.
      • setId

        public void setId​(String id)
        A local, context-specific id for the data.
        Parameters:
        id - A local, context-specific id for the data.
      • id

        public ExtensibleData id​(String id)
        Build up this object with an id.
        Parameters:
        id - The id.
        Returns:
        this.
      • setExtensionElements

        public void setExtensionElements​(List<Object> extensionElements)
        Custom extension elements for a conclusion.
        Parameters:
        extensionElements - Custom extension elements for a conclusion.
      • removeExtensionElements

        public <E> List<E> removeExtensionElements​(Class<E> clazz)
        Remove extension elements of a given type.
        Type Parameters:
        E - The type of extension elements.
        Parameters:
        clazz - The type of extension element to remove.
        Returns:
        The removed extension elements.
      • setExtensionElement

        public void setExtensionElement​(Object element)
        Sets an extension element by first removing all previous elements of the same type, then adding it to the list.
        Parameters:
        element - The element to set.
      • findExtensionOfType

        public <E> E findExtensionOfType​(Class<E> clazz)
        Finds the first extension of a specified type.
        Specified by:
        findExtensionOfType in interface SupportsExtensionElements
        Type Parameters:
        E - The type of extension elements.
        Parameters:
        clazz - The type.
        Returns:
        The extension, or null if none found.
      • findExtensionsOfType

        public <E> List<E> findExtensionsOfType​(Class<E> clazz)
        Find the extensions of a specified type.
        Specified by:
        findExtensionsOfType in interface SupportsExtensionElements
        Type Parameters:
        E - The type.
        Parameters:
        clazz - The type.
        Returns:
        The extensions, possibly empty but not null.
      • findExtensionOfType

        public <E> E findExtensionOfType​(Class<E> clazz,
                                         String name,
                                         String namespace)
        Finds the first extension of a specified type in the given name and namespace.
        Type Parameters:
        E - The type of extension elements.
        Parameters:
        clazz - The type.
        name - The name of the extension element.
        namespace - The namespace of the extension element.
        Returns:
        The extension, or null if none found.
      • findExtensionsOfType

        public <E> List<E> findExtensionsOfType​(Class<E> clazz,
                                                String name,
                                                String namespace)
        Find the extension elements of a specified type in the given name and namespace.
        Type Parameters:
        E - The type of extension elements.
        Parameters:
        clazz - The type of the extension element.
        name - The name of the extension element.
        namespace - The namespace of the extension element.
        Returns:
        The extensions, possibly empty but not null.
      • setTransientProperty

        public void setTransientProperty​(String name,
                                         Object value)
        Set a transient (non-serialized) property.
        Specified by:
        setTransientProperty in interface HasTransientProperties
        Parameters:
        name - the name of the property.
        value - the property value.
      • toString

        public String toString()
        Provide a simple toString() method.
        Overrides:
        toString in class Object