org.drools.impl.adapters.FactHandleAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of knowledge-api Show documentation
Show all versions of knowledge-api Show documentation
The Drools and jBPM public API which is backwards compatible between releases.
package org.drools.impl.adapters;
import org.drools.definition.rule.Rule;
import org.kie.api.runtime.rule.FactHandle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class FactHandleAdapter implements org.drools.runtime.rule.FactHandle {
private final FactHandle delegate;
public FactHandleAdapter(FactHandle delegate) {
this.delegate = delegate;
}
public String toExternalForm() {
return delegate.toExternalForm();
}
public FactHandle getDelegate() {
return delegate;
}
public static List adaptFactHandles(Collection factHandles) {
List result = new ArrayList();
for (FactHandle factHandle : factHandles) {
result.add(new FactHandleAdapter(factHandle));
}
return result;
}
@Override
public int hashCode() {
return delegate.hashCode();
}
@Override
public boolean equals(Object obj) {
return obj instanceof FactHandleAdapter && delegate.equals(((FactHandleAdapter)obj).delegate);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy