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

The following examples show how to use java.util.Objects#equals() . 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 check out the related API usage on the sidebar.
Example 1
Source File: Quantity.java    From SB_Elsinore_Server with 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 2
Source File: RemoteProcessGroupPortDTO.java    From nifi-api-client-java with Apache License 2.0 6 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;
  }
  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 3
Source File: Artifact.java    From cubeai with 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 4
Source File: SongPlayCountBean.java    From spring-cloud-stream-samples with Apache 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 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 5
Source File: Bytecode.java    From tinkerpop with 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 6
Source File: DataItemString1.java    From datakernel with 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 7
Source File: BadRequest.java    From alexa-apis-for-java with 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 8
Source File: DesktopLabel.java    From cuba with 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 9
Source File: V1beta1SubjectRulesReviewStatus.java    From java with 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;
  }
  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 10
Source File: ScoreEntry.java    From modernmt with 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 11
Source File: Dependency.java    From flow with 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 12
Source File: GatewayMonitor.java    From sdk with 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 13
Source File: QueryClusterResponse.java    From huaweicloud-cs-sdk with 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;
  }
  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 14
Source File: MixedPropertiesAndAdditionalPropertiesClass.java    From openapi-generator with 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;
  }
  MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
  return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
      Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
      Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
}
 
Example 15
Source File: MongoQuery.java    From ditto with 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 16
Source File: SqlDecimal.java    From presto with 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 17
Source File: EntityMutations.java    From atlas with 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 18
Source File: AbstractMessageCommandResponse.java    From ditto with Eclipse Public License 2.0 5 votes vote down vote up
@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 19
Source File: Either.java    From lambda with 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 File: XIncludeHandler.java    From Bytecoder with 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);
}