当前位置: 首页>>代码示例>>Java>>正文


Java Objects.equals方法代码示例

本文整理汇总了Java中java.util.Objects.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Objects.equals方法的具体用法?Java Objects.equals怎么用?Java Objects.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Objects的用法示例。


在下文中一共展示了Objects.equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerQueue

import java.util.Objects; //导入方法依赖的package包/类
/**
 * Зарегистрировать очередь.
 *
 * @param <T>           тип данных задачи
 * @param queueConsumer обработчик очереди
 * @param queueProducer постановщик задачи в очередь
 */
public synchronized <T> void registerQueue(@Nonnull QueueConsumer<T> queueConsumer,
                                           @Nonnull QueueProducer<T> queueProducer) {
    Objects.requireNonNull(queueConsumer);
    Objects.requireNonNull(queueProducer);
    ensureConstructionInProgress();
    QueueId queueId = queueConsumer.getQueueConfig().getLocation().getQueueId();

    if (!Objects.equals(queueConsumer.getQueueConfig(), queueProducer.getQueueConfig())) {
        errorMessages.add(String.format("queue config must be the same: queueId=%s, producer=%s, " +
                "consumer=%s", queueId, queueProducer.getQueueConfig(), queueConsumer.getQueueConfig()));
    }

    if (!Objects.equals(queueProducer.getPayloadTransformer(), queueConsumer.getPayloadTransformer())) {
        errorMessages.add(String.format("payload transformers must be the same: queueId=%s", queueId));
    }

    if (!Objects.equals(queueProducer.getShardRouter(), queueConsumer.getShardRouter())) {
        errorMessages.add(String.format("shard routers must be the same: queueId=%s", queueId));
    }

    if (consumers.putIfAbsent(queueId, queueConsumer) != null) {
        errorMessages.add("duplicate queue: queueId=" + queueId);
    }
}
 
开发者ID:yandex-money,项目名称:db-queue,代码行数:32,代码来源:QueueRegistry.java

示例2: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(Object object) {

	if (!(object instanceof ProviderChannel))
		return false;
	
	if (this == object)
		return true;
	
	ProviderChannel providerChannel = (ProviderChannel) object;
	
	return Objects.equals(providerAddress, providerChannel.providerAddress) &&
			Objects.equals(userAddress, providerChannel.userAddress) &&
			Objects.equals(revokeAddress, providerChannel.revokeAddress) &&
			Objects.equals(bitmask, providerChannel.bitmask) &&
			Objects.equals(revokeTxId, providerChannel.revokeTxId) &&
			creationTime == providerChannel.creationTime;
}
 
开发者ID:uniquid,项目名称:uidcore-java,代码行数:19,代码来源:ProviderChannel.java

示例3: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(Object other)
{
    if (this == other)
        return true;

    if(!(other instanceof Cell))
        return false;

    Cell that = (Cell)other;
    return this.column().equals(that.column())
        && this.isCounterCell() == that.isCounterCell()
        && this.timestamp() == that.timestamp()
        && this.ttl() == that.ttl()
        && this.localDeletionTime() == that.localDeletionTime()
        && Objects.equals(this.value(), that.value())
        && Objects.equals(this.path(), that.path());
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:19,代码来源:AbstractCell.java

示例4: filterForStringValue

import java.util.Objects; //导入方法依赖的package包/类
/***************************** static methods *****************************/

	public static List<ManyFieldBean> filterForStringValue(Collection<ManyFieldBean> ins, String value){
		List<ManyFieldBean> outs = new LinkedList<>();
		for(ManyFieldBean in : IterableTool.nullSafe(ins)){
			if(Objects.equals(in.getStringField(), value)){
				outs.add(in);
			}
		}
		return outs;
	}
 
开发者ID:hotpads,项目名称:datarouter,代码行数:12,代码来源:ManyFieldBean.java

示例5: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Operation operation = (Operation) o;
  return Objects.equals(this.name, operation.name) &&
      Objects.equals(this.description, operation.description) &&
      Objects.equals(this.params, operation.params);
}
 
开发者ID:deelam,项目名称:agilion,代码行数:14,代码来源:Operation.java

示例6: getLinkedTarget

