src/main/java/com/inari/firefly/system/FFContext.java
/** Use this to dispose a specified {@link FFSystem} that was loaded into the context.
     * @param key {@link FFSystemTypeKey} specifies the {@link FFSystem}
     */
Use this to dispose a specified  FFSystem that was loaded into the context.
Use this to dispose a specified FFSystem that was loaded into the context .
public final <T extends FFSystem> FFContext disposeSystem( FFSystemTypeKey<T> key ) {
        @SuppressWarnings( "unchecked" )
        final T system = (T) systems.remove( key.index() );
        if ( system != null ) {
            system.dispose( this );
            if ( system instanceof ComponentSystem ) {
                @SuppressWarnings( { "unchecked", "rawtypes" } )
                Set<SystemBuilderAdapter<?>> supportedBuilderAdapter = ( (ComponentSystem) system ).getSupportedBuilderAdapter();
                if ( supportedBuilderAdapter != null ) {
                    for ( SystemBuilderAdapter<?> builderAdapter : supportedBuilderAdapter ) {
                        systemBuilderAdapter.remove( builderAdapter.componentTypeKey().index() );
                    }
                }
            }
        }
        return this;
    }
public final < T extends FFSystem > FFContext disposeSystem ( FFSystemTypeKey < T > key ) { @ SuppressWarnings ( "unchecked" ) final T system = ( T ) systems . remove ( key . index ( ) ) ; if ( system != null ) { system . dispose ( this ) ; if ( system instanceof ComponentSystem ) { @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) Set < SystemBuilderAdapter < ? > > supportedBuilderAdapter = ( ( ComponentSystem ) system ) . getSupportedBuilderAdapter ( ) ; if ( supportedBuilderAdapter != null ) { for ( SystemBuilderAdapter < ? > builderAdapter : supportedBuilderAdapter ) { systemBuilderAdapter . remove ( builderAdapter . componentTypeKey ( ) . index ( ) ) ; } } } } return this ; }
Use this to dispose a specified {@link FFSystem} that was loaded into the context.
Use this to dispose a specified { @link FFSystem } that was loaded into the context .