Polish JavaFormat in Core
This commit is contained in:
@@ -299,26 +299,6 @@ public class DistinguishedName implements Name {
|
||||
return this.names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the String representation of this <code>DistinguishedName</code>. Depending on
|
||||
* the setting of property <code>org.springframework.ldap.core.spacedDnFormat</code> a
|
||||
* space will be added after each comma, to make the result more readable. Default is
|
||||
* compact representation, i.e. without any spaces.
|
||||
* @return a syntactically correct, properly escaped String representation of the
|
||||
* <code>DistinguishedName</code>.
|
||||
* @see #SPACED_DN_FORMAT_PROPERTY
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
String spacedFormatting = System.getProperty(SPACED_DN_FORMAT_PROPERTY);
|
||||
if (!StringUtils.hasText(spacedFormatting)) {
|
||||
return format(COMPACT);
|
||||
}
|
||||
else {
|
||||
return format(NON_COMPACT);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the compact String representation of this <code>DistinguishedName</code>. Add
|
||||
* no space after each comma, to make it compact.
|
||||
@@ -544,6 +524,26 @@ public class DistinguishedName implements Name {
|
||||
return this.getClass().hashCode() ^ getNames().hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the String representation of this <code>DistinguishedName</code>. Depending on
|
||||
* the setting of property <code>org.springframework.ldap.core.spacedDnFormat</code> a
|
||||
* space will be added after each comma, to make the result more readable. Default is
|
||||
* compact representation, i.e. without any spaces.
|
||||
* @return a syntactically correct, properly escaped String representation of the
|
||||
* <code>DistinguishedName</code>.
|
||||
* @see #SPACED_DN_FORMAT_PROPERTY
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
String spacedFormatting = System.getProperty(SPACED_DN_FORMAT_PROPERTY);
|
||||
if (!StringUtils.hasText(spacedFormatting)) {
|
||||
return format(COMPACT);
|
||||
}
|
||||
else {
|
||||
return format(NON_COMPACT);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare this instance to another object. Note that the comparison is done in order
|
||||
* of significance, so the most significant Rdn is compared first, then the second and
|
||||
|
||||
@@ -149,16 +149,6 @@ public class LdapRdnComponent implements Comparable, Serializable {
|
||||
return buff.toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return getLdapEncoded();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The LdapRdn as a string where the value is LDAP-encoded.
|
||||
*/
|
||||
@@ -182,16 +172,6 @@ public class LdapRdnComponent implements Comparable, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.key.toUpperCase().hashCode() ^ this.value.toUpperCase().hashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -213,6 +193,26 @@ public class LdapRdnComponent implements Comparable, Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.key.toUpperCase().hashCode() ^ this.value.toUpperCase().hashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return getLdapEncoded();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare this instance to the supplied object.
|
||||
* @param obj the object to compare to.
|
||||
|
||||
@@ -82,14 +82,6 @@ class RangeOption implements Comparable<RangeOption> {
|
||||
return getInitial() == 0 && getTerminal() == TERMINAL_END_OF_RANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder rangeBuilder = new StringBuilder();
|
||||
appendTo(rangeBuilder);
|
||||
|
||||
return rangeBuilder.toString();
|
||||
}
|
||||
|
||||
void appendTo(StringBuilder rangeBuilder) {
|
||||
rangeBuilder.append("Range=").append(this.initial);
|
||||
|
||||
@@ -191,6 +183,14 @@ class RangeOption implements Comparable<RangeOption> {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder rangeBuilder = new StringBuilder();
|
||||
appendTo(rangeBuilder);
|
||||
|
||||
return rangeBuilder.toString();
|
||||
}
|
||||
|
||||
RangeOption nextRange(int pageSize) {
|
||||
if (getTerminal() < 0) {
|
||||
throw new IllegalStateException("Cannot generate next range, range-terminal: " + getTerminal());
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.springframework.ldap.filter;
|
||||
* AndFilter filter = new AndFilter();
|
||||
* filter.and(new EqualsFilter("objectclass", "person");
|
||||
* filter.and(new EqualsFilter("cn", "Some CN");
|
||||
* System.out.println(filter.encode());
|
||||
* System.out.println(filter.encode());
|
||||
* </pre>
|
||||
*
|
||||
* would result in: <code>(&(objectclass=person)(cn=Some CN))</code>
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.springframework.ldap.filter;
|
||||
* OrFilter filter = new OrFilter();
|
||||
* filter.or(new EqualsFilter("objectclass", "person");
|
||||
* filter.or(new EqualsFilter("objectclass", "organizationalUnit");
|
||||
* System.out.println(filter.encode());
|
||||
* System.out.println(filter.encode());
|
||||
* </pre>
|
||||
*
|
||||
* would result in: <code>(|(objectclass=person)(objectclass=organizationalUnit))</code>
|
||||
|
||||
@@ -596,7 +596,7 @@ public final class LdapUtils {
|
||||
* dddd (four bytes of "d" treated as a 32-bit number in little-endian format)
|
||||
* eeee (four bytes of "e" treated as a 32-bit number in little-endian format)
|
||||
* ffff (four bytes of "f" treated as a 32-bit number in little-endian format)
|
||||
* etc.
|
||||
* etc.
|
||||
*
|
||||
* So for example, if your SID is S-1-5-21-2127521184-1604012920-1887927527-72713, then your raw hex SID is
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user