| 程序包 | 说明 |
|---|---|
| com.jn.langx | |
| com.jn.langx.cache | |
| com.jn.langx.configuration.file.directoryfile | |
| com.jn.langx.factory | |
| com.jn.langx.proxy | |
| com.jn.langx.proxy.aop | |
| com.jn.langx.proxy.targetdelegate | |
| com.jn.langx.text | |
| com.jn.langx.util |
This package contain all most utility classes for java coding
|
| com.jn.langx.util.collection |
many collection utility class
|
| com.jn.langx.util.concurrent | |
| com.jn.langx.util.function | |
| com.jn.langx.util.id | |
| com.jn.langx.util.id.snowflake | |
| com.jn.langx.util.reflect.parameter | |
| com.jn.langx.util.valuegetter |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
IdGenerator<E> |
| 限定符和类型 | 方法和说明 |
|---|---|
V |
Cache.get(K key,
Supplier<K,V> loader) |
V |
AbstractCache.get(K key,
Supplier<K,V> loader) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
DirectoryBasedFileConfigurationLoader.setConfigurationIdSupplier(Supplier<String,String> configurationIdSupplier) |
void |
DirectoryBasedFileConfigurationWriter.setFilenameSupplier(Supplier<String,String> filenameSupplier) |
void |
DirectoryBasedFileConfigurationLoader.setFilenameSupplier(Supplier<String,String> filenameSupplier) |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
Factory<I,O> |
interface |
Provider<I,O> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
ThreadLocalFactory<I,E> |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
ProxyFactory<I,O> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
SimpleProxyFactory |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
MethodInterceptorChainProvider |
| 限定符和类型 | 类和说明 |
|---|---|
class |
AopProxyFactory |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
TargetDelegateProvider |
| 限定符和类型 | 方法和说明 |
|---|---|
static Supplier<Object[],String> |
StringTemplates.beanStyleSupplier(String template) |
static Supplier<Object[],String> |
StringTemplates.cStyleSupplier(String template) |
static Supplier<Object[],String> |
StringTemplates.indexStyleSupplier(String template) |
static Supplier<Object[],String> |
StringTemplates.mapStyleSupplier(String template) |
static Supplier<Object[],String> |
StringTemplates.mapStyleSupplier(String template,
MapBasedStringFormatter.PatternStyle patternStyle) |
static Supplier<Object[],String> |
StringTemplates.placeholderStyleSupplier(String template) |
static Supplier<Object[],String> |
StringTemplates.supplier(String template) |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
Preconditions.checkArgument(boolean expression,
Supplier<Object[],String> errorMessageSupplier,
Object... params) |
static <T> T |
Preconditions.checkNotEmpty(T obj,
Supplier<Object[],String> errorMessageSupplier,
Object... params) |
static <T> T |
Preconditions.checkNotNull(T obj,
Supplier<Object[],String> errorMessageSupplier,
Object... params) |
static void |
Preconditions.checkTrue(boolean expression,
Supplier<Object[],String> errorMessageSupplier,
Object... params) |
static <T> T |
Objects.requireNonNull(T obj,
Supplier<Object[],String> messageSupplier,
Object... params)
Checks that the specified object reference is not
null and
throws a customized NullPointerException if it is. |
static <T> T |
Preconditions.test(Predicate<T> predicate,
T argument,
Supplier<Object[],String> messageSupplier,
Object... params) |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> E[] |
Arrs.createArray(Class<E> componentType,
int length,
Supplier<Integer,E> initSupplier)
Create an array with the specified length and every element's value is supplied by the specified initSupplier
|
static <K,V> NonAbsentHashMap<K,V> |
Collects.emptyNonAbsentHashMap(Supplier<K,V> supplier) |
V |
WrappedNonAbsentMap.get(Object key,
Supplier<K,V> supplier) |
V |
NonAbsentTreeMap.get(Object key,
Supplier<K,V> supplier) |
V |
NonAbsentHashMap.get(Object key,
Supplier<K,V> supplier) |
static <E> void |
Arrs.initArray(E[] array,
Supplier<Integer,E> initSupplier) |
static <K,V> V |
Maps.putIfAbsent(Map<K,V> map,
K key,
Supplier<K,V> supplier) |
V |
LinkedCaseInsensitiveMap.supplyIfAbsent(String key,
Supplier<? super String,? extends V> supplier) |
static <K,V> WrappedNonAbsentMap<K,V> |
WrappedNonAbsentMap.wrap(Map<K,V> map,
Supplier<K,V> supplier) |
static <K,V> WrappedNonAbsentMap<K,V> |
Collects.wrapAsNonAbsentMap(Map<K,V> map,
Supplier<K,V> supplier) |
| 构造器和说明 |
|---|
NonAbsentHashMap(int initialCapacity,
float loadFactor,
Supplier<K,V> supplier) |
NonAbsentHashMap(int initialCapacity,
Supplier<K,V> supplier) |
NonAbsentHashMap(Map<? extends K,? extends V> m,
Supplier<K,V> supplier) |
NonAbsentHashMap(Supplier<K,V> supplier) |
NonAbsentTreeMap(Comparator<? super K> comparator,
Supplier<K,V> supplier) |
NonAbsentTreeMap(Map<? extends K,? extends V> m,
Supplier<K,V> supplier) |
NonAbsentTreeMap(SortedMap<K,? extends V> m,
Supplier<K,V> supplier) |
NonAbsentTreeMap(Supplier<K,V> supplier) |
WrappedNonAbsentMap(Map<K,V> map,
Supplier<K,V> supplier) |
| 限定符和类型 | 类和说明 |
|---|---|
class |
CommonThreadFactory
Assume :
1) one prefix to many factory
2) one factory to many thread
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <K,V> Supplier<K,List<V>> |
Functions.emptyArrayListSupplier()
Supplier
|
static <I,E> Supplier<I,HashSet<E>> |
Functions.emptyHashSetSupplier() |
static <I,E> Supplier<I,LinkedHashSet<E>> |
Functions.emptyLinkedHashSetSupplier() |
static <K,V> Supplier<K,List<V>> |
Functions.emptyLinkedListSupplier() |
static <I,V> Supplier<I,Set<V>> |
Functions.emptyTreeSetSupplier(Comparator<V> comparator) |
static <T> Supplier<T,T> |
Functions.noopSupplier() |
| 限定符和类型 | 类和说明 |
|---|---|
class |
AutoIncrementIdGenerator |
class |
Base64IdGenerator
https://github.com/elastic/elasticsearch/tree/master/server/src/main/java/org/elasticsearch/common
|
class |
SimpleIdGenerator
A simple
IdGenerator that starts at 1 and increments by 1 with each call. |
class |
SnowflakeIdGenerator |
class |
UuidGenerator |
| 限定符和类型 | 类和说明 |
|---|---|
class |
CnblogsSnowflakeIdWorker |
class |
SnowflakeIdWorker
reference: https://github.com/twitter/snowflake
reference: https://www.cnblogs.com/relucent/p/4955340.html
Twitter_Snowflake
SnowFlake的结构如下(每部分用-分开): 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截) 得到的值),这里的的开始时间截,一般是我们的id生成器开始使用的时间,由我们程序来指定的(如下下面程序IdWorker类的startTime属性)。 |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
ConstructorParameterSupplier |
interface |
MethodParameterSupplier |
interface |
ParameterSupplier<E,O extends Parameter<E>> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
AbstractConstructorParameterSupplier |
class |
AbstractMethodParameterSupplier |
class |
Java6ConstructorParameterSupplier |
class |
Java6MethodParameterSupplier |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
ValueGetter<T,V> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
ArrayOrIterableValueGetter<V>
已过时。
|
class |
ArrayValueGetter<E> |
class |
CompositeValueGetter |
class |
IterableValueGetter<V> |
class |
LinerCollectionValueGetter<V> |
class |
LiteralValueGetter<V> |
class |
MapValueGetter<V> |
class |
MemberValueGetter<M extends Member,T,V> |
class |
PipelineValueGetter |
class |
StreamValueGetter<O> |
Copyright © 2020. All rights reserved.