本文整理汇总了Java中java.util.Objects类的典型用法代码示例。如果您正苦于以下问题:Java Objects类的具体用法?Java Objects怎么用?Java Objects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Objects类属于java.util包,在下文中一共展示了Objects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import java.util.Objects; //导入依赖的package包/类
@Override
public boolean equals(Object obj)
{
if( obj == null || !(obj instanceof VeryBasicSearch) )
{
return false;
}
else if( this == obj )
{
return true;
}
else
{
VeryBasicSearch rhs = (VeryBasicSearch) obj;
return Objects.equals(query, rhs.query) && Objects.equals(queryTokens, rhs.queryTokens)
&& Objects.equals(freeTextQuery, rhs.freeTextQuery);
}
}
示例2: 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;
}
V1Discount v1Discount = (V1Discount) o;
return Objects.equals(this.id, v1Discount.id) &&
Objects.equals(this.name, v1Discount.name) &&
Objects.equals(this.rate, v1Discount.rate) &&
Objects.equals(this.amountMoney, v1Discount.amountMoney) &&
Objects.equals(this.discountType, v1Discount.discountType) &&
Objects.equals(this.pinRequired, v1Discount.pinRequired) &&
Objects.equals(this.color, v1Discount.color);
}
示例3: forEachRemaining
import java.util.Objects; //导入依赖的package包/类
@Override
public void forEachRemaining(IntConsumer consumer) {
Objects.requireNonNull(consumer);
int i = from;
final int hUpTo = upTo;
int hLast = last;
from = upTo;
last = 0;
while (i < hUpTo) {
consumer.accept(i++);
}
if (hLast > 0) {
// Last element of closed range
consumer.accept(i);
}
}
示例4: getFinalization
import java.util.Objects; //导入依赖的package包/类
/**
* Algorithm 7.37: GetFinalization
*
* @param i the voter index
* @param upper_bold_p the point matrix, one point per voter per candidate
* @param upper_b the current ballot list
* @return this authority's part of the finalization code
*/
public FinalizationCodePart getFinalization(Integer i, List<List<Point>> upper_bold_p, Collection<BallotEntry> upper_b) {
BigInteger p_prime = publicParameters.getPrimeField().getP_prime();
Preconditions.checkArgument(upper_bold_p.stream().flatMap(Collection::stream)
.allMatch(point -> BigInteger.ZERO.compareTo(point.x) <= 0 &&
point.x.compareTo(p_prime) < 0 &&
BigInteger.ZERO.compareTo(point.y) <= 0 &&
point.y.compareTo(p_prime) < 0),
"All points' coordinates must be in Z_p_prime");
Preconditions.checkElementIndex(i, upper_bold_p.size());
Object[] bold_p_i = upper_bold_p.get(i).toArray();
byte[] upper_f_i = ByteArrayUtils.truncate(hash.recHash_L(bold_p_i), publicParameters.getUpper_l_f());
BallotEntry ballotEntry = upper_b.stream().filter(b -> Objects.equals(b.getI(), i)).findFirst().orElseThrow(
() -> new BallotNotFoundRuntimeException(String.format("Couldn't find any ballot for voter %d", i))
);
return new FinalizationCodePart(upper_f_i, ballotEntry.getBold_r());
}
开发者ID:republique-et-canton-de-geneve,项目名称:chvote-protocol-poc,代码行数:28,代码来源:VoteConfirmationAuthorityAlgorithms.java
示例5: ofStrict
import java.util.Objects; //导入依赖的package包/类
/**
* Obtains an instance of {@code ZonedDateTime} strictly validating the
* combination of local date-time, offset and zone ID.
* <p>
* This creates a zoned date-time ensuring that the offset is valid for the
* local date-time according to the rules of the specified zone.
* If the offset is invalid, an exception is thrown.
*
* @param localDateTime the local date-time, not null
* @param offset the zone offset, not null
* @param zone the time-zone, not null
* @return the zoned date-time, not null
*/
public static ZonedDateTime ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone) {
Objects.requireNonNull(localDateTime, "localDateTime");
Objects.requireNonNull(offset, "offset");
Objects.requireNonNull(zone, "zone");
ZoneRules rules = zone.getRules();
if (rules.isValidOffset(localDateTime, offset) == false) {
ZoneOffsetTransition trans = rules.getTransition(localDateTime);
if (trans != null && trans.isGap()) {
// error message says daylight savings for simplicity
// even though there are other kinds of gaps
throw new DateTimeException("LocalDateTime '" + localDateTime +
"' does not exist in zone '" + zone +
"' due to a gap in the local time-line, typically caused by daylight savings");
}
throw new DateTimeException("ZoneOffset '" + offset + "' is not valid for LocalDateTime '" +
localDateTime + "' in zone '" + zone + "'");
}
return new ZonedDateTime(localDateTime, offset, zone);
}
示例6: 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;
}
HudsonMasterComputermonitorData hudsonMasterComputermonitorData = (HudsonMasterComputermonitorData) o;
return Objects.equals(this.hudsonNodeMonitorsSwapSpaceMonitor, hudsonMasterComputermonitorData.hudsonNodeMonitorsSwapSpaceMonitor) &&
Objects.equals(this.hudsonNodeMonitorsTemporarySpaceMonitor, hudsonMasterComputermonitorData.hudsonNodeMonitorsTemporarySpaceMonitor) &&
Objects.equals(this.hudsonNodeMonitorsDiskSpaceMonitor, hudsonMasterComputermonitorData.hudsonNodeMonitorsDiskSpaceMonitor) &&
Objects.equals(this.hudsonNodeMonitorsArchitectureMonitor, hudsonMasterComputermonitorData.hudsonNodeMonitorsArchitectureMonitor) &&
Objects.equals(this.hudsonNodeMonitorsResponseTimeMonitor, hudsonMasterComputermonitorData.hudsonNodeMonitorsResponseTimeMonitor) &&
Objects.equals(this.hudsonNodeMonitorsClockMonitor, hudsonMasterComputermonitorData.hudsonNodeMonitorsClockMonitor) &&
Objects.equals(this.propertyClass, hudsonMasterComputermonitorData.propertyClass);
}
示例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;
}
CampaignDeviceMetadata campaignDeviceMetadata = (CampaignDeviceMetadata) o;
return Objects.equals(this.description, campaignDeviceMetadata.description) &&
Objects.equals(this.campaign, campaignDeviceMetadata.campaign) &&
Objects.equals(this.createdAt, campaignDeviceMetadata.createdAt) &&
Objects.equals(this.object, campaignDeviceMetadata.object) &&
Objects.equals(this.updatedAt, campaignDeviceMetadata.updatedAt) &&
Objects.equals(this.mechanism, campaignDeviceMetadata.mechanism) &&
Objects.equals(this.name, campaignDeviceMetadata.name) &&
Objects.equals(this.etag, campaignDeviceMetadata.etag) &&
Objects.equals(this.mechanismUrl, campaignDeviceMetadata.mechanismUrl) &&
Objects.equals(this.deploymentState, campaignDeviceMetadata.deploymentState) &&
Objects.equals(this.id, campaignDeviceMetadata.id) &&
Objects.equals(this.deviceId, campaignDeviceMetadata.deviceId);
}
示例8: getStatusMessageKey
import java.util.Objects; //导入依赖的package包/类
protected String getStatusMessageKey() {
if (Validator.isNotNull(_messageKey)) {
return _messageKey;
}
_messageKey = StringPool.BLANK;
if (hasRemoteMessage()) {
_messageKey = "please-wait-as-the-publication-processes-on-the-remote-site";
} else if (hasStagedModelMessage()) {
_messageKey = "exporting";
if (Objects.equals(_cmd, Constants.IMPORT)) {
_messageKey = "importing";
} else if (Objects.equals(_cmd, Constants.PUBLISH_TO_LIVE)
|| Objects.equals(_cmd, Constants.PUBLISH_TO_REMOTE)) {
_messageKey = "publishing";
}
}
return _messageKey;
}
示例9: 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;
}
EidasCycle0And1MatchRequestSentState that = (EidasCycle0And1MatchRequestSentState) o;
return Objects.equals(encryptedIdentityAssertion, that.encryptedIdentityAssertion) &&
Objects.equals(persistentId, that.persistentId) &&
getTransactionSupportsEidas() == that.getTransactionSupportsEidas() &&
Objects.equals(getRequestId(), that.getRequestId()) &&
Objects.equals(getRequestIssuerEntityId(), that.getRequestIssuerEntityId()) &&
Objects.equals(getSessionExpiryTimestamp(), that.getSessionExpiryTimestamp()) &&
Objects.equals(getAssertionConsumerServiceUri(), that.getAssertionConsumerServiceUri()) &&
Objects.equals(getSessionId(), that.getSessionId()) &&
Objects.equals(getIdentityProviderEntityId(), that.getIdentityProviderEntityId()) &&
Objects.equals(getRelayState(), that.getRelayState()) &&
Objects.equals(getRequestSentTime(), that.getRequestSentTime()) &&
getIdpLevelOfAssurance() == that.getIdpLevelOfAssurance() &&
Objects.equals(getMatchingServiceAdapterEntityId(), that.getMatchingServiceAdapterEntityId());
}
示例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;
}
SearchCatalogObjectsRequest searchCatalogObjectsRequest = (SearchCatalogObjectsRequest) o;
return Objects.equals(this.cursor, searchCatalogObjectsRequest.cursor) &&
Objects.equals(this.objectTypes, searchCatalogObjectsRequest.objectTypes) &&
Objects.equals(this.includeDeletedObjects, searchCatalogObjectsRequest.includeDeletedObjects) &&
Objects.equals(this.includeRelatedObjects, searchCatalogObjectsRequest.includeRelatedObjects) &&
Objects.equals(this.beginTime, searchCatalogObjectsRequest.beginTime) &&
Objects.equals(this.query, searchCatalogObjectsRequest.query) &&
Objects.equals(this.limit, searchCatalogObjectsRequest.limit);
}
示例11: 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;
}
CreateTable o = (CreateTable) obj;
return Objects.equals(name, o.name) &&
Objects.equals(elements, o.elements) &&
Objects.equals(notExists, o.notExists) &&
Objects.equals(properties, o.properties) &&
Objects.equals(comment, o.comment);
}
示例12: getEdges
import java.util.Objects; //导入依赖的package包/类
public static Iterator<TinkerEdge> getEdges(final TinkerVertex vertex, final Direction direction, final String... edgeLabels) {
final List<Edge> edges = new ArrayList<>();
if (direction.equals(Direction.OUT) || direction.equals(Direction.BOTH)) {
if (vertex.outEdges != null) {
if (edgeLabels.length == 0)
vertex.outEdges.values().forEach(edges::addAll);
else if (edgeLabels.length == 1)
edges.addAll(vertex.outEdges.getOrDefault(edgeLabels[0], Collections.emptySet()));
else
Stream.of(edgeLabels).map(vertex.outEdges::get).filter(Objects::nonNull).forEach(edges::addAll);
}
}
if (direction.equals(Direction.IN) || direction.equals(Direction.BOTH)) {
if (vertex.inEdges != null) {
if (edgeLabels.length == 0)
vertex.inEdges.values().forEach(edges::addAll);
else if (edgeLabels.length == 1)
edges.addAll(vertex.inEdges.getOrDefault(edgeLabels[0], Collections.emptySet()));
else
Stream.of(edgeLabels).map(vertex.inEdges::get).filter(Objects::nonNull).forEach(edges::addAll);
}
}
return (Iterator) edges.iterator();
}
示例13: ExAcquireSkillInfo
import java.util.Objects; //导入依赖的package包/类
/**
* Special constructor for Alternate Skill Learning system.<br>
* Sets a custom amount of SP.
* @param player
* @param skillLearn the skill learn.
* @param sp the custom SP amount.
*/
public ExAcquireSkillInfo(L2PcInstance player, L2SkillLearn skillLearn, int sp)
{
_id = skillLearn.getSkillId();
_level = skillLearn.getSkillLevel();
_dualClassLevel = skillLearn.getDualClassLevel();
_spCost = sp;
_minLevel = skillLearn.getGetLevel();
_itemReq = skillLearn.getRequiredItems();
_skillRem = skillLearn.getRemoveSkills().stream().map(player::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());
}
示例14: equals
import java.util.Objects; //导入依赖的package包/类
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
final IEXOperationalHaltStatusMessage that = (IEXOperationalHaltStatusMessage) o;
return timestamp == that.timestamp &&
operationalHaltStatus == that.operationalHaltStatus &&
Objects.equals(symbol, that.symbol);
}
示例15: build
import java.util.Objects; //导入依赖的package包/类
@Override
public BasicOutboundConfiguration build() {
Objects.requireNonNull(name);
Objects.requireNonNull(messageProtocol);
Objects.requireNonNull(composerClass);
Preconditions.checkArgument(!composer.isEmpty());
Objects.requireNonNull(sendPlugin);
return new BasicOutboundConfigurationImpl(name, messageProtocol, composerClass, sendPlugin,
composer, configuration);
}