Package org.drools.factmodel.traits

Examples of org.drools.factmodel.traits.Thing


        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here


        if ( h.isTrait() ) {
            if ( ( (TraitFactHandle) h ).isTraitable() ) {
                // this is a traitable core object, so its traits must be updated as well
                updateTraits( h.getObject(), mask, null, modifiedClass );
            } else {
                Thing x = (Thing) h.getObject();
                // in case this is a proxy
                if ( x != x.getCore() ) {
                    Object core = x.getCore();
                    InternalFactHandle coreHandle = (InternalFactHandle) getFactHandle( core );
                    ((InternalWorkingMemoryEntryPoint) coreHandle.getEntryPoint()).update(
                            coreHandle,
                            core,
                            mask,
View Full Code Here

        ( (TraitableBean<K,? extends TraitableBean>) thing.getCore() ).allowTrait( trait );
        return thing;
    }

    public <T,K> Thing<K> grant( K core, Class<T> trait ) {
        Thing thing = don( core, Thing.class );
        ( (TraitableBean<K,? extends TraitableBean>) thing.getCore() ).allowTrait( trait );
        return thing;
    }
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

        return shed((TraitableBean<K>) thing.getCore(), trait);
    }

    public <T,K> Thing<K> shed( TraitableBean<K> core, Class<T> trait ) {
        retract( core.removeTrait( trait.getName() ) );
        Thing thing = core.getTrait( Thing.class.getName() );
        update( thing );
        return thing;
    }
View Full Code Here

TOP

Related Classes of org.drools.factmodel.traits.Thing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.