| 程序包 | 说明 |
|---|---|
| com.jn.langx | |
| com.jn.langx.distributed.id.snowflake | |
| com.jn.langx.distributed.session | |
| com.jn.langx.jndi.template | |
| com.jn.langx.security.crypto.cipher | |
| com.jn.langx.security.crypto.key.spec.pem | |
| 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.collection.multivalue | |
| com.jn.langx.util.concurrent.completion | |
| com.jn.langx.util.enums | |
| com.jn.langx.util.function | |
| com.jn.langx.util.function.predicate | |
| com.jn.langx.util.id | |
| com.jn.langx.util.net.port | |
| com.jn.langx.util.struct |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
IdGenerator<E> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
CnblogsSnowflakeIdWorker |
class |
SnowflakeIdGenerator |
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 |
SessionIdGenerator<E> |
| 限定符和类型 | 类和说明 |
|---|---|
class |
JndiObjectFactory<T>
A factory implementation intended to be used to look up objects in jndi.
|
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
CipherAlgorithmSuiteSupplier |
| 限定符和类型 | 类和说明 |
|---|---|
class |
BuiltinCipherAlgorithmSuiteSupplier |
| 限定符和类型 | 方法和说明 |
|---|---|
static PrivateKey |
PEMs.readPrivateKey(BufferedReader pemKeyFile,
Supplier0<char[]> passwordSupplier) |
static PrivateKey |
PEMs.readPrivateKey(File keyFile,
Supplier0<char[]> passwordSupplier)
Creates a
PrivateKey from the contents of a file. |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
Objs.requireNonNull(T obj,
Supplier0<String> messageSupplier) |
static <T> T |
Objs.useValueIfMatch(Supplier0<T> valueSupplier,
Predicate<T> predicate,
Supplier<T,T> defaultSupplier) |
static <T> T |
Objs.useValueIfNotMatch(Supplier0<T> valueSupplier,
Predicate<T> predicate,
Supplier<T,T> defaultSupplier) |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E,R> R |
Collects.collect(Object anyObject,
Supplier0<R> containerFactory,
Consumer2<R,E> consumer) |
static <K,V> V |
Maps.get(Map<K,V> map,
K key,
Supplier0<V> defaultValueSupplier) |
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) |
| 构造器和说明 |
|---|
CommonMultiValueMap(Supplier0<Map<K,Collection<V>>> mapSupplier,
Supplier<K,Collection<V>> valuesSupplier) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 <T extends Enum<T>> |
Enums.ofField(Class<T> targetClass,
String field,
Supplier0<Object> valueSupplier) |
static <T extends Enum<T>> |
Enums.ofField(Class<T> targetClass,
String field,
Supplier0<Object> valueSupplier,
Predicate<T> predicate) |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> Supplier0<HashSet<E>> |
Functions.emptyHashSetSupplier0() |
static <E> Supplier0<TreeSet<E>> |
Functions.emptyTreeSetSupplier0(Comparator<E> comparator) |
Supplier0<C> |
Collector.supplier() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
SupplierPredicate.test(Supplier0<V> valueSupplier) |
| 限定符和类型 | 类和说明 |
|---|---|
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 |
UuidGenerator |
class |
VMIdGenerator |
| 限定符和类型 | 接口和说明 |
|---|---|
interface |
LocalPortGenerator |
| 限定符和类型 | 类和说明 |
|---|---|
class |
NativeLocalTcpPortGenerator |
class |
NativeLocalUdpPortGenerator |
| 构造器和说明 |
|---|
ThreadLocalHolder(Supplier0<V> supplier) |
Copyright © 2022. All rights reserved.