本文整理汇总了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);
}
}
示例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;
}
示例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());
}
示例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;
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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");
}
}