當前位置: 首頁>>代碼示例>>Java>>正文


Java Objects.firstNonNull方法代碼示例

本文整理匯總了Java中com.google.common.base.Objects.firstNonNull方法的典型用法代碼示例。如果您正苦於以下問題:Java Objects.firstNonNull方法的具體用法?Java Objects.firstNonNull怎麽用?Java Objects.firstNonNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.base.Objects的用法示例。


在下文中一共展示了Objects.firstNonNull方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLocationSkin

import com.google.common.base.Objects; //導入方法依賴的package包/類
public ResourceLocation getLocationSkin()
{
    if (this.locationSkin == null)
    {
        this.loadPlayerTextures();
    }

    return (ResourceLocation)Objects.firstNonNull(this.locationSkin, DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId()));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:NetworkPlayerInfo.java

示例2: SqlAddLayout

import com.google.common.base.Objects; //導入方法依賴的package包/類
private SqlAddLayout(SqlParserPos pos, SqlIdentifier tblName, SqlNode isRaw, SqlNodeList displayList,
    SqlNodeList dimensionList, SqlNodeList measureList, SqlNodeList distributionList, SqlNodeList partitionList,
    SqlNodeList sortList, PartitionDistributionStrategy partitionDistributionStrategy, SqlIdentifier name) {
  super(pos);
  this.tblName = tblName;
  this.isRaw = isRaw;
  this.displayList = Objects.firstNonNull(displayList, SqlNodeList.EMPTY);
  this.dimensionList = Objects.firstNonNull(dimensionList, SqlNodeList.EMPTY);
  this.measureList = Objects.firstNonNull(measureList, SqlNodeList.EMPTY);
  this.distributionList = distributionList;
  this.partitionList = partitionList;
  this.sortList = sortList;
  this.partitionDistributionStrategy = partitionDistributionStrategy;
  this.name = name;
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:16,代碼來源:SqlAddLayout.java

示例3: getId

import com.google.common.base.Objects; //導入方法依賴的package包/類
public String getId() {
    return Objects.firstNonNull(id, "");
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:4,代碼來源:LabellingInteractionBean.java

示例4: getOrientation

import com.google.common.base.Objects; //導入方法依賴的package包/類
public OrderInteractionOrientation getOrientation() {
    return Objects.firstNonNull(orientation, OrderInteractionOrientation.HORIZONTAL);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:4,代碼來源:OrderInteractionBean.java

示例5: getEvaluate

import com.google.common.base.Objects; //導入方法依賴的package包/類
public Evaluate getEvaluate() {
    return Objects.firstNonNull(evaluate, Evaluate.DEFAULT);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:4,代碼來源:ResponseBean.java

示例6: getCheckMode

import com.google.common.base.Objects; //導入方法依賴的package包/類
public CheckMode getCheckMode() {
    return Objects.firstNonNull(checkMode, CheckMode.DEFAULT);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:4,代碼來源:ResponseBean.java

示例7: getObject

import com.google.common.base.Objects; //導入方法依賴的package包/類
public ISpectatorMenuObject getObject(int p_178680_1_)
{
    return p_178680_1_ >= 0 && p_178680_1_ < this.items.size() ? (ISpectatorMenuObject)Objects.firstNonNull(this.items.get(p_178680_1_), SpectatorMenu.EMPTY_SLOT) : SpectatorMenu.EMPTY_SLOT;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:5,代碼來源:SpectatorDetails.java

示例8: func_178680_a

import com.google.common.base.Objects; //導入方法依賴的package包/類
public ISpectatorMenuObject func_178680_a(int p_178680_1_)
{
    return p_178680_1_ >= 0 && p_178680_1_ < this.field_178682_b.size() ? (ISpectatorMenuObject)Objects.firstNonNull(this.field_178682_b.get(p_178680_1_), SpectatorMenu.field_178657_a) : SpectatorMenu.field_178657_a;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:SpectatorDetails.java

示例9: func_178643_a

import com.google.common.base.Objects; //導入方法依賴的package包/類
public ISpectatorMenuObject func_178643_a(int p_178643_1_)
{
    int i = p_178643_1_ + this.field_178658_j * 6;
    return this.field_178658_j > 0 && p_178643_1_ == 0 ? field_178656_c : (p_178643_1_ == 7 ? (i < this.field_178659_h.func_178669_a().size() ? field_178653_d : field_178654_e) : (p_178643_1_ == 8 ? field_178655_b : (i >= 0 && i < this.field_178659_h.func_178669_a().size() ? (ISpectatorMenuObject)Objects.firstNonNull(this.field_178659_h.func_178669_a().get(i), field_178657_a) : field_178657_a)));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:SpectatorMenu.java

示例10: EditBoxEntry

import com.google.common.base.Objects; //導入方法依賴的package包/類
public EditBoxEntry(int p_i45534_1_, String p_i45534_2_, boolean p_i45534_3_, Predicate<String> p_i45534_4_)
{
    super(p_i45534_1_, p_i45534_2_, p_i45534_3_);
    this.field_178951_a = (Predicate)Objects.firstNonNull(p_i45534_4_, Predicates.alwaysTrue());
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:GuiPageButtonList.java

示例11: EditBoxEntry

import com.google.common.base.Objects; //導入方法依賴的package包/類
public EditBoxEntry(int p_i45534_1_, String p_i45534_2_, boolean p_i45534_3_, Predicate<String> p_i45534_4_)
{
    super(p_i45534_1_, p_i45534_2_, p_i45534_3_);
    this.filter = (Predicate)Objects.firstNonNull(p_i45534_4_, Predicates.alwaysTrue());
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:GuiPageButtonList.java

示例12: getItem

import com.google.common.base.Objects; //導入方法依賴的package包/類
public ISpectatorMenuObject getItem(int p_178643_1_)
{
    int i = p_178643_1_ + this.page * 6;
    return this.page > 0 && p_178643_1_ == 0 ? SCROLL_LEFT : (p_178643_1_ == 7 ? (i < this.category.getItems().size() ? SCROLL_RIGHT_ENABLED : SCROLL_RIGHT_DISABLED) : (p_178643_1_ == 8 ? CLOSE_ITEM : (i >= 0 && i < this.category.getItems().size() ? (ISpectatorMenuObject)Objects.firstNonNull(this.category.getItems().get(i), EMPTY_SLOT) : EMPTY_SLOT)));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:SpectatorMenu.java

示例13: getLocationSkin

import com.google.common.base.Objects; //導入方法依賴的package包/類
public ResourceLocation getLocationSkin()
{
    this.loadPlayerTextures();
    return (ResourceLocation)Objects.firstNonNull(this.playerTextures.get(Type.SKIN), DefaultPlayerSkin.getDefaultSkin(this.gameProfile.getId()));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:NetworkPlayerInfo.java

示例14: renderItemInFirstPerson

import com.google.common.base.Objects; //導入方法依賴的package包/類
/**
 * Renders the active item in the player's hand when in first person mode.
 */
public void renderItemInFirstPerson(float partialTicks)
{
    AbstractClientPlayer abstractclientplayer = this.mc.player;
    float f = abstractclientplayer.getSwingProgress(partialTicks);
    EnumHand enumhand = (EnumHand)Objects.firstNonNull(abstractclientplayer.swingingHand, EnumHand.MAIN_HAND);
    float f1 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
    float f2 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
    boolean flag = true;
    boolean flag1 = true;

    if (abstractclientplayer.isHandActive())
    {
        ItemStack itemstack = abstractclientplayer.getActiveItemStack();

        if (itemstack != null && itemstack.getItem() == Items.BOW)
        {
            EnumHand enumhand1 = abstractclientplayer.getActiveHand();
            flag = enumhand1 == EnumHand.MAIN_HAND;
            flag1 = !flag;
        }
    }

    this.rotateArroundXAndY(f1, f2);
    this.setLightmap();
    this.rotateArm(partialTicks);
    GlStateManager.enableRescaleNormal();

    if (flag)
    {
        float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
        float f5 = 1.0F - (this.prevEquippedProgressMainHand + (this.equippedProgressMainHand - this.prevEquippedProgressMainHand) * partialTicks);

        if (!Reflector.ForgeHooksClient_renderSpecificFirstPersonHand.exists() || !Reflector.callBoolean(Reflector.ForgeHooksClient_renderSpecificFirstPersonHand, new Object[] {EnumHand.MAIN_HAND, Float.valueOf(partialTicks), Float.valueOf(f1), Float.valueOf(f3), Float.valueOf(f5), this.itemStackMainHand}))
        {
            this.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.MAIN_HAND, f3, this.itemStackMainHand, f5);
        }
    }

    if (flag1)
    {
        float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
        float f6 = 1.0F - (this.prevEquippedProgressOffHand + (this.equippedProgressOffHand - this.prevEquippedProgressOffHand) * partialTicks);

        if (!Reflector.ForgeHooksClient_renderSpecificFirstPersonHand.exists() || !Reflector.callBoolean(Reflector.ForgeHooksClient_renderSpecificFirstPersonHand, new Object[] {EnumHand.OFF_HAND, Float.valueOf(partialTicks), Float.valueOf(f1), Float.valueOf(f4), Float.valueOf(f6), this.itemStackOffHand}))
        {
            this.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.OFF_HAND, f4, this.itemStackOffHand, f6);
        }
    }

    GlStateManager.disableRescaleNormal();
    RenderHelper.disableStandardItemLighting();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:56,代碼來源:ItemRenderer.java


注:本文中的com.google.common.base.Objects.firstNonNull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。