import java.util.Objects; //导入方法依赖的package包/类
public static Optional<XmEntity> getLinkedTarget(XmEntity xmEntity, String linkTypeKey, String linkTargetTypeKey) {
    Optional<Link> firstLink = findFirstLink(xmEntity, linkTypeKey);
    if (firstLink.isPresent()) {
        Link link = firstLink.get();
        XmEntity target = Objects.requireNonNull(link.getTarget(), "Link with type key '" + linkTypeKey + "' has null target");
        if (Objects.equals(target.getTypeKey(), linkTargetTypeKey)) {
            return Optional.of(target);
        }
    }

    return Optional.empty();
}
 
开发者ID:xm-online,项目名称:xm-ms-entity,代码行数:13,代码来源:XmEntityUtils.java

示例7: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  ResponseTimeMonitorData responseTimeMonitorData = (ResponseTimeMonitorData) o;
  return Objects.equals(propertyClass, responseTimeMonitorData.propertyClass) &&
      Objects.equals(timestamp, responseTimeMonitorData.timestamp) &&
      Objects.equals(average, responseTimeMonitorData.average);
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:14,代码来源:ResponseTimeMonitorData.java

示例8: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(Object o)
{
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    ExceptionClassification that = (ExceptionClassification) o;
    return Objects.equals(retry, that.retry) &&
            hostStatus == that.hostStatus;
}
 
开发者ID:airlift,项目名称:drift,代码行数:14,代码来源:ExceptionClassification.java

示例9: hasDebugLogEnabled

import java.util.Objects; //导入方法依赖的package包/类
public ConfigurationAssert hasDebugLogEnabled(boolean debug) {
    isNotNull();

    if (!Objects.equals(actual.isDebug(), debug)) {
        failWithMessage("Expected debug to be <%s> but was <%s>", debug, actual.isDebug());
    }
    return this;
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:9,代码来源:ConfigurationAssert.java

示例10: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Error error = (Error) o;
  return Objects.equals(this.message, error.message) &&
      Objects.equals(this.error, error.error);
}
 
开发者ID:jrtechnologies,项目名称:yum,代码行数:13,代码来源:Error.java

示例11: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }

    final VersionedFlowSnapshotMetadata other = (VersionedFlowSnapshotMetadata) obj;

    return Objects.equals(this.flowIdentifier, other.flowIdentifier)
            && Objects.equals(this.version, other.version);
}
 
开发者ID:apache,项目名称:nifi-registry,代码行数:15,代码来源:VersionedFlowSnapshotMetadata.java

示例12: create

import java.util.Objects; //导入方法依赖的package包/类
void create(Exercise exercise) {
    if (Objects.equals(exercise.getId(), DEFAULT_ID)) {
        exercise.setId(System.currentTimeMillis());
        DatabaseFacade.getDefault().getCrudService().create(exercise);
    }
    else {
        this.update(exercise);
    }
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:10,代码来源:ExerciseSqlService.java

示例13: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || getClass() != obj.getClass()) {
        return false;
    }
    final PersistentObject other = (PersistentObject) obj;
    return Objects.equals(this.id, other.id);
}
 
开发者ID:TNG,项目名称:ArchUnit,代码行数:12,代码来源:PersistentObject.java

示例14: equals

import java.util.Objects; //导入方法依赖的package包/类
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  Login login = (Login) o;
  return Objects.equals(this.email, login.email) &&
      Objects.equals(this.password, login.password) &&
      Objects.equals(this.username, login.username);

}
 
开发者ID:jrtechnologies,项目名称:yum,代码行数:15,代码来源:Login.java

示例15: stop

import java.util.Objects; //导入方法依赖的package包/类
/**
 * stop speech
 */
public void stop() {

  if (Objects.equals(OS, "mac")) {
    Variables.macVoice.stop();
  } else if (Objects.equals(OS, "win")) {
    Variables.winVoice.stop();
  } else if (Objects.equals(OS, "unix")) {
    Variables.uniVoice.stop();
  } else {
    System.out.println("Voices are not supported");
  }
}
 
开发者ID:vaclav,项目名称:voicemenu,代码行数:16,代码来源:myVoice.java


注:本文中的java.util.Objects.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。