org.apache.commons.lang3.BooleanUtils.toStringTrueFalse()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.commons.lang3.BooleanUtils.toStringTrueFalse()方法的一些代码示例,展示了BooleanUtils.toStringTrueFalse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BooleanUtils.toStringTrueFalse()方法的具体详情如下:
包路径:org.apache.commons.lang3.BooleanUtils
类名称:BooleanUtils
方法名:toStringTrueFalse

BooleanUtils.toStringTrueFalse介绍

[英]Converts a Boolean to a String returning 'true', 'false', or null.

BooleanUtils.toStringTrueFalse(Boolean.TRUE)  = "true" 
BooleanUtils.toStringTrueFalse(Boolean.FALSE) = "false" 
BooleanUtils.toStringTrueFalse(null)          = null;

[中]将布尔值转换为返回“true”、“false”或null的字符串。

BooleanUtils.toStringTrueFalse(Boolean.TRUE)  = "true" 
BooleanUtils.toStringTrueFalse(Boolean.FALSE) = "false" 
BooleanUtils.toStringTrueFalse(null)          = null;

代码示例

代码示例来源:origin: org.apache.commons/commons-lang3

@Test
public void test_toStringTrueFalse_Boolean() {
  assertNull(BooleanUtils.toStringTrueFalse(null));
  assertEquals("true", BooleanUtils.toStringTrueFalse(Boolean.TRUE));
  assertEquals("false", BooleanUtils.toStringTrueFalse(Boolean.FALSE));
}

代码示例来源:origin: org.apache.commons/commons-lang3

@Test
public void test_toStringTrueFalse_boolean() {
  assertEquals("true", BooleanUtils.toStringTrueFalse(true));
  assertEquals("false", BooleanUtils.toStringTrueFalse(false));
}

代码示例来源:origin: anylogic/alogic

