Class AbstractExtendable<T>

    • Constructor Detail

      • AbstractExtendable

        public AbstractExtendable()
    • Method Detail

      • addExtension

        public <E extends Extension<T>> void addExtension​(Class<? super E> type,
                                                          E extension)
        Description copied from interface: Extendable
        Add en extension to this extendable object.
        Specified by:
        addExtension in interface Extendable<T>
        Type Parameters:
        E - the extension type
        Parameters:
        type - the extension class type
        extension - the extension
      • getExtension

        public <E extends Extension<T>> E getExtension​(Class<? super E> type)
        Description copied from interface: Extendable
        Get an extension based on its class type.
        Specified by:
        getExtension in interface Extendable<T>
        Type Parameters:
        E - the extension type
        Parameters:
        type - the extension class type
        Returns:
        the extension mapped to the class type or null if not found
      • getExtensionByName

        public <E extends Extension<T>> E getExtensionByName​(String name)
        Description copied from interface: Extendable
        Get an extension based on its name.
        Specified by:
        getExtensionByName in interface Extendable<T>
        Parameters:
        name - the extension name
        Returns:
        the extension mapped to the name or null if not found
      • removeExtension

        public <E extends Extension<T>> boolean removeExtension​(Class<E> type)
        Description copied from interface: Extendable
        Remove an extension based on its class type.
        Specified by:
        removeExtension in interface Extendable<T>
        Type Parameters:
        E - the extension type
        Parameters:
        type - the extension class type
        Returns:
        true if the extension has been removed false if extension has not been found
      • getExtensions

        public Collection<Extension<T>> getExtensions()
        Description copied from interface: Extendable
        Get all extensions associated with this extendable object..
        Specified by:
        getExtensions in interface Extendable<T>
        Returns:
        all extensions associated to this extendable object.