-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DROOLS-2625] fix annotations usage and array access in executable mo…
…del (#1944) [DROOLS-2625] fix annotations usage and array access in executable model
- Loading branch information
1 parent
40b2d10
commit d41c3c1
Showing
40 changed files
with
999 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
drools-model/drools-canonical-model/src/main/java/org/drools/model/From3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2005 JBoss Inc | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.drools.model; | ||
|
||
import org.drools.model.functions.Function3; | ||
|
||
public interface From3<A, B, C> extends From<A> { | ||
Variable<B> getVariable2(); | ||
Variable<C> getVariable3(); | ||
Function3<A,B,C,?> getProvider(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
drools-model/drools-canonical-model/src/main/java/org/drools/model/impl/From3Impl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* Copyright 2005 JBoss Inc | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.drools.model.impl; | ||
|
||
import org.drools.model.From3; | ||
import org.drools.model.Variable; | ||
import org.drools.model.functions.Function3; | ||
|
||
public class From3Impl<A, B, C> implements From3<A, B, C>, ModelComponent { | ||
|
||
private final Variable<A> var1; | ||
private final Variable<B> var2; | ||
private final Variable<C> var3; | ||
private final Function3<A, B, C, ?> provider; | ||
private final boolean reactive; | ||
|
||
public From3Impl( Variable<A> var1, Variable<B> var2, Variable<C> var3, Function3<A, B, C, ?> provider ) { | ||
this(var1, var2, var3, provider, false); | ||
} | ||
|
||
public From3Impl( Variable<A> var1, Variable<B> var2, Variable<C> var3, Function3<A, B, C, ?> provider, boolean reactive ) { | ||
this.var1 = var1; | ||
this.var2 = var2; | ||
this.var3 = var3; | ||
this.provider = provider; | ||
this.reactive = reactive; | ||
} | ||
|
||
@Override | ||
public Variable<A> getVariable() { | ||
return var1; | ||
} | ||
|
||
@Override | ||
public Variable<B> getVariable2() { | ||
return var2; | ||
} | ||
|
||
@Override | ||
public Variable<C> getVariable3() { | ||
return var3; | ||
} | ||
|
||
@Override | ||
public Function3<A, B, C, ?> getProvider() { | ||
return provider; | ||
} | ||
|
||
@Override | ||
public boolean isReactive() { | ||
return reactive; | ||
} | ||
|
||
@Override | ||
public boolean isEqualTo( ModelComponent o ) { | ||
if ( this == o ) return true; | ||
if ( !(o instanceof From3Impl) ) return false; | ||
|
||
From3Impl<?,?,?> from = ( From3Impl<?,?,?> ) o; | ||
|
||
if ( reactive != from.reactive ) return false; | ||
if ( !ModelComponent.areEqualInModel( var1, from.var1 ) ) return false; | ||
if ( !ModelComponent.areEqualInModel( var2, from.var2 ) ) return false; | ||
if ( !ModelComponent.areEqualInModel( var3, from.var3 ) ) return false; | ||
return provider != null ? provider.equals( from.provider ) : from.provider == null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.