当前位置: 首页>>代码示例>>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;未经允许,请勿转载。