Java Code Examples for java.util.Objects#equals()

The following examples show how to use java.util.Objects#equals() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  RemoteProcessGroupPortDTO remoteProcessGroupPortDTO = (RemoteProcessGroupPortDTO) o;
  return Objects.equals(this.id, remoteProcessGroupPortDTO.id) &&
      Objects.equals(this.groupId, remoteProcessGroupPortDTO.groupId) &&
      Objects.equals(this.name, remoteProcessGroupPortDTO.name) &&
      Objects.equals(this.comments, remoteProcessGroupPortDTO.comments) &&
      Objects.equals(this.concurrentlySchedulableTaskCount, remoteProcessGroupPortDTO.concurrentlySchedulableTaskCount) &&
      Objects.equals(this.transmitting, remoteProcessGroupPortDTO.transmitting) &&
      Objects.equals(this.useCompression, remoteProcessGroupPortDTO.useCompression) &&
      Objects.equals(this.exists, remoteProcessGroupPortDTO.exists) &&
      Objects.equals(this.targetRunning, remoteProcessGroupPortDTO.targetRunning) &&
      Objects.equals(this.connected, remoteProcessGroupPortDTO.connected);
}
 
Example 2
Source Project: SB_Elsinore_Server   File: Quantity.java    License: MIT License 6 votes vote down vote up
static private String getAbrvFromUnit(String t, String s){
	int i=0;	
	Converter[] u;

	if (Objects.equals(t, "vol"))
		u = volUnits;
	else if (Objects.equals(t, "pressure"))
		u = pressureUnits;
	else // assume weight
		u = weightUnits;

	while (i < u.length
			&& !u[i].unit.equalsIgnoreCase(s)) {
		i++;
	}
	if (i >= u.length)
		return null;
	else 
		return u[i].abrv;
}
 
Example 3
@SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067"})
@Override
public boolean equals(@Nullable final Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null || getClass() != obj.getClass()) {
        return false;
    }
    final AbstractMessageCommandResponse<?, ?> other = (AbstractMessageCommandResponse<?, ?>) obj;
    return other.canEqual(this) && Objects.equals(thingId, other.thingId)
            && Objects.equals(message, other.message)
            && super.equals(other);
}
 
Example 4
Source Project: atlas   File: EntityMutations.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    EntityMutations that = (EntityMutations) o;
    return Objects.equals(entityMutations, that.entityMutations);
}
 
Example 5
Source Project: presto   File: SqlDecimal.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o)
{
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    SqlDecimal that = (SqlDecimal) o;
    return Objects.equals(unscaledValue, that.unscaledValue);
}
 
Example 6
Source Project: ditto   File: MongoQuery.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Override
public boolean equals(final Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    final MongoQuery that = (MongoQuery) o;
    return limit == that.limit &&
            skip == that.skip &&
            Objects.equals(criteria, that.criteria) &&
            Objects.equals(sortOptions, that.sortOptions);
}
 
Example 7
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
  return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
      Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
      Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
}
 
Example 8
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  QueryClusterResponse queryClusterResponse = (QueryClusterResponse) o;
  return Objects.equals(this.messageId, queryClusterResponse.messageId) &&
      Objects.equals(this.message, queryClusterResponse.message) &&
      Objects.equals(this.currentTime, queryClusterResponse.currentTime) &&
      Objects.equals(this.payload, queryClusterResponse.payload);
}
 
Example 9
Source Project: sdk   File: GatewayMonitor.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  GatewayMonitor gatewayMonitor = (GatewayMonitor) o;
  return Objects.equals(this.gatewayIp, gatewayMonitor.gatewayIp) &&
      Objects.equals(this.gatewayMonitorFailThreshold, gatewayMonitor.gatewayMonitorFailThreshold) &&
      Objects.equals(this.gatewayMonitorInterval, gatewayMonitor.gatewayMonitorInterval) &&
      Objects.equals(this.gatewayMonitorSuccessThreshold, gatewayMonitor.gatewayMonitorSuccessThreshold) &&
      Objects.equals(this.subnet, gatewayMonitor.subnet);
}
 
