程序包 cn.taketoday.util
@NonNullApi
@NonNullFields
package cn.taketoday.util
Miscellaneous utility classes, such as utilities for working with strings,
classes, collections, reflection, etc.
- 从以下版本开始:
- 2021/3/27 10:45
-
类说明An
IdGeneratorthat usesSecureRandomfor the initial seed andRandomthereafter, instead of callingUUID.randomUUID()every time asJdkIdGeneratordoes.ArrayHolder<E>It is used for the scenario of changing less and reading more frequently.Iterator over an array.A simple utility class for Base64 encoding and decoding.Composite iterator that combines multiple other iterators, as registered viaCompositeIterator.add(Iterator).Support class for throttling concurrent access to a specific resource.ConcurrentCache<K,V> ConcurrentLruCache<K,V> Simple LRU (Least Recently Used) cache, bounded by a specified cache capacity.Draining status for the read/write buffers.Allows a task access toConcurrentReferenceHashMap.Segmententries.A single map entry.A reference to anConcurrentReferenceHashMap.Entrycontained in the map.Various reference types supported by this map.The types of restructuring that can be performed.InternalConcurrentReferenceHashMap.Referenceimplementation forSoftReferences.Various options supported by aTask.InternalConcurrentReferenceHashMap.Referenceimplementation forWeakReferences.Simple customizable helper class for creating newThreadinstances.A data size, such as '12MB'.Static nested class to support lazy loading of theDataSize.DataSizeUtils.PATTERN.A standard set ofDataSizeunits.From hutoolDefault implementation of thePropertiesPersisterinterface.Miscellaneous methods for calculating digests.A strategy for handling errors.AnInstanceFilterimplementation that handles exception types.A speedy alternative toByteArrayOutputStream.An implementation ofInputStreamthat reads from a givenFastByteArrayOutputStream.Simple utility methods for file and stream copying.Utility methods for working with the file system.Contract for generating universally unique identifiers (UUIDs).A simple instance filter that checks if a given instance match based on a collection of includes and excludes element.Instantiator<T>Simple factory used to instantiate objects by injecting available parameters.Callback used to register available parameters.Strategy for handling a failure that occurs when instantiating a type.Supplierthat provides a class type.Exception thrown fromMimeTypeUtils.parseMimeType(String)in case of encountering an invalid content type specification String.AnIdGeneratorthat callsUUID.randomUUID().KeyValueHolder<K,V> An immutable container for a key and a value, suitable for use in creating and populatingMapinstances.Utility that can be used to invoke lambdas in a safe way.LambdaSafe.Callback<C,A> Represents a single callback that can be invoked in a lambda safe way.LambdaSafe.Callbacks<C,A> Represents a collection of callbacks that can be invoked in a lambda safe way.LambdaSafe.Filter<C,A> A filter that can be used to restrict when a callback is used.LambdaSafe.Filterthat matches when the callback has a single generic and primary argument is an instance of it.The result of a callback which may be a value,nullor absent entirely if the callback wasn't suitable.LambdaSafe.LambdaSafeCallback<C,A, SELF extends LambdaSafe.LambdaSafeCallback<C, A, SELF>> Abstract base class for lambda safe callbacks.LinkedHashMapvariant that stores String keys in a case-insensitive manner, for example for key-based access in a results table.LinkedMultiValueMap<K,V> Simple implementation ofMultiValueMapthat wraps aLinkedHashMap, storing multiple values in anArrayList.Utility methods for formatting and logging messages.MapCache<Key,Value, Param> Map cacheMappingMultiValueMap<K,V> A common key class for a method against a specific target class, includingMethodClassKey.toString()representation andComparablesupport (as suggested for customHashMapkeys as of Java 8).Represents a MIME Type, as originally defined in RFC 2046 and subsequently used in other Internet protocols including HTTP.MimeType.SpecificityComparator<T extends MimeType>Comparator to sortMimeTypesin order of specificity.MiscellaneousMimeTypeutility methods.MultiValueMap<K,V> Extension of theMapinterface that stores multiple values.MultiValueMapAdapter<K,V> Adapts a givenMapto theMultiValueMapcontract.Miscellaneous utility methods for number conversion and parsing.Miscellaneous object utility methods.Parser for Strings that have placeholder values in them.APlaceholderParser.Partimplementation that represents a single placeholder containing nested placeholders.A representation of the parsing of an input string.A part is a section of a String containing placeholders to replace.Provide the necessary context to handle and resolve underlying placeholders.APlaceholderParser.Partimplementation that represents a single placeholder with a hard-coded fallback.APlaceholderParser.Partimplementation that does not contain a valid placeholder.Thrown when the resolution of placeholder failed.Strategy interface used to resolve replacement values for placeholders contained in Strings.Strategy interface for persistingjava.util.Properties, allowing for pluggable parsing strategies.Utility that can be used to map values from a supplied source to a destination.Supplier that will catch and ignore anyNullPointerException.A source that is in the process of being mapped.An operation that can be applied to aPropertyMapper.Source.Utility class for working with Strings that have placeholder values in them.Simple utility class for working with the reflection API and handling reflection exceptions.Callback interface invoked on each field in the hierarchy.Callback optionally used to filter fields to be operated on by a field callback.Action to take on each method.Callback optionally used to filter methods to be operated on by a method callback.Helper class that allows for specifying a reflective method to invoke in a declarative fashion, be it static or non-static.An extension ofByteArrayOutputStreamthat: has publicResizableByteArrayOutputStream.grow(int)andResizableByteArrayOutputStream.resize(int)methods to get more control over the size of the internal buffer has a higher initial capacity (256) by defaultContract for matching routes to patterns.A parsed representation of a route.Static utilities for serialization and deserialization using Java Object Serialization.A simpleIdGeneratorthat starts at 1, increments up toLong.MAX_VALUE, and then rolls over.RouteMatcherthat delegates to aPathMatcher.SmartList<E>A List which is optimised for the sizes of 0 and 1, in which cases it would not allocate array at all.Specialization ofPropertiesthat sorts properties alphanumerically based on their keys.Simple stop watch, allowing for timing of a number of tasks, exposing total running time and running time for each named task.Nested class to hold data about one task executed within theStopWatch.Stream IterableSimple utility methods for dealing with streams.MiscellaneousStringutility methods.Helper class for resolving placeholders in texts.PlaceholderResolver implementation that resolves against system properties and system environment variables.Utility to work with Java 5 generic type parameters.Unmodifiable wrapper forMultiValueMap.