org.apache.directory.api.util.Strings.isNotEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(167)

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

Strings.isNotEmpty介绍

[英]Checks if a String is not empty ("") and not null.

StringUtils.isNotEmpty(null)      = false 
StringUtils.isNotEmpty("")        = false 
StringUtils.isNotEmpty(" ")       = true 
StringUtils.isNotEmpty("bob")     = true 
StringUtils.isNotEmpty("  bob  ") = true

[中]检查字符串是否为空(“”)和非空。

StringUtils.isNotEmpty(null)      = false 
StringUtils.isNotEmpty("")        = false 
StringUtils.isNotEmpty(" ")       = true 
StringUtils.isNotEmpty("bob")     = true 
StringUtils.isNotEmpty("  bob  ") = true

代码示例

代码示例来源:origin: org.apache.directory.api/api-all

/**
 *  A constructor that parse a String representing a schema aware Rdn.
 *
 * @param schemaManager the schema manager
 * @param rdn the String containing the Rdn to parse
 * @throws LdapInvalidDnException if the Rdn is invalid
 */
public Rdn( SchemaManager schemaManager, String rdn ) throws LdapInvalidDnException
{
  if ( Strings.isNotEmpty( rdn ) )
  {
    // Parse the string. The Rdn will be updated.
    parse( schemaManager, rdn, this );
    if ( upName.length() < rdn.length() )
    {
      throw new LdapInvalidDnException( I18n.err( I18n.ERR_13625_INVALID_RDN ) );
    }
    upName = rdn;
  }
  else
  {
    upName = "";
    normName = "";
    normalized = true;
  }
  hashCode();
}

代码示例来源:origin: org.apache.directory.api/api-ldap-model

/**
 *  A constructor that parse a String representing a schema aware Rdn.
 *
 * @param schemaManager the schema manager
 * @param rdn the String containing the Rdn to parse
 * @throws LdapInvalidDnException if the Rdn is invalid
 */
public Rdn( SchemaManager schemaManager, String rdn ) throws LdapInvalidDnException
{
  if ( Strings.isNotEmpty( rdn ) )
  {
    // Parse the string. The Rdn will be updated.
    parse( schemaManager, rdn, this );
    if ( upName.length() < rdn.length() )
    {
      throw new LdapInvalidDnException( I18n.err( I18n.ERR_13625_INVALID_RDN ) );
    }
    upName = rdn;
  }
  else
  {
    upName = "";
    normName = "";
    normalized = true;
  }
  hashCode();
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 *  A constructor that parse a String representing a schema aware Rdn.
 *
 * @param schemaManager the schema manager
 * @param rdn the String containing the Rdn to parse
 * @throws LdapInvalidDnException if the Rdn is invalid
 */
public Rdn( SchemaManager schemaManager, String rdn ) throws LdapInvalidDnException
{
  if ( Strings.isNotEmpty( rdn ) )
  {
    // Parse the string. The Rdn will be updated.
    parse( schemaManager, rdn, this );
    if ( upName.length() < rdn.length() )
    {
      throw new LdapInvalidDnException( I18n.err( I18n.ERR_13625_INVALID_RDN ) );
    }
    upName = rdn;
  }
  else
  {
    upName = "";
    normName = "";
    normalized = true;
  }
  hashCode();
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 * {@inheritDoc}
 */
@Override
public BindFuture bindAsync( String name, String credentials ) throws LdapException
{
  if ( LOG.isDebugEnabled() )
  {
    LOG.debug( I18n.msg( I18n.MSG_04102_BIND_REQUEST, name ) );
  }
  // The password must not be empty or null
  if ( Strings.isEmpty( credentials ) && Strings.isNotEmpty( name ) )
  {
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_04105_MISSING_PASSWORD ) );
    }
    
    throw new LdapAuthenticationException( I18n.msg( I18n.MSG_04105_MISSING_PASSWORD ) );
  }
  // Create the BindRequest
  BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ) );
  return bindAsync( bindRequest );
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * {@inheritDoc}
 */
@Override
public BindFuture bindAsync( String name, String credentials ) throws LdapException
{
  if ( LOG.isDebugEnabled() )
  {
    LOG.debug( I18n.msg( I18n.MSG_04102_BIND_REQUEST, name ) );
  }
  // The password must not be empty or null
  if ( Strings.isEmpty( credentials ) && Strings.isNotEmpty( name ) )
  {
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_04105_MISSING_PASSWORD ) );
    }
    
    throw new LdapAuthenticationException( I18n.msg( I18n.MSG_04105_MISSING_PASSWORD ) );
  }
  // Create the BindRequest
  BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ) );
  return bindAsync( bindRequest );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * {@inheritDoc}
 */
@Override
public BindFuture bindAsync( String name, String credentials ) throws LdapException
{
  if ( LOG.isDebugEnabled() )
  {
    LOG.debug( I18n.msg( I18n.MSG_04102_BIND_REQUEST, name ) );
  }
  // The password must not be empty or null
  if ( Strings.isEmpty( credentials ) && Strings.isNotEmpty( name ) )
  {
    if ( LOG.isDebugEnabled() )
    {
      LOG.debug( I18n.msg( I18n.MSG_04105_MISSING_PASSWORD ) );
    }
    
    throw new LdapAuthenticationException( I18n.msg( I18n.MSG_04105_MISSING_PASSWORD ) );
  }
  // Create the BindRequest
  BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ) );
  return bindAsync( bindRequest );
}

相关文章