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


Java BooleanUtils.toBooleanDefaultIfNull方法代碼示例

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


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

示例1: GptBrokerDefinitionAdaptor

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
/**
 * Creates instance of the adaptor.
 * @param def broker definition
 */
public GptBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException {
  super(def);
  this.credAdaptor = new CredentialsDefinitionAdaptor(def);
  if (StringUtils.trimToEmpty(def.getType()).isEmpty()) {
    def.setType(GptConnector.TYPE);
  } else if (!GptConnector.TYPE.equals(def.getType())) {
    throw new InvalidDefinitionException("Broker definition doesn't match");
  } else {
    try {
      String sHostUrl = get(P_HOST_URL);
      if (sHostUrl!=null) {
        sHostUrl = sHostUrl.replaceAll("/*$", "/");
      }
      hostUrl = new URL(sHostUrl);
    } catch (MalformedURLException ex) {
      throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL,get(P_HOST_URL)), ex);
    }
    forceAdd = Boolean.parseBoolean(get(P_FORCE_ADD));
    cleanup  = Boolean.parseBoolean(get(P_CLEANUP));
    index  = get(P_INDEX);
    emitXml = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_ACCEPT_XML)), true);
    emitJson = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_ACCEPT_JSON)), false);
  }
}
 
開發者ID:Esri,項目名稱:geoportal-server-harvester,代碼行數:29,代碼來源:GptBrokerDefinitionAdaptor.java

示例2: AgpInputBrokerDefinitionAdaptor

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
/**
 * Creates instance of the adaptor.
 * @param def broker definition
 * @throws IllegalArgumentException if invalid broker definition
 */
public AgpInputBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException {
  super(def);
  this.credAdaptor =new CredentialsDefinitionAdaptor(def);
  this.botsAdaptor = new BotsBrokerDefinitionAdaptor(def);
  if (StringUtils.trimToEmpty(def.getType()).isEmpty()) {
    def.setType(AgpInputConnector.TYPE);
  } else if (!AgpInputConnector.TYPE.equals(def.getType())) {
    throw new InvalidDefinitionException("Broker definition doesn't match");
  } else {
    try {
      hostUrl = new URL(get(P_HOST_URL));
    } catch (MalformedURLException ex) {
      throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL,get(P_HOST_URL)), ex);
    }
    folderId = get(P_FOLDER_ID);
    emitXml = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_XML)), true);
    emitJson = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_JSON)), false);
  }
}
 
開發者ID:Esri,項目名稱:geoportal-server-harvester,代碼行數:25,代碼來源:AgpInputBrokerDefinitionAdaptor.java

示例3: GptBrokerDefinitionAdaptor

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
/**
 * Creates instance of the adaptor.
 * @param def broker definition
 */
public GptBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException {
  super(def);
  this.credAdaptor = new CredentialsDefinitionAdaptor(def);
  this.botsAdaptor = new BotsBrokerDefinitionAdaptor(def);
  if (StringUtils.trimToEmpty(def.getType()).isEmpty()) {
    def.setType(GptConnector.TYPE);
  } else if (!GptConnector.TYPE.equals(def.getType())) {
    throw new InvalidDefinitionException("Broker definition doesn't match");
  } else {
    try {
      String sHostUrl = get(P_HOST_URL);
      if (sHostUrl!=null) {
        sHostUrl = sHostUrl.replaceAll("/*$", "/");
      }
      hostUrl = new URL(sHostUrl);
    } catch (MalformedURLException ex) {
      throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL,get(P_HOST_URL)), ex);
    }
    index  = get(P_INDEX);
    emitXml = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_XML)), true);
    emitJson = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_JSON)), false);
  }
}
 
開發者ID:Esri,項目名稱:geoportal-server-harvester,代碼行數:28,代碼來源:GptBrokerDefinitionAdaptor.java

示例4: AgsBrokerDefinitionAdaptor

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
/**
 * Creates instance of the adaptor.
 * @param def broker definition
 * @throws InvalidDefinitionException if invalid broker definition
 */
public AgsBrokerDefinitionAdaptor(EntityDefinition def) throws InvalidDefinitionException {
  super(def);
  this.credAdaptor =new CredentialsDefinitionAdaptor(def);
  this.botsAdaptor = new BotsBrokerDefinitionAdaptor(def);
  if (StringUtils.trimToEmpty(def.getType()).isEmpty()) {
    def.setType(AgsConnector.TYPE);
  } else if (!AgsConnector.TYPE.equals(def.getType())) {
    throw new InvalidDefinitionException("Broker definition doesn't match");
  } else {
    try {
      hostUrl = new URL(get(P_HOST_URL));
    } catch (MalformedURLException ex) {
      throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL,get(P_HOST_URL)), ex);
    }
    enableLayers = BooleanUtils.toBoolean(get(P_ENABLE_LAYERS));
    emitXml = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_XML)), true);
    emitJson = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_JSON)), false);
  }
}
 
開發者ID:Esri,項目名稱:geoportal-server-harvester,代碼行數:25,代碼來源:AgsBrokerDefinitionAdaptor.java

示例5: initialize

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
/**
 * Initializes adaptor from definition.
 * @param def broker definition
 * @throws InvalidDefinitionException if definition is invalid
 */
protected void initialize(EntityDefinition def) throws InvalidDefinitionException {
  apiKey = get(P_API_KEY);
  emitXml = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_XML)), true);
  emitJson = BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(get(P_EMIT_JSON)), false);
  
  try {
    hostUrl = new URL(get(P_HOST_URL));
  } catch (MalformedURLException ex) {
    throw new InvalidDefinitionException(String.format("Invalid %s: %s", P_HOST_URL,get(P_HOST_URL)), ex);
  }
}
 
開發者ID:Esri,項目名稱:geoportal-server-harvester,代碼行數:17,代碼來源:CkanBrokerDefinitionAdaptor.java

示例6: setParameters

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
@Override
public void setParameters(Map<String, String> params) throws ParametersException {
  setElementParams(params);
  leaveBlankSpace = BooleanUtils.toBooleanDefaultIfNull(
      BooleanUtils.toBooleanObject(params.get(LEAVE_BLANK_SPACE_PARAM)),
      LEAVE_BLANK_SPACE_DEFAULT);
}
 
開發者ID:Cognifide,項目名稱:aet,代碼行數:8,代碼來源:HideModifier.java

示例7: parseGeneralString

import org.apache.commons.lang3.BooleanUtils; //導入方法依賴的package包/類
/**
 * 支持true/false,on/off, y/n, yes/no的轉換, str為空或無法分析時返回defaultValue
 */
public static Boolean parseGeneralString(String str, Boolean defaultValue) {
	return BooleanUtils.toBooleanDefaultIfNull(BooleanUtils.toBooleanObject(str), defaultValue);
}
 
開發者ID:zhangjunfang,項目名稱:util,代碼行數:7,代碼來源:BooleanUtil.java


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