本文整理汇总了Java中com.google.common.collect.Iterables.elementsEqual方法的典型用法代码示例。如果您正苦于以下问题:Java Iterables.elementsEqual方法的具体用法?Java Iterables.elementsEqual怎么用?Java Iterables.elementsEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Iterables
的用法示例。
在下文中一共展示了Iterables.elementsEqual方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean equals(Object other)
{
if(!(other instanceof Row))
return false;
Row that = (Row)other;
if (!this.clustering().equals(that.clustering())
|| !this.primaryKeyLivenessInfo().equals(that.primaryKeyLivenessInfo())
|| !this.deletion().equals(that.deletion()))
return false;
return Iterables.elementsEqual(this, that);
}
示例2: equals
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
if (obj instanceof MultiWeakClassSet) {
MultiWeakClassSet other = Cast.uncheckedCast(obj);
if (other.references.size() == references.size()) {
return Iterables.elementsEqual(
Iterables.transform(other.references, UNPACK_REF),
Iterables.transform(references, UNPACK_REF)
);
}
}
return false;
}
示例3: equals
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override public boolean equals(Object obj) {
if (obj instanceof MetricsRecord) {
final MetricsRecord other = (MetricsRecord) obj;
return Objects.equal(timestamp(), other.timestamp()) &&
Objects.equal(name(), other.name()) &&
Objects.equal(description(), other.description()) &&
Objects.equal(tags(), other.tags()) &&
Iterables.elementsEqual(metrics(), other.metrics());
}
return false;
}
示例4: equals
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
if (obj instanceof CategoryContextMapping) {
CategoryContextMapping other = (CategoryContextMapping) obj;
if (this.fieldName.equals(other.fieldName)) {
return Iterables.elementsEqual(this.defaultValues, other.defaultValues);
}
}
return false;
}
示例5: equals
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
@Override public boolean equals(Object o) {
if (o instanceof EncodedArrayKey) {
EncodedArrayKey other = (EncodedArrayKey)o;
if (elements.size() != other.elements.size()) {
return false;
}
return Iterables.elementsEqual(elements, other.elements);
}
return false;
}
示例6: checkParsing
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
private void checkParsing(ParsedLine parsed, Iterable<String> expected) {
ArrayList<String> parsedCols = new ArrayList<String>();
for (int i = 0; i < parsed.getColumnCount(); i++) {
parsedCols.add(Bytes.toString(parsed.getLineBytes(), parsed.getColumnOffset(i),
parsed.getColumnLength(i)));
}
if (!Iterables.elementsEqual(parsedCols, expected)) {
fail("Expected: " + Joiner.on(",").join(expected) + "\n" + "Got:"
+ Joiner.on(",").join(parsedCols));
}
}
示例7: elementsEqual
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
/**
* 两个集合中的所有元素按顺序相等.
*/
public static boolean elementsEqual(Iterable<?> iterable1, Iterable<?> iterable2) {
return Iterables.elementsEqual(iterable1, iterable2);
}
示例8: mappingsAreEqual
import com.google.common.collect.Iterables; //导入方法依赖的package包/类
/**
* Test equality of two mapping
*
* @param thisMappings first mapping
* @param otherMappings second mapping
*
* @return true if both arguments are equal
*/
public static boolean mappingsAreEqual(SortedMap<String, ? extends ContextMapping> thisMappings, SortedMap<String, ? extends ContextMapping> otherMappings) {
return Iterables.elementsEqual(thisMappings.entrySet(), otherMappings.entrySet());
}