mockobjecttype.java

来自「rule engine drools-2.0-beta-18」· Java 代码 · 共 59 行

JAVA
59
字号
package org.drools;import org.drools.spi.ObjectType;public class MockObjectType implements ObjectType{    private Class type;    public MockObjectType()    {    }    public MockObjectType(Class type)    {        this.type = type;    }    public boolean matches(Object object)    {        if ( this.type == null )        {            return true;        }        return this.type.isInstance( object );    }    public boolean equals(Object thatObj)    {        if ( thatObj instanceof MockObjectType )        {            MockObjectType that = ( MockObjectType ) thatObj;            if ( this.type == null && that.type == null )            {                return true;            }            if ( this.type == null || that.type == null )            {                return false;            }            return this.type.equals( that.type );        }        return false;    }    public int hashCode()    {        if ( this.type == null )        {            return 0;        }        return this.type.hashCode( );    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?