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


Java Objects.equal方法代码示例

本文整理汇总了Java中com.google.gwt.thirdparty.guava.common.base.Objects.equal方法的典型用法代码示例。如果您正苦于以下问题:Java Objects.equal方法的具体用法?Java Objects.equal怎么用?Java Objects.equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.thirdparty.guava.common.base.Objects的用法示例。


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

示例1: build

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public static ProductSupply build(final BPartner bpartner, final Product product, final ContractLine contractLine, final Date day)
{
	//
	// Validate
	if (contractLine != null)
	{
		final BPartner contractBPartner = contractLine.getContract().getBpartner();
		if (!Objects.equal(bpartner, contractBPartner))
		{
			throw new IllegalArgumentException("BPartner not matching the contract");
		}

		final Product contractProduct = contractLine.getProduct();
		if (!Objects.equal(product, contractProduct))
		{
			throw new IllegalArgumentException("Product not matching the contract");
		}
	}
	final ProductSupply productSupply = new ProductSupply();
	productSupply.setBpartner(bpartner);
	productSupply.setProduct(product);
	productSupply.setContractLine(contractLine);
	productSupply.setDay(DateUtils.truncToDay(day));
	return productSupply;
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:26,代码来源:ProductSupply.java

示例2: equals

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
@Override
public final boolean equals(final Object obj)
{
	if (this == obj)
	{
		return true;
	}
	if (obj == null)
	{
		return false;
	}

	if (getClass() != obj.getClass())
	{
		return false;
	}

	final AbstractEntity other = (AbstractEntity)obj;
	return Objects.equal(id, other.id);
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:21,代码来源:AbstractEntity.java

示例3: updateUI_NextWeekTrand

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
private final void updateUI_NextWeekTrand()
{
	final WeekProductQtyReport weekQtyReport = weekQtyReportItem == null ? null : weekQtyReportItem.getBean();
	final Trend nextWeekTrend = weekQtyReport == null ? null : weekQtyReport.getNextWeekTrend();

	for (Map.Entry<Trend, Button> e : trend2button.entrySet())
	{
		final Trend trend = e.getKey();
		final Button button = e.getValue();

		if (Objects.equal(nextWeekTrend, trend))
		{
			button.addStyleName(STYLE_CurrentTrend);
		}
		else
		{
			button.removeStyleName(STYLE_CurrentTrend);
		}
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:21,代码来源:WeeklyDetailedReportingView.java

示例4: setDate

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public void setDate(final Date date)
{
	Preconditions.checkNotNull(date, "date");

	final Date dateOld = _date;
	final Date dateNew = dateHandler.normalize(date);
	if (Objects.equal(dateOld, dateNew))
	{
		return;
	}
	_date = dateNew;

	updateUI();

	//
	pcs.firePropertyChange(PROPERTY_Date, dateOld, dateNew);
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:18,代码来源:DateNavigation.java

示例5: setContainerDataSource

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public final void setContainerDataSource(final BeanItemContainer<BT> containerNew)
{
	if (Objects.equal(this.container, containerNew))
	{
		return;
	}

	if (this.container != null)
	{
		this.container.removeItemSetChangeListener(listener);
	}

	this.container = containerNew;

	if (this.container != null)
	{
		this.container.addItemSetChangeListener(listener);
	}
	updateAll();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:21,代码来源:BeansVerticalComponentGroup.java

示例6: setWeekQtyReport

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public void setWeekQtyReport(final BeanItem<WeekProductQtyReport> weekQtyReportItem)
{
	if (Objects.equal(this.weekQtyReportItem, weekQtyReportItem))
	{
		return;
	}

	this.weekQtyReportItem = weekQtyReportItem;
	final WeekProductQtyReport weekQtyReport = weekQtyReportItem == null ? null : weekQtyReportItem.getBean();

	//
	// Header caption
	{
		final String caption = weekQtyReport == null ? null : weekQtyReport.getCaption();
		setCaption(caption);
	}

	//
	// Product buttons
	final ProductQtyReportContainer dailyQtyReportContainer = weekQtyReport == null ? null : weekQtyReport.getDailyQtyReportContainer();
	productButtons.setContainerDataSource(dailyQtyReportContainer);

	//
	// Toolbar caption and trend buttons
	{
		final String nextWeek = weekQtyReport == null ? "-" : weekQtyReport.getNextWeekString();
		toolbar.setCaption(i18n.get("WeeklyDetailedReportingView.toolbar.caption", nextWeek));

		updateUI_NextWeekTrand();
	}
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:32,代码来源:WeeklyDetailedReportingView.java

示例7: getRfqHeaderByUuid

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
private RfqHeader getRfqHeaderByUuid(final String rfq_uuid)
{
	for (final RfqHeader rfqHeader : getAllItemIds())
	{
		if (Objects.equal(rfq_uuid, rfqHeader.getRfq_uuid()))
		{
			return rfqHeader;
		}
	}
	
	return null;
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:13,代码来源:RfqHeaderContainer.java

示例8: setAutoSortByPropertyId

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public void setAutoSortByPropertyId(final Object autoSortPropertyId)
{
	Preconditions.checkNotNull(autoSortPropertyId);
	if (Objects.equal(this.autoSortPropertyId, autoSortPropertyId))
	{
		return;
	}

	this.autoSortPropertyId = autoSortPropertyId;

	sort();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:13,代码来源:ProductQtyReportContainer.java

示例9: setDateHandler

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public void setDateHandler(final DateNavigationHandler dateHandler)
{
	if (Objects.equal(this.dateHandler, dateHandler))
	{
		return;
	}

	Preconditions.checkNotNull(dateHandler);
	this.dateHandler = dateHandler;

	updateUI();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:13,代码来源:DateNavigation.java

示例10: setDateRange

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
public void setDateRange(final DateRange dateRange)
{
	if (Objects.equal(dateHandler, dateRange))
	{
		return;
	}
	this.dateRange = dateRange;
	updateUI();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:10,代码来源:DateNavigation.java

示例11: importPlannedProductSupply

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入方法依赖的package包/类
private void importPlannedProductSupply(final SyncProductSupply syncProductSupply, final BPartner bpartner)
{
	final String product_uuid = syncProductSupply.getProduct_uuid();
	final Product product = productRepo.findByUuid(product_uuid);
	//
	final String contractLine_uuid = syncProductSupply.getContractLine_uuid();
	final ContractLine contractLine = contractLineRepo.findByUuid(contractLine_uuid);
	//
	final Date day = DateUtils.truncToDay(syncProductSupply.getDay());
	final BigDecimal qty = Objects.firstNonNull(syncProductSupply.getQty(), BigDecimal.ZERO);
	
	ProductSupply productSupply = productSupplyRepo.findByProductAndBpartnerAndDay(product, bpartner, day);
	final boolean isNew;
	if (productSupply == null)
	{
		isNew = true;
		productSupply = ProductSupply.build(bpartner, product, contractLine, day);
	}
	else
	{
		isNew = false;
	}
	
	//
	// Contract line
	if(!isNew)
	{
		final ContractLine contractLineOld = productSupply.getContractLine();
		if (!Objects.equal(contractLine, contractLineOld))
		{
			logger.warn("Changing contract line {}->{} for {} because of planning supply: {}", contractLineOld, contractLine, productSupply, syncProductSupply);
		}
		productSupply.setContractLine(contractLine);
	}
	
	//
	// Quantity
	if(!isNew)
	{
		final BigDecimal qtyOld = productSupply.getQty();
		if (qty.compareTo(qtyOld) != 0)
		{
			logger.warn("Changing quantity {}->{} for {} because of planning supply: {}", qtyOld, qty, productSupply, syncProductSupply);
		}
	}
	productSupply.setQty(qty);

	//
	// Save the product supply
	productSupplyRepo.save(productSupply);
	
	applicationEventBus.post(ProductSupplyChangedEvent.of(productSupply));
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:54,代码来源:SyncRfqImportService.java


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