当前位置: 首页>>代码示例>>Java>>正文


Java Objects类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:19,代码来源:VeryBasicSearch.java

示例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);
}
 
开发者ID:square,项目名称:connect-java-sdk,代码行数:18,代码来源:V1Discount.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Streams.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:ZonedDateTime.java

示例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);
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:18,代码来源:HudsonMasterComputermonitorData.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;
  }
  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);
}
 
开发者ID:ARMmbed,项目名称:mbed-cloud-sdk-java,代码行数:23,代码来源:CampaignDeviceMetadata.java

示例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;
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:24,代码来源:ExportImportBackgroundTaskDisplay.java

示例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());
}
 
开发者ID:alphagov,项目名称:verify-hub,代码行数:27,代码来源:EidasCycle0And1MatchRequestSentState.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;
  }
  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);
}
 
开发者ID:square,项目名称:connect-java-sdk,代码行数:18,代码来源:SearchCatalogObjectsRequest.java

示例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);
}
 
开发者ID:dbiir,项目名称:rainbow,代码行数:17,代码来源:CreateTable.java

示例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();
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:25,代码来源:TinkerHelper.java

示例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());
}
 
开发者ID:rubenswagner,项目名称:L2J-Global,代码行数:18,代码来源:ExAcquireSkillInfo.java

示例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);
}
 
开发者ID:WojciechZankowski,项目名称:iextrading4j-hist,代码行数:11,代码来源:IEXOperationalHaltStatusMessage.java

示例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);
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:12,代码来源:BasicOutboundConfigurationBuilder.java


注:本文中的java.util.Objects类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。