@Override
public void addProperty(String name, boolean value) {
  Document doc = this.content.getOwnerDocument();
  Element ele = doc.createElement(name);
  ele.appendChild(doc.createTextNode(BooleanUtils.toStringTrueFalse(value)));
  this.content.appendChild(ele);
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * If you have set <strong>KillDuplicates</strong> to <strong>Reference</strong>, <strong>ReferenceMatch<i>N</i>
 * </strong> or <strong><i>FieldName</i></strong>, you can set <strong>KeepExisting</strong> to <strong>true
 * </strong> if you want IDOL server to discard the document it has received for indexing and keep the matching 
 * document that it already contains instead.
 * 
 * @param keepExisting Modifies the <strong>KillDuplicates</strong> operation.
 */
public void setKeepExisting(final boolean keepExisting) {
  put(PARAM_KEEP_EXISTING, BooleanUtils.toStringTrueFalse(keepExisting));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Adds host details to the exported filename. For example, the following action could generate a series of files 
 * named <strong>backup-myservername.domain.com-16502-0.idx.gz</strong>:
 * <p />
 * <strong>DREEXPORTIDX&amp;filename=backup&amp;hostdetails=true</strong>
 * 
 * @param hostDetails Adds host details to the exported filename.
 */
public void setHostDetails(final boolean hostDetails) {
  put(PARAM_HOST_DETAILS, BooleanUtils.toStringTrueFalse(hostDetails));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * When set to <tt>true</tt>, IDOL server deletes the file you are indexing after it is indexed.
 * 
 * @param delete <tt>true</tt> to delete the IDX or XML file after indexing.
 */
public void setDelete(final boolean delete) {
  put(PARAM_DELETE, BooleanUtils.toStringTrueFalse(delete));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * If you specify <strong>true</strong>, the specified field and value are simply added to the specified document.
 * If there are existing instances of the field, the data is added as a new instance. If you specify <strong>false
 * </strong>, all fields whose name matches the specified field are removed from the document before the specified
 * field and value are written into it. The specified data replaces any pre-existing data for that field.
 *
 * @param insertValue Whether to add new instances of a specified field, or just replace values in existing
 *         instances.
 */
public void setInsertValue(final boolean insertValue) {
  put(PARAM_INSERT_VALUE, BooleanUtils.toStringTrueFalse(insertValue));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Enter <tt>true</tt> if you want to compress the exported files. Enter <tt>false</tt> if you don't want to
 * compress the files.
 * 
 * @param compress <tt>true</tt> to compress the exported files.
 */
public void setCompress(final boolean compress) {
  put(PARAM_COMPRESS, BooleanUtils.toStringTrueFalse(compress));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Specify <tt>true</tt> to create a database that is read-only. 
 * 
 * @param readOnly Specifies if the database is read-only. 
 */
public void setReadOnly(final boolean readOnly) {
  put(PARAM_READ_ONLY, BooleanUtils.toStringTrueFalse(readOnly));
}

代码示例来源:origin: anylogic/alogic

@Override
public void setLoggedIn(boolean loggedIn){
  this.hSet(DEFAULT_GROUP,LOGIN_KEY, BooleanUtils.toStringTrueFalse(loggedIn), true);
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Specify <strong>true</strong> to allow the data to contain multiple #DREFIELDNAME/#DREFIELDVALUE pairs in which
 * #DREFIELDNAME has the same value. This allows you to create multiple instances of the same field with different
 * values. Specify <strong>false</strong> to require that the data contain only one #DREFIELDNAME/#DREFIELDVALUE
 * pair for each field name.
 *
 * @param multipleValues Whether to allow multiple #DREFIELDNAME/#DREFIELDVALUE pairs for the same field name.
 */
public void setMultipleValues(final boolean multipleValues) {
  put(PARAM_MULTIPLE_VALUES, BooleanUtils.toStringTrueFalse(multipleValues));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * If set to <tt>true</tt>, the database into which the document is to be indexed is searched for duplicate matches.
 * 
 * @param killDuplicatesMatchTargetDB If set to <tt>true</tt>, the database into which the document is to be indexed
 *         is searched for duplicate matches.
 */
public void setKillDuplicatesMatchTargetDB(final boolean killDuplicatesMatchTargetDB) {
  put(PARAM_KILL_DUPLICATES_MATCH_TARGET_DB, BooleanUtils.toStringTrueFalse(killDuplicatesMatchTargetDB));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Enter <strong>true</strong> if you want to delete the documents from IDOL server after exporting them. (Documents
 * are deleted only if the export is successful.) Enter <strong>false</strong> if you don’t want to delete the 
 * documents.
 * 
 * @param delete Specifies whether the exported documents are to be deleted.
 */
public void setDelete(final boolean delete) {
  put(PARAM_DELETE, BooleanUtils.toStringTrueFalse(delete));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Specify <strong>true</strong> if you want each DREADD command on the target IDOL server to complete before 
 * another indexing command starts. Specify <strong>false</strong> if you don’t want <strong>DREEXPORTREMOTE
 * </strong>to wait for each indexing command to complete before executing the next.
 * 
 * @param blocking Specifies whether each indexing command on target IDOL server should finish before next one 
 *         starts.
 */
public void setBlocking(final boolean blocking) {
  put(PARAM_BLOCKING, BooleanUtils.toStringTrueFalse(blocking));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Enter <strong>true</strong> if you want to delete the documents from IDOL server after exporting them. (Documents
 * are deleted only if the export is successful.)
 * <p />
 * Enter <strong>false</strong> if you don't want to delete the documents.
 *
 * @param delete Specifies whether the exported documents are to be deleted.
 */
public void setDelete(final boolean delete) {
  put(PARAM_DELETE, BooleanUtils.toStringTrueFalse(delete));
}

代码示例来源:origin: com.hp.autonomy.idol/indexing-api

/**
 * Specify <tt>true</tt> to create an internal database. 
 * 
 * @param internal Specifies if the database is internal.
 */
public void setInternal(final boolean internal) {
  put(PARAM_INTERNAL, BooleanUtils.toStringTrueFalse(internal));
}

代码示例来源:origin: anylogic/alogic

@Override
  protected void onExecute(Session session, XsObject root,
      XsObject current, LogicletContext ctx, ExecuteWatcher watcher) {
    ctx.SetValue(ID_SESSION_ID, session.getId());
    ctx.SetValue(ID_SESSION_IS_LOGIN, BooleanUtils.toStringTrueFalse(session.isLoggedIn()));
    ctx.SetValue(ID_SESSION_IS_EXPIRE, BooleanUtils.toStringTrueFalse(session.isExpired()));
  }        
}

代码示例来源:origin: anylogic/alogic

@Override
  protected void onExecute(XsObject root,XsObject current, LogicletContext ctx,
      ExecuteWatcher watcher) {
    VirtualFileSystem vfs = ctx.getObject(pid);
    if (vfs == null){
      throw new BaseException("core.e1001",String.format("Can not find vfs:%s", pid));
    }
    
    String pathValue = ctx.transform(path);
    ctx.SetValue(id, BooleanUtils.toStringTrueFalse(vfs.deleteFile(pathValue)));
  }
}

代码示例来源:origin: anylogic/alogic

@Override
protected void onExecute(CacheObject cache, Map<String, Object> root,
    Map<String, Object> current, LogicletContext ctx,
    ExecuteWatcher watcher) {
  String id = PropertiesConstants.transform(ctx, $id, "$" + getXmlTag());
  
  if (StringUtils.isNotEmpty(id)){
    ctx.SetValue(id, BooleanUtils.toStringTrueFalse(cache.sExist(
        PropertiesConstants.transform(ctx, $group, CacheObject.DEFAULT_GROUP), 
        PropertiesConstants.transform(ctx, $member, ""))));
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-test-lib

/**
 * @return the value of the selected option, or null if no selected
 * option.
 */
@Override
public String getValue() {
  if (isReadOnly()) {
    return super.getAttribute(SeleniumWComponentWebProperties.ATTRIBUTE_WRAPPED_VALUE.toString());
  }
  return BooleanUtils.toStringTrueFalse(getInputField().isSelected());
}

相关文章