本文整理汇总了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;
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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;
}
示例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();
}