public boolean equals( Object obj ) { if ( this == obj ) return true; if ( obj == null ) return false; if ( getClass() != obj.getClass() ) return false; final StoredProcedureSearchContextOption other = ( StoredProcedureSearchContextOption ) obj; if ( baseObject == null ) { if ( other.baseObject != null ) return false; } else if ( !baseObject.equals( other.baseObject ) ) return false; if ( searchScope == null ) { if ( other.searchScope != null ) return false; } else if ( !searchScope.equals( other.searchScope ) ) return false; return true; }
/** * Gets the SearchScope enumerated type for the corresponding * LDAP URL scope value of either base, one or sub. * * @param ldapUrlValue the LDAP URL scope value to get SearchScope for * @return the SearchScope enumerated type for the LDAP URL scope value */ public static int getSearchScope( String ldapUrlValue ) { if ( "base".equalsIgnoreCase( ldapUrlValue ) ) { return OBJECT.getScope(); } else if ( "one".equalsIgnoreCase( ldapUrlValue ) ) { return ONELEVEL.getScope(); } else if ( "sub".equalsIgnoreCase( ldapUrlValue ) ) { return SUBTREE.getScope(); } else { throw new IllegalArgumentException( I18n.err( I18n.ERR_04161, ldapUrlValue ) ); } }
/** * Sets the scope. Must be one of {@link SearchScope.OBJECT}, * {@link SearchScope.ONELEVEL} or {@link SearchScope.SUBTREE}, * otherwise {@link SearchScope.OBJECT} is assumed as default. * * @param scope the new scope */ public void setScope( int scope ) { try { this.scope = SearchScope.getSearchScope( scope ); } catch ( IllegalArgumentException iae ) { this.scope = SearchScope.OBJECT; } }
/** * @see java.lang.Object#hashCode() * @return the instance's hash code */ public int hashCode() { int h = 37; h = h*17 + ( ( baseObject == null ) ? 0 : baseObject.hashCode() ); h = h*17 + ( ( searchScope == null ) ? 0 : searchScope.hashCode() ); return h; }
sb.append( scope.getLdapUrlValue() ); sb.append( scope.getLdapUrlValue() ); break;
/** * @see Object#hashCode() * @return the instance's hash code */ public int hashCode() { int h = 37; h = h*17 + super.hashCode(); h = h*17 + ( aliasDerefAliases != null ? aliasDerefAliases.hashCode() : 0 ); h = h*17 + ( baseDn != null ? baseDn.hashCode() : 0 ); h = h*17 + scope.getScope(); return h; }
searchRequest.setScope( SearchScope.getSearchScope( scope ) );
Value.encodeEnumerated( buffer, scope.getScope() );
public static SearchParams toSearchParams( SearchControls searchControls, AliasDerefMode aliasDerefMode ) { SearchParams searchParams = new SearchParams(); searchParams.setAliasDerefMode( aliasDerefMode ); searchParams.setTimeLimit( searchControls.getTimeLimit() ); searchParams.setSizeLimit( searchControls.getCountLimit() ); searchParams.setScope( SearchScope.getSearchScope( searchControls.getSearchScope() ) ); searchParams.setTypesOnly( searchControls.getReturningObjFlag() ); if ( searchControls.getReturningAttributes() != null ) { for ( String returningAttribute : searchControls.getReturningAttributes() ) { searchParams.addReturningAttributes( returningAttribute ); } } searchParams.searchControls = searchControls; return searchParams; }