org.intermine.metadata.Util.equals()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.intermine.metadata.Util.equals()方法的一些代码示例,展示了Util.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.equals()方法的具体详情如下:
包路径:org.intermine.metadata.Util
类名称:Util
方法名:equals

Util.equals介绍

[英]Compare two objects, using their .equals method, but comparing null to null as equal.
[中]比较两个对象,使用它们的属性。equals方法,但将null与null比较为equal。

代码示例

代码示例来源:origin: org.intermine/intermine-objectstore

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  if (o instanceof PathExpressionField) {
    PathExpressionField pef = (PathExpressionField) o;
    return Util.equals(qope, pef.qope) && (fieldNumber == pef.fieldNumber);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  if (o instanceof PathExpressionField) {
    PathExpressionField pef = (PathExpressionField) o;
    return Util.equals(qope, pef.qope) && (fieldNumber == pef.fieldNumber);
  }
  return false;
}

代码示例来源:origin: org.intermine/intermine-api

/**
 * {@inheritDoc}
 */
public boolean equals(Object o) {
  if (o instanceof MultiRowFirstValue) {
    return Util.equals(value, ((MultiRowFirstValue) o).value)
      && (rowspan == ((MultiRowFirstValue) o).rowspan);
  }
  return false;
}

代码示例来源:origin: org.intermine/intermine-pathquery

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  return (o instanceof Node)
    && Util.equals(type, ((Node) o).type)
    && Util.equals(parent, ((Node) o).parent)
    && Util.equals(fieldName, ((Node) o).fieldName);
}

代码示例来源:origin: org.intermine/intermine-objectstore

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  if (o instanceof ObjectStoreBagsForObject) {
    return Util.equals(bags, ((ObjectStoreBagsForObject) o).bags)
      && Util.equals(value, ((ObjectStoreBagsForObject) o).value);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
public boolean equals(Object o) {
  if (o instanceof MultiRowFirstValue) {
    return Util.equals(value, ((MultiRowFirstValue) o).value)
      && (rowspan == ((MultiRowFirstValue) o).rowspan);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  return (o instanceof Node)
    && Util.equals(type, ((Node) o).type)
    && Util.equals(parent, ((Node) o).parent)
    && Util.equals(fieldName, ((Node) o).fieldName);
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  if (o instanceof ObjectStoreBagsForObject) {
    return Util.equals(bags, ((ObjectStoreBagsForObject) o).bags)
      && Util.equals(value, ((ObjectStoreBagsForObject) o).value);
  }
  return false;
}

代码示例来源:origin: org.intermine/intermine-objectstore

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  if (!(o instanceof IqlQuery)) {
    return false;
  }
  IqlQuery f = (IqlQuery) o;
  return f.queryString.equals(queryString)
    && Util.equals(f.packageName, packageName)
    && Util.equals(f.parameters, parameters);
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object o) {
  if (!(o instanceof IqlQuery)) {
    return false;
  }
  IqlQuery f = (IqlQuery) o;
  return f.queryString.equals(queryString)
    && Util.equals(f.packageName, packageName)
    && Util.equals(f.parameters, parameters);
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object obj) {
  if (obj instanceof BagConstraint) {
    BagConstraint bc = (BagConstraint) obj;
    return Util.equals(bag, bc.bag)
      && qn.equals(bc.qn)
      && Util.equals(osb, bc.osb);
  }
  return false;
}

代码示例来源:origin: org.intermine/intermine-objectstore

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object obj) {
  if (obj instanceof BagConstraint) {
    BagConstraint bc = (BagConstraint) obj;
    return Util.equals(bag, bc.bag)
      && qn.equals(bc.qn)
      && Util.equals(osb, bc.osb);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object obj) {
  if (obj instanceof ReferenceDescriptor) {
    ReferenceDescriptor ref = (ReferenceDescriptor) obj;
    return name.equals(ref.name)
      && referencedType.equals(ref.referencedType)
      && Util.equals(reverseRefName, ref.reverseRefName);
  }
  return false;
}

代码示例来源:origin: org.intermine/intermine-model

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object obj) {
  if (obj instanceof ReferenceDescriptor) {
    ReferenceDescriptor ref = (ReferenceDescriptor) obj;
    return name.equals(ref.name)
      && referencedType.equals(ref.referencedType)
      && Util.equals(reverseRefName, ref.reverseRefName);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

/**
 * Returns true if this is equal to the given object.
 *
 * @param o the object
 * @return a boolean
 */
@Override
public boolean equals(Object o) {
  if (o instanceof QueryField) {
    QueryField qf = (QueryField) o;
    return qc.equals(qf.qc) && fieldName.equals(qf.fieldName)
      && Util.equals(secondFieldName, qf.secondFieldName);
  }
  return false;
}

代码示例来源:origin: org.intermine/intermine-model

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object obj) {
  if (obj instanceof CollectionDescriptor) {
    CollectionDescriptor ref = (CollectionDescriptor) obj;
    return (cld == null || cld.getName().equals(ref.cld.getName()))
      && name.equals(ref.name)
      && referencedType.equals(ref.referencedType)
      && Util.equals(reverseRefName, ref.reverseRefName);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

/**
 * {@inheritDoc}
 */
@Override
public boolean equals(Object obj) {
  if (obj instanceof CollectionDescriptor) {
    CollectionDescriptor ref = (CollectionDescriptor) obj;
    return (cld == null || cld.getName().equals(ref.cld.getName()))
      && name.equals(ref.name)
      && referencedType.equals(ref.referencedType)
      && Util.equals(reverseRefName, ref.reverseRefName);
  }
  return false;
}

代码示例来源:origin: intermine/intermine

public boolean equals(Object o) {
  if (o instanceof Failure) {
    Failure f = (Failure) o;
    if (exceptionClass.equals(f.exceptionClass) && Util.equals(message, f.message)) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: intermine/intermine

public void testEquals() {
  assertTrue(org.intermine.metadata.Util.equals(null, null));
  assertTrue(org.intermine.metadata.Util.equals(new Integer(10), new Integer(10)));
  assertTrue(org.intermine.metadata.Util.equals(new Integer(20), new Integer(10)) == false);
  assertTrue(org.intermine.metadata.Util.equals(null, new Integer(10)) == false);
  assertTrue(org.intermine.metadata.Util.equals(new Integer(10), null) == false);
}

代码示例来源:origin: intermine/intermine

public void testEquals() {
  assertTrue(org.intermine.metadata.Util.equals(null, null));
  assertTrue(org.intermine.metadata.Util.equals(new Integer(10), new Integer(10)));
  assertTrue(org.intermine.metadata.Util.equals(new Integer(20), new Integer(10)) == false);
  assertTrue(org.intermine.metadata.Util.equals(null, new Integer(10)) == false);
  assertTrue(org.intermine.metadata.Util.equals(new Integer(10), null) == false);
}

相关文章