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


Java Objects类代码示例

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


Objects类属于com.google.gwt.thirdparty.guava.common.base包,在下文中一共展示了Objects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: init

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setHeight(100f,Unit.PERCENTAGE);
    setContent(layout);

    Button button = new Button("click!", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            int count = (int) Objects.firstNonNull(getSession().getAttribute("count"), 0);
            getSession().setAttribute("count", ++count);

            layout.addComponent(new Label("clicked: " + count ));
        }
    });

    layout.addComponent(button);
}
 
开发者ID:jangalinski,项目名称:dropwizard-vaadin,代码行数:19,代码来源:MainUI.java

示例7: toString

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public String toString()
{
	return Objects.toStringHelper(this)
			.add("bpartner", bpartner)
			.add("contracts", _contracts)
			.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:9,代码来源:Contracts.java

示例8: toString

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public final String toString()
{
	final ToStringHelper toStringHelper = Objects.toStringHelper(this);
	toString(toStringHelper);
	return toStringHelper
			.add("id", id)
			.add("version", version)
			.add("deleted", deleted)
			.add("uuid", uuid)
			.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:13,代码来源:AbstractEntity.java

示例9: hashCode

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public final int hashCode()
{
	final int prime = 31;
	int result = 1;
	result = prime * result + Objects.hashCode(id);
	return result;
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:9,代码来源:AbstractEntity.java

示例10: toString

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public String toString()
{
	return Objects.toStringHelper(this)
			.add("user", user)
			.add("token", token)
			.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:9,代码来源:LoginRememberMeService.java

示例11: toString

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public String toString()
{
	return Objects.toStringHelper(this)
			.add("product", product)
			.add("qty", qty)
			.add("week", _week)
			.add("nextWeekTrend", nextWeekTrend)
			.add("id", id)
			.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:12,代码来源:WeekProductQtyReport.java

示例12: 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

示例13: toString

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public String toString()
{
	return Objects.toStringHelper(this)
			.add("price", price)
			.add("rfq_id", rfq_id)
			.add("id", id)
			.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:10,代码来源:RfqPriceReport.java

示例14: 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

示例15: toString

import com.google.gwt.thirdparty.guava.common.base.Objects; //导入依赖的package包/类
@Override
public String toString()
{
	return Objects.toStringHelper(this)
			.add("product", product_uuid)
			.add("qty", qty)
			.add("qtySent", qtySent)
			.add("day", day)
			.add("rfq_uuid", rfq_uuid)
			.add("id", id)
			.toString();
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:13,代码来源:RfqQuantityReport.java


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