當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。