Example 10
Source Project: flow   File: Dependency.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    Dependency that = (Dependency) o;
    return type == that.type && loadMode == that.loadMode
            && Objects.equals(url, that.url);

}
 
Example 11
Source Project: modernmt   File: ScoreEntry.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    ScoreEntry that = (ScoreEntry) o;
    return memory == that.memory &&
            Objects.equals(language, that.language) &&
            Arrays.equals(sentenceTokens, that.sentenceTokens) &&
            Arrays.equals(translationTokens, that.translationTokens);
}
 
Example 12
@Override
public boolean equals(java.lang.Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  V1beta1SubjectRulesReviewStatus v1beta1SubjectRulesReviewStatus = (V1beta1SubjectRulesReviewStatus) o;
  return Objects.equals(this.evaluationError, v1beta1SubjectRulesReviewStatus.evaluationError) &&
      Objects.equals(this.incomplete, v1beta1SubjectRulesReviewStatus.incomplete) &&
      Objects.equals(this.nonResourceRules, v1beta1SubjectRulesReviewStatus.nonResourceRules) &&
      Objects.equals(this.resourceRules, v1beta1SubjectRulesReviewStatus.resourceRules);
}
 
Example 13
Source Project: cuba   File: DesktopLabel.java    License: Apache License 2.0 5 votes vote down vote up
protected void fireChangeListeners(Object newValue) {
    Object oldValue = prevValue;
    prevValue = newValue;
    if (!Objects.equals(oldValue, newValue)) {
        fireValueChanged(oldValue, newValue);
    }
}
 
Example 14
Source Project: alexa-apis-for-java   File: BadRequest.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(java.lang.Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    BadRequest v1SkillInteractionModelTypeBadRequest = (BadRequest) o;
    return Objects.equals(this.errors, v1SkillInteractionModelTypeBadRequest.errors) &&
        Objects.equals(this.warnings, v1SkillInteractionModelTypeBadRequest.warnings);
}
 
Example 15
Source Project: datakernel   File: DataItemString1.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
	if (this == o) return true;
	if (o == null || getClass() != o.getClass()) return false;

	DataItemString1 that = (DataItemString1) o;

	if (key2 != that.key2) return false;
	if (metric1 != that.metric1) return false;
	if (metric2 != that.metric2) return false;
	return !(!Objects.equals(key1, that.key1));

}
 
Example 16
Source Project: tinkerpop   File: Bytecode.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Binding<?> binding = (Binding<?>) o;
    return Objects.equals(key, binding.key) &&
            Objects.equals(value, binding.value);
}
 
Example 17
@Override
public boolean equals(final Object o) {
	if (this == o) {
		return true;
	}
	if (o == null || getClass() != o.getClass()) {
		return false;
	}
	final SongPlayCountBean that = (SongPlayCountBean) o;
	return Objects.equals(artist, that.artist) &&
			Objects.equals(album, that.album) &&
			Objects.equals(name, that.name) &&
			Objects.equals(plays, that.plays);
}
 
Example 18
Source Project: cubeai   File: Artifact.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
    if (this == o) {
        return true;
    }
    if (o == null || getClass() != o.getClass()) {
        return false;
    }
    Artifact artifact = (Artifact) o;
    if (artifact.getId() == null || getId() == null) {
        return false;
    }
    return Objects.equals(getId(), artifact.getId());
}
 
Example 19
Source Project: lambda   File: Either.java    License: MIT License 4 votes vote down vote up
@Override
public boolean equals(Object other) {
    return other instanceof Right && Objects.equals(r, ((Right) other).r);
}
 
Example 20
Source Project: Bytecoder   File: XIncludeHandler.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public boolean equals(Object obj) {
    return obj == this || obj instanceof UnparsedEntity
            && Objects.equals(name, ((UnparsedEntity)obj).name);
}