sb.append( " Attribute value : '" ); if ( attrVal.isHumanReadable() )
sb.append( " Attribute value : '" ); if ( attrVal.isHumanReadable() )
sb.append( " Attribute value : '" ); if ( attrVal.isHumanReadable() )
/** * @see Object#toString() */ public String toString() { return "CompareContext for Dn '" + getDn().getName() + "'" + ( ( oid != null ) ? ", oid : <" + oid + ">" : "" ) + ( ( value != null ) ? ", value :'" + ( ( value.isHumanReadable() ) ? value.getValue() : ( ( !value.isHumanReadable() ) ? Strings.dumpBytes( value.getBytes() ) : "unknown value type" ) ) + "'" : "" ); } }
private LscDatasets convertEntry(Entry entry, boolean onlyFirstValue) { if(entry == null) return null; LscDatasets converted = new LscDatasets(); Iterator<Attribute> entryAttributes = entry.iterator(); while(entryAttributes.hasNext()) { Attribute attr = entryAttributes.next(); if(attr != null && attr.size() > 0) { Iterator<Value<?>> values = attr.iterator(); if(!onlyFirstValue) { Set<Object> datasetsValues = new HashSet<Object>(); while(values.hasNext()) { Value<?> value = values.next(); if (value.isHumanReadable()) { datasetsValues.add(value.getString()); } else { datasetsValues.add(value.getBytes()); } } converted.getDatasets().put(attr.getId(), datasetsValues); } else { Value<?> value = values.next(); converted.getDatasets().put(attr.getId(), value.isHumanReadable() ? value.getString() : value.getBytes()); } } } return converted; }
if ( value.isHumanReadable() )
private int compareValues( Ava that ) { int comp; if ( value.isHumanReadable() ) { comp = value.compareTo( that.value ); return comp; } else { byte[] bytes1 = value.getBytes(); byte[] bytes2 = that.value.getBytes(); for ( int pos = 0; pos < bytes1.length; pos++ ) { int v1 = bytes1[pos] & 0x00FF; int v2 = bytes2[pos] & 0x00FF; if ( v1 > v2 ) { return 1; } else if ( v2 > v1 ) { return -1; } } return 0; } }
private int compareValues( Ava that ) { int comp; if ( value.isHumanReadable() ) { comp = value.compareTo( that.value ); return comp; } else { byte[] bytes1 = value.getBytes(); byte[] bytes2 = that.value.getBytes(); for ( int pos = 0; pos < bytes1.length; pos++ ) { int v1 = bytes1[pos] & 0x00FF; int v2 = bytes2[pos] & 0x00FF; if ( v1 > v2 ) { return 1; } else if ( v2 > v1 ) { return -1; } } return 0; } }
private int compareValues( Ava that ) { int comp; if ( value.isHumanReadable() ) { comp = value.compareTo( that.value ); return comp; } else { byte[] bytes1 = value.getBytes(); byte[] bytes2 = that.value.getBytes(); for ( int pos = 0; pos < bytes1.length; pos++ ) { int v1 = bytes1[pos] & 0x00FF; int v2 = bytes2[pos] & 0x00FF; if ( v1 > v2 ) { return 1; } else if ( v2 > v1 ) { return -1; } } return 0; } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value.isHumanReadable() ) { return escapeFilterValue( value.getValue() ); } else { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value.isHumanReadable() ) { return escapeFilterValue( value.getValue() ); } else { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } }
/** * @return representation of value, escaped for use in a filter if required */ public String getEscapedValue() { if ( value.isHumanReadable() ) { return escapeFilterValue( value.getValue() ); } else { return escapeFilterValue( value.getAttributeType(), value.getBytes() ); } }
if ( value.isHumanReadable() )
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }
/** * {@inheritDoc} */ @Override public boolean compare( Dn dn, String attributeName, Value value ) throws LdapException { CompareRequest compareRequest = new CompareRequestImpl(); compareRequest.setName( dn ); compareRequest.setAttributeId( attributeName ); if ( value.isHumanReadable() ) { compareRequest.setAssertionValue( value.getValue() ); } else { compareRequest.setAssertionValue( value.getBytes() ); } CompareResponse compareResponse = compare( compareRequest ); return processResponse( compareResponse ); }