Polishing
This commit is contained in:
@@ -358,7 +358,6 @@ public interface DataBuffer {
|
||||
/**
|
||||
* Return this buffer's data a String using the specified charset. Default implementation
|
||||
* delegates to {@code toString(readPosition(), readableByteCount(), charset)}.
|
||||
*
|
||||
* @param charset the character set to use
|
||||
* @return a string representation of all this buffers data
|
||||
* @since 5.2
|
||||
@@ -370,7 +369,6 @@ public interface DataBuffer {
|
||||
|
||||
/**
|
||||
* Return a part of this buffer's data as a String using the specified charset.
|
||||
*
|
||||
* @param index the index at which to start the string
|
||||
* @param length the number of bytes to use for the string
|
||||
* @param charset the charset to use
|
||||
|
||||
@@ -164,8 +164,9 @@ public abstract class DataBufferUtils {
|
||||
* @return a Flux of data buffers read from the given channel
|
||||
* @since 5.2
|
||||
*/
|
||||
public static Flux<DataBuffer> read(Path path, DataBufferFactory bufferFactory, int bufferSize,
|
||||
OpenOption... options) {
|
||||
public static Flux<DataBuffer> read(
|
||||
Path path, DataBufferFactory bufferFactory, int bufferSize, OpenOption... options) {
|
||||
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
Assert.notNull(bufferFactory, "BufferFactory must not be null");
|
||||
Assert.isTrue(bufferSize > 0, "'bufferSize' must be > 0");
|
||||
@@ -538,8 +539,8 @@ public abstract class DataBufferUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link Matcher} for the given delimiter. The matcher can be used to find the
|
||||
* delimiters in data buffers.
|
||||
* Return a {@link Matcher} for the given delimiter.
|
||||
* The matcher can be used to find the delimiters in data buffers.
|
||||
* @param delimiter the delimiter bytes to find
|
||||
* @return the matcher
|
||||
* @since 5.2
|
||||
@@ -549,8 +550,8 @@ public abstract class DataBufferUtils {
|
||||
return new KnuthMorrisPrattMatcher(delimiter);
|
||||
}
|
||||
|
||||
/** Return a {@link Matcher} for the given delimiters. The matcher can be used to find the
|
||||
* delimiters in data buffers.
|
||||
/** Return a {@link Matcher} for the given delimiters.
|
||||
* The matcher can be used to find the delimiters in data buffers.
|
||||
* @param delimiters the delimiters bytes to find
|
||||
* @return the matcher
|
||||
* @since 5.2
|
||||
@@ -595,7 +596,6 @@ public abstract class DataBufferUtils {
|
||||
* Resets the state of this matcher.
|
||||
*/
|
||||
void reset();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -730,7 +730,6 @@ public abstract class DataBufferUtils {
|
||||
private boolean isNotDisposed() {
|
||||
return !this.disposed.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -866,12 +865,11 @@ public abstract class DataBufferUtils {
|
||||
this.sink.next(dataBuffer);
|
||||
this.dataBuffer.set(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of {@link Matcher} that uses the Knuth-Morris-Pratt algorithm.
|
||||
*
|
||||
* @see <a href="https://www.nayuki.io/page/knuth-morris-pratt-string-matching">Knuth-Morris-Pratt string matching</a>
|
||||
*/
|
||||
private static class KnuthMorrisPrattMatcher implements Matcher {
|
||||
@@ -882,7 +880,6 @@ public abstract class DataBufferUtils {
|
||||
|
||||
private int matches = 0;
|
||||
|
||||
|
||||
public KnuthMorrisPrattMatcher(byte[] delimiter) {
|
||||
this.delimiter = Arrays.copyOf(delimiter, delimiter.length);
|
||||
this.table = longestSuffixPrefixTable(delimiter);
|
||||
@@ -935,6 +932,7 @@ public abstract class DataBufferUtils {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of {@link Matcher} that wraps several other matchers.
|
||||
*/
|
||||
@@ -946,7 +944,6 @@ public abstract class DataBufferUtils {
|
||||
|
||||
byte[] longestDelimiter = NO_DELIMITER;
|
||||
|
||||
|
||||
public CompositeMatcher(Matcher[] matchers) {
|
||||
this.matchers = matchers;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ public interface RouteMatcher {
|
||||
*/
|
||||
Route parseRoute(String routeValue);
|
||||
|
||||
|
||||
/**
|
||||
* Whether the given {@code route} contains pattern syntax which requires
|
||||
* the {@link #match(String, Route)} method, or if it is a regular String
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
@@ -36,12 +37,18 @@ public class SimpleRouteMatcher implements RouteMatcher {
|
||||
private final PathMatcher pathMatcher;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new {@code SimpleRouteMatcher} for the given
|
||||
* {@link PathMatcher} delegate.
|
||||
*/
|
||||
public SimpleRouteMatcher(PathMatcher pathMatcher) {
|
||||
Assert.notNull(pathMatcher, "PathMatcher is required");
|
||||
this.pathMatcher = pathMatcher;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the underlying {@link PathMatcher} delegate.
|
||||
*/
|
||||
public PathMatcher getPathMatcher() {
|
||||
return this.pathMatcher;
|
||||
}
|
||||
@@ -86,12 +93,10 @@ public class SimpleRouteMatcher implements RouteMatcher {
|
||||
|
||||
private final String path;
|
||||
|
||||
|
||||
DefaultRoute(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String value() {
|
||||
return this.path;
|
||||
|
||||
Reference in New Issue
Block a user