| 程序包 | 说明 |
|---|---|
| com.jn.langx | |
| com.jn.langx.jndi.template | |
| com.jn.langx.net.port | |
| 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.completion | |
| com.jn.langx.util.function | |
| com.jn.langx.util.id | |
| com.jn.langx.util.id.snowflake | |
| com.jn.langx.util.struct |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
IdGenerator<E> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
JndiObjectFactory<T>
A factory implementation intended to be used to look up objects in jndi.
|
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
LocalPortGenerator |
| 限定符和类型 | 类和说明 |
|---|---|
class |
NativeLocalTcpPortGenerator |
class |
NativeLocalUdpPortGenerator |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
Objects.requireNonNull(T obj,
Supplier0<String> messageSupplier)
已过时。
|
static <T> T |
Objects.requireNonNullElseGet(T obj,
Supplier0<? extends T> supplier)
已过时。
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <E,R> R |
Collects.collect(Object anyObject,
Supplier0<R> containerFactory,
Consumer2<R,E> consumer) |
static <K,E> Map<K,List<E>> |
Collects.groupBy(E[] iterable,
Function<E,K> classifier,
Supplier0<Map<K,List<E>>> mapFactory) |
<K> Map<K,List<E>> |
Pipeline.groupBy(Function<E,K> classifier,
Supplier0<Map<K,List<E>>> mapFactory) |
static <K,E,C extends Collection<E>> |
Collects.groupBy(Iterable<E> iterable,
Function<E,K> classifier,
Supplier0<Map<K,List<E>>> mapFactory) |
static <E,K> Collector<E,Map<K,List<E>>> |
Collects.groupingBy(Function<E,K> classifier,
Supplier0<Map<K,List<E>>> mapFactory) |
static <E,K> Collector<E,Map<K,List<E>>> |
Collects.groupingBy(Function2<Integer,E,K> classifier,
Supplier0<Map<K,List<E>>> mapFactory) |
static <E,K,V> Collector<E,Map<K,V>> |
Collects.toMap(Supplier0<Map<K,V>> mapFactory,
Function<E,K> keyMapper,
Function<E,V> valueMapper) |
| 限定符和类型 | 方法和说明 |
|---|---|
static <U> CompletableFuture<U> |
CompletableFuture.supplyAsync(Supplier0<U> supplier0)
Returns a new CompletableFuture that is asynchronously completed
by a task running in the { ForkJoinPool#commonPool()} with
the value obtained by calling the given Supplier0.
|
static <U> CompletableFuture<U> |
CompletableFuture.supplyAsync(Supplier0<U> supplier0,
Executor executor)
Returns a new CompletableFuture that is asynchronously completed
by a task running in the given executor with the value obtained
by calling the given Supplier0.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> Supplier0<HashSet<E>> |
Functions.emptyHashSetSupplier0() |
static <E> Supplier0<TreeSet<E>> |
Functions.emptyTreeSetSupplier0(Comparator<E> comparator) |
Supplier0<C> |
Collector.supplier() |
| 限定符和类型 | 类和说明 |
|---|---|
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 |
VMIdGenerator |
| 限定符和类型 | 类和说明 |
|---|---|
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属性)。 |
| 构造器和说明 |
|---|
ThreadLocalHolder(Supplier0<V> supplier) |
Copyright © 2020. All rights reserved.