• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Objects类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jgoodies.common.base.Objects的典型用法代码示例。如果您正苦于以下问题:Java Objects类的具体用法?Java Objects怎么用?Java Objects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Objects类属于com.jgoodies.common.base包,在下文中一共展示了Objects类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: isStringLikeFilter

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
public QueryFilterAssert isStringLikeFilter(final ModelColumn column, final String likeExpression)
{
	final StringLikeFilter actualStringLikeQueryFilter = castOrNull(actual, StringLikeFilter.class);
	if (actualStringLikeQueryFilter == null)
	{
		failWithMessage("Expected IQueryFilter to be instance of <%s> but was <%s>",
				StringLikeFilter.class, actual.getClass());
	}

	final boolean hasColumnName = actualStringLikeQueryFilter.getColumnName().equals(column.getColumnName());
	if (!hasColumnName)
	{
		failWithMessage("Expected StringLikeFilter to have hasColumnName <%s> but had <%s>",
				column.getColumnName(), actualStringLikeQueryFilter.getColumnName());
	}

	final boolean hasLikeExpression = Objects.equals(actualStringLikeQueryFilter.getValue(), likeExpression);
	if (!hasLikeExpression)
	{
		failWithMessage("Expected StringLikeFilter to have likeExpression <%s> but had <%s>",
				likeExpression, actualStringLikeQueryFilter.getValue());
	}
	return this;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:25,代码来源:QueryFilterAssert.java


示例2: hasEqualsFilter

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
public CompositeQueryFilterAssert hasEqualsFilter(final ModelColumn column, final Object value)
{
	final Predicate<IQueryFilter> p = filter -> {

		final EqualsQueryFilter equalsQueryFilter = castOrNull(filter, EqualsQueryFilter.class);
		if (equalsQueryFilter == null)
		{
			return false;
		}

		final boolean hasColumnName = equalsQueryFilter.getColumnName().equals(column.getColumnName());
		if (!hasColumnName)
		{
			return false;
		}

		final boolean hasValue = Objects.equals(equalsQueryFilter.getValue(), value);
		if (!hasValue)
		{
			return false;
		}
		return true;
	};

	return anyFilterMatches(p);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:27,代码来源:CompositeQueryFilterAssert.java


示例3: getQualifiedName

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public String getQualifiedName(final BpGraphNode t) {

    if (Objects.equals(t.getProcess().getStart(), (t.getGenericAction().getId()))) {
        return t.getXmlVirtualFile().getUrl();
    }

    return null;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:DefaultBpDiagramVfsResolver.java


示例4: notifyRelatedDocumentTabsChanged

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
/**
 * If the document contains some attachment related tabs, it will send an "stale" notification to frontend.
 * In this way, frontend will be aware of this and will have to refresh the tab.
 */
private void notifyRelatedDocumentTabsChanged()
{
	final ImmutableSet<DetailId> attachmentRelatedTabIds = entityDescriptor
			.getIncludedEntities().stream()
			.filter(includedEntityDescriptor -> Objects.equals(includedEntityDescriptor.getTableNameOrNull(), I_AD_AttachmentEntry.Table_Name))
			.map(includedEntityDescriptor -> includedEntityDescriptor.getDetailId())
			.collect(ImmutableSet.toImmutableSet());
	if (attachmentRelatedTabIds.isEmpty())
	{
		return;
	}

	websocketPublisher.staleTabs(documentPath.getWindowId(), documentPath.getDocumentId(), attachmentRelatedTabIds);
}
 
开发者ID:metasfresh,项目名称:metasfresh-webui-api,代码行数:19,代码来源:DocumentAttachments.java


示例5: processAndCollectRecordWithinPause

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
private ImmutableList<I_C_SubscriptionProgress> processAndCollectRecordWithinPause(
		@NonNull final List<I_C_SubscriptionProgress> sps,
		@NonNull final Timestamp pauseUntil)
{
	final Builder<I_C_SubscriptionProgress> spsWithinPause = ImmutableList.builder();

	for (final I_C_SubscriptionProgress sp : sps)
	{
		if (sp.getEventDate().after(pauseUntil))
		{
			continue;
		}
		spsWithinPause.add(sp);
		sp.setSeqNo(sp.getSeqNo() + 1);

		if (sp.getM_ShipmentSchedule_ID() > 0)
		{
			Services.get(IShipmentScheduleBL.class).closeShipmentSchedule(sp.getM_ShipmentSchedule());
		}

		final boolean notYetDone = !Objects.equals(sp.getStatus(), X_C_SubscriptionProgress.STATUS_Done);
		if (notYetDone)
		{
			sp.setContractStatus(X_C_SubscriptionProgress.CONTRACTSTATUS_DeliveryPause);
		}
	}

	return spsWithinPause.build();
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:30,代码来源:InsertPause.java


示例6: getCapacity

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
/**
 * Get the capacity of the given {@code tu}. Hint: also check the comments in this method.
 * 
 * @param request the request which contains e.g. the product in question.
 * @param hu the HU of we want to find the capacity.
 * @return
 */
private Capacity getCapacity(final IAllocationRequest request, final I_M_HU hu)
{
	final IHandlingUnitsBL handlingUnitsBL = Services.get(IHandlingUnitsBL.class);

	final int productId = request.getProduct().getM_Product_ID();
	final Capacity capacityToUse;
	final Capacity capacityOverride = productId2capacity.get(productId);

	if (capacityOverride == null && handlingUnitsBL.isAggregateHU(hu))
	{
		// So there was no override capacity provided for this product.
		// The allocationStrategy we are creating just now might execute against the aggregate VHU which does not have any M_HU_PI_Item_Products and therefore does not know the TUs actual capacity.
		// To compensate for this, we now find out the TU's capacity and make it the allocation strategy's upper bound
		final List<I_M_HU_PI_Item> materialPIItems = handlingUnitsDAO.retrievePIItems(tuPI, getC_BPartner()).stream()
				.filter(piItem -> Objects.equals(X_M_HU_PI_Item.ITEMTYPE_Material, piItem.getItemType()))
				.collect(Collectors.toList());

		Check.errorIf(materialPIItems.size() != 1, "There has to be exactly one M_HU_PI_Item for the TU's M_HU_PI and and C_BPartner;\n "
				+ "M_HU_PI={};\n "
				+ "C_BPartner={};\n "
				+ "M_HU_PI_Item(s) found={}\n "
				+ "this={}", tuPI, getC_BPartner(), materialPIItems, this);

		final IHUPIItemProductDAO hupiItemProductDAO = Services.get(IHUPIItemProductDAO.class);
		final I_M_HU_PI_Item_Product itemProduct = hupiItemProductDAO.retrievePIMaterialItemProduct(materialPIItems.get(0), getC_BPartner(), request.getProduct(), request.getDate());

		final IHUCapacityBL capacityBL = Services.get(IHUCapacityBL.class);
		final Capacity capacity = capacityBL.getCapacity(itemProduct, request.getProduct(), request.getC_UOM());

		capacityToUse = capacity;
	}
	else
	{
		capacityToUse = capacityOverride; // we can go with capacityOverride==null, if the given hu is a "real" one (not aggregate), because the code will use the hu's PI-item.
	}
	return capacityToUse;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:45,代码来源:TUProducerDestination.java


示例7: hasCompareFilter

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
public CompositeQueryFilterAssert hasCompareFilter(final ModelColumn column, final Operator operator, final Object value)
{
	final Predicate<IQueryFilter> p = filter -> {

		final CompareQueryFilter compareQueryFilter = castOrNull(filter, CompareQueryFilter.class);
		if (compareQueryFilter == null)
		{
			return false;
		}

		final boolean hasColumnName = compareQueryFilter.getColumnName().equals(column.getColumnName());
		if (!hasColumnName)
		{
			return false;
		}

		final boolean hasValue = Objects.equals(compareQueryFilter.getValue(), value);
		if (!hasValue)
		{
			return false;
		}

		final boolean hasOperator = Objects.equals(compareQueryFilter.getOperator(), operator);
		if (!hasOperator)
		{
			return false;
		}

		return true;
	};
	return anyFilterMatches(p);
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:33,代码来源:CompositeQueryFilterAssert.java


示例8: setResourceToProduct

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public boolean setResourceToProduct(@NonNull final I_S_Resource resource, @NonNull final I_M_Product product)
{
	boolean changed = false;
	if (!X_M_Product.PRODUCTTYPE_Resource.equals(product.getProductType()))
	{
		product.setProductType(X_M_Product.PRODUCTTYPE_Resource);
		changed = true;
	}
	if (resource.getS_Resource_ID() != product.getS_Resource_ID())
	{
		product.setS_Resource_ID(resource.getS_Resource_ID());
		changed = true;
	}
	if (resource.isActive() != product.isActive())
	{
		product.setIsActive(resource.isActive());
		changed = true;
	}

	// the "PR" is a QnD solution to the possible problem that if the production resource's value is set to its ID (like '1000000") there is probably already a product with the same value.
	if (!Objects.equals("PR" + resource.getValue(), product.getValue()))
	{
		product.setValue("PR" + resource.getValue());
		changed = true;
	}
	if (!resource.getName().equals(product.getName()))
	{
		product.setName(resource.getName());
		changed = true;
	}
	if (resource.getDescription() == null && product.getDescription() != null
			|| resource.getDescription() != null && !resource.getDescription().equals(product.getDescription()))
	{
		product.setDescription(resource.getDescription());
		changed = true;
	}
	//
	return changed;
}
 
开发者ID:metasfresh,项目名称:metasfresh,代码行数:41,代码来源:ResourceProductService.java


示例9: equals

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
	if(obj == null) {
		return false;
	}
	if(!(obj instanceof FieldForRoleBean)) {
		return false;
	}
	return Objects.equals(((FieldForRoleBean)obj).getFieldLabel(), this.getFieldLabel());
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:11,代码来源:FieldForRoleBean.java


示例10: equals

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
	if(obj == null) {
		return false;
	}
	if(!(obj instanceof FieldForRoleBean)) {
		return false;
	}
	return Objects.equals(((LoggingLevelBean)obj).getClassName(), this.getClassName());
}
 
开发者ID:trackplus,项目名称:Genji,代码行数:11,代码来源:LoggingLevelBean.java


示例11: equals

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public boolean equals(Object o) {
    if (o == null || !o.getClass().equals(getClass())) {
        return false;
    }
    VariableInfo other = (VariableInfo) o;
    return Objects.equals(value, other.value) && Objects.equals(definition, other.definition);
}
 
开发者ID:charlescapps,项目名称:robot-intellij-plugin,代码行数:9,代码来源:VariableInfo.java


示例12: methodToRobotKeyword

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
/**
 * Convert a Java method name into a Robot Keyword name.
 *
 * e.g. convert "fooBarMethod" to "Foo Bar Method".
 *
 * Throw out underscores as well, so convert "foo_bar_method" to "Foo Bar Method".
 *
 * @param method - valid name of a Java method
 * @return - standard Robot Keyword name for the input Java method
 */
public static String methodToRobotKeyword(String method) {
    StringBuilder sb = new StringBuilder();
    int prev = 0;
    int current;
    boolean capitalizeNext = false;
    for (int i = 1; i <= method.length(); i++) {
        Character c;
        if (i < method.length()) {
            c = method.charAt(i);
            if (capitalizeNext) {
                c = Character.toUpperCase(c);
                capitalizeNext = false;
            }
        } else {
            c = null;
        }
        if (Objects.equals(c, '_')) {
            capitalizeNext = true;
            continue;
        }
        if (i == method.length() || Character.isUpperCase(c)) {
            current = i;
            String sub = method.substring(prev, current)
                                .replace("_", ""); // remove underscores.
            String cap = sub.substring(0, 1).toUpperCase() + sub.substring(1);
            if (!sb.toString().isEmpty()) { //Append the single space separator for robot keywords
                char lastSoFar = sb.toString().charAt(sb.length() - 1);
                if (!Character.isUpperCase(lastSoFar) || sub.length() > 1) {
                    if (!Character.isWhitespace(lastSoFar)) {
                        sb.append(" ");
                    }
                }
            }
            sb.append(cap);
            prev = current;
        }
    }
    return sb.toString();
}
 
开发者ID:charlescapps,项目名称:robot-intellij-plugin,代码行数:50,代码来源:RobotPsiUtil.java


示例13: areIdenticalTextualOccurrences

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
public static boolean areIdenticalTextualOccurrences(@NotNull PsiElement el1, @NotNull PsiElement el2) {
    if (el1.getContainingFile() == null || el2.getContainingFile() == null) {
        return false;
    }
    VirtualFile vf1 = el1.getContainingFile().getVirtualFile();
    VirtualFile vf2 = el2.getContainingFile().getVirtualFile();
    if (vf1 == null || vf2 == null) {
        return false;
    }
    return Objects.equals(vf1.getCanonicalPath(), vf2.getCanonicalPath()) &&
           el1.getTextRange().equals(el2.getTextRange());
}
 
开发者ID:charlescapps,项目名称:robot-intellij-plugin,代码行数:13,代码来源:RobotPsiUtil.java


示例14: isIdentifier

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public boolean isIdentifier(@NotNull String s, Project project) {
    // It's bad practice to have $, {, or } in Robot keywords, even if it's technically allowed.
    if (s.contains("$") || s.contains("{") || s.contains("}")) {
        return false;
    }
    RobotKeyword keyword = RobotElementFactory.createKeyword(project, s);
    return keyword != null && Objects.equals(s, keyword.getText());
}
 
开发者ID:charlescapps,项目名称:robot-intellij-plugin,代码行数:10,代码来源:RobotNamesValidator.java


示例15: format

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
/**
 * {@inheritDoc}<p>
 *
 * If {@code obj} is equal to the <em>emptyValue</em>,
 * {@code toAppendTo} is returned. Otherwise the format
 * is forwarded to the delegate.
 */
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo,
        FieldPosition pos) {
    return Objects.equals(obj, emptyValue)
            ? toAppendTo
            : delegate.format(obj, toAppendTo, pos);
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:15,代码来源:EmptyFormat.java


示例16: format

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
@Override
public StringBuffer format(Date date, StringBuffer toAppendTo,
        FieldPosition pos) {
    return Objects.equals(date, emptyValue)
            ? toAppendTo
            : delegate.format(date, toAppendTo, pos);
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:8,代码来源:EmptyDateFormat.java


示例17: format

import com.jgoodies.common.base.Objects; //导入依赖的package包/类
/**
 * {@inheritDoc}<p>
 *
 * If {@code obj} is equal to the <em>emptyValue</em>,
 * {@code toAppendTo} is returned. Otherwise the format
 * is forwarded to the delegate.
 */
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo,
        FieldPosition pos) {
    return Objects.equals(obj, emptyValue)
        ? toAppendTo
        : delegate.format(obj, toAppendTo, pos);
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:15,代码来源:EmptyNumberFormat.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HistoricVariableInstance类代码示例发布时间:2022-05-23
下一篇:
Java ProjectionElemList类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap