SerializableEasyTuple2, EasyTuple3, EasyTuple4, EasyTuple5, EasyTuple6, EasyTuple7, EasyTuple8, EasyTuple9, Tuple0, Tuple1, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, Tuple8, Tuple9, TupleBasepublic interface Tuple extends Serializable
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static long |
serialVersionUID |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
<R> R |
__(TupleAlias alias) |
Get tuple element value by alias, it will throw
AliasNotFoundException when alias not found.通过别名获取元组元素的值,如果不存在该别名,将抛出异常 AliasNotFoundException。 |
<R> R |
__(String alias) |
Get tuple element value by alias.
|
Tuple |
alias(TupleAlias... aliases) |
Setting tuple's aliases.
|
Tuple |
alias(String... aliases) |
Setting tuple's aliases.
|
boolean |
aliasesEquals(Tuple tuple) |
Indicates whether some other Tuple object's aliases is "equal to" this one.
|
String |
aliasType() |
Get current alias type: null, tuple, string.
|
int |
arity() |
The size of this Tuple.
元组的元素数量 |
void |
clearAlias() |
clear all aliases.
|
static Tuple |
clone(Tuple tuple) |
clone a tuple by shallow copy.
|
boolean |
containsAlias(TupleAlias alias) |
whether contains alias.
|
boolean |
containsAlias(String alias) |
whether contains alias.
|
Tuple |
copyAliases(Tuple tuple) |
Copy aliases from other tuple.
|
<R> R |
element(int n) |
The nth element of this tuple
从元组中取第n个元素 |
<R> Tuple2<String,R> |
elementWithAlias(int n) |
The nth element with alias of this tuple
从元组中取第n个元素(带别名) |
<R> Tuple2<TupleAlias,R> |
elementWithTupleAlias(int n) |
The nth element with alias of this tuple
从元组中取第n个元素(带别名) |
static Tuple0 |
empty() |
Create empty tuple
创建一个空元组 |
List<String> |
getAliases() |
Get list of aliases.
|
List<TupleAlias> |
getTupleAliases() |
Get list of aliases.
|
static Tuple0 |
of() |
Create empty tuple
创建一个空元组 |
static <T1> Tuple1<T1> |
of(T1 _1) |
Create a tuple of 1 element
创建1个元素的元组 |
static <T1,T2> Tuple2<T1,T2> |
of(T1 _1,
T2 _2) |
Create a tuple of 2 elements
创建2个元素的元组 |
static <T1,T2,T3> Tuple3<T1,T2,T3> |
of(T1 _1,
T2 _2,
T3 _3) |
Create a tuple of 3 elements
创建3个元素的元组 |
static <T1,T2,T3,T4> |
of(T1 _1,
T2 _2,
T3 _3,
T4 _4) |
Create a tuple of 4 elements
创建4个元素的元组 |
static <T1,T2,T3,T4,T5> |
of(T1 _1,
T2 _2,
T3 _3,
T4 _4,
T5 _5) |
Create a tuple of 5 elements
创建5个元素的元组 |
static <T1,T2,T3,T4,T5,T6> |
of(T1 _1,
T2 _2,
T3 _3,
T4 _4,
T5 _5,
T6 _6) |
Create a tuple of 6 elements
创建6个元素的元组 |
static <T1,T2,T3,T4,T5,T6,T7> |
of(T1 _1,
T2 _2,
T3 _3,
T4 _4,
T5 _5,
T6 _6,
T7 _7) |
Create a tuple of 7 elements
创建7个元素的元组 |
static <T1,T2,T3,T4,T5,T6,T7,T8> |
of(T1 _1,
T2 _2,
T3 _3,
T4 _4,
T5 _5,
T6 _6,
T7 _7,
T8 _8) |
Create a tuple of 8 elements
创建8个元素的元组 |
static <T1,T2,T3,T4,T5,T6,T7,T8,T9> |
of(T1 _1,
T2 _2,
T3 _3,
T4 _4,
T5 _5,
T6 _6,
T7 _7,
T8 _8,
T9 _9) |
Create a tuple of 9 elements
创建9个元素的元组 |
<R> Map<String,R> |
toMap() |
Transform this Tuple to Map.
|
SI |
toSI() |
Transform this Tuple to
SI. |
static final long serialVersionUID
int arity()
Tuple alias(TupleAlias... aliases)
arity() , will throw NumberOfAliasesExceptionNumberOfAliasesException Examples:
// MyTupleAlias.java
package mypackage;
public enum MyTupleAlias implements TupleAlias {
// You can put All aliases in one `enum MyTupleAlias` for all Tuple Type,
// or create more enum by category: enum UserAliases, enum AddressAliases ...
// 可以把所有的Tuple要用到的别名全部放在一个枚举类型中,可以使用一些特殊命名为Alias分类,
// 如下面的 $USER_ALIAS$, $ORDER_ALIAS$。
// 也可以创建多个枚举类型用于存储不同的Tuple数据。
$USER_ALIAS$,
ID, NAME, TEL, AGE, BIRTHDAY, PROVINCE, CITY, REGISTERTIME,
$ORDER_ALIAS$,
ORDERID, GOODSID, USERID, PRICE, QUANTITY, ORDERTIME, PAYTIME
}
// TestMain.java
package test.xxx;
import static mypackage.MyTupleAlias.*; // import MyTupleAlias
Tuple3<Integer, String, Integer> tuple = new Tuple3<>(1, "Tom", 20);
tuple.alias(ID, NAME, AGE);
aliases - aliases. 别名NumberOfAliasesException - if the number of aliases is not equal arity(). 如果设置的别名的数量不等于 arity(),抛出此异常UnsupportedOperationException - if this method is called by Tuple0 Tuple0.alias(TupleAlias...).Tuple alias(String... aliases)
alias(TupleAlias...) alias(TupleAlias...) 这个方法设置别名。aliases - aliases. 别名NumberOfAliasesException - if the number of aliases is not equal arity(). 如果设置的别名的数量不等于 arity(),抛出此异常UnsupportedOperationException - if this method is called by Tuple0 Tuple0.alias(String...).alias(TupleAlias...)String aliasType()
alias(TupleAlias...); alias(String...). alias(TupleAlias...) 之后; alias(String...) 之后。Tuple copyAliases(Tuple tuple)
tuple - other tuplevoid clearAlias()
List<TupleAlias> getTupleAliases()
boolean aliasesEquals(Tuple tuple)
tuple - other tuple objecttrue if aliases are equal. 返回true,如果两个tuple的所有别名都相等。<R> R __(TupleAlias alias)
AliasNotFoundException when alias not found.R - return type 返回值类型alias - tuple element alias 别名AliasNotSetException - if call this method before alias(TupleAlias...).
在调用 alias(TupleAlias...) 之前调用此方法,将抛出AliasNotSetExceptionAliasNotFoundException - if the `alias` not found. 如果元组不存在该别名,抛出异常<R> R __(String alias)
__(TupleAlias)R - return type 返回值类型alias - tuple element alias 别名AliasNotSetException - if call this method before alias(String...).
在调用 alias(String...) 之前调用此方法,将抛出AliasNotSetExceptionAliasNotFoundException - if the `alias` not found. 如果元组不存在该别名,抛出异常__(TupleAlias)boolean containsAlias(TupleAlias alias)
alias - alias. 别名true if contains alias. 返回true,如果此tuple包含该别名。boolean containsAlias(String alias)
alias - alias. 别名true if contains alias. 返回true,如果此tuple包含该别名。<R> Map<String,R> toMap()
R - map value type<R> R element(int n)
R - return type 返回值类型n - index 序号IndexOutOfBoundsException - if the `n` is out of range(n < 0 || n >= arity).
当 n < 0 或者 n >= arity() 时,抛出异常。<R> Tuple2<TupleAlias,R> elementWithTupleAlias(int n)
R - return type 返回值类型n - index 序号AliasNotSetException - if call this method before alias(TupleAlias...).
在调用 alias(TupleAlias...) 之前调用此方法,将抛出AliasNotSetExceptionIndexOutOfBoundsException - if the `n` is out of range(n < 0 || n >= arity).
当 n < 0 或者 n >= arity() 时,抛出异常。<R> Tuple2<String,R> elementWithAlias(int n)
R - return type 返回值类型n - index 序号AliasNotSetException - if call this method before alias(String...).
在调用 alias(String...) 之前调用此方法,将抛出AliasNotSetExceptionIndexOutOfBoundsException - if the `n` is out of range(n < 0 || n >= arity).
当 n < 0 或者 n >= arity() 时,抛出异常。static Tuple0 empty()
static Tuple0 of()
static <T1> Tuple1<T1> of(T1 _1)
T1 - type of the 1st element. 第1个元素的类型_1 - the 1st element. 第1个元素static <T1,T2> Tuple2<T1,T2> of(T1 _1, T2 _2)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素static <T1,T2,T3> Tuple3<T1,T2,T3> of(T1 _1, T2 _2, T3 _3)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4> of(T1 _1, T2 _2, T3 _3, T4 _4)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型T4 - type of the 4th element. 第4个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素_4 - the 4th element. 第4个元素static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型T4 - type of the 4th element. 第4个元素的类型T5 - type of the 5th element. 第5个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素_4 - the 4th element. 第4个元素_5 - the 5th element. 第5个元素static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型T4 - type of the 4th element. 第4个元素的类型T5 - type of the 5th element. 第5个元素的类型T6 - type of the 6th element. 第6个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素_4 - the 4th element. 第4个元素_5 - the 5th element. 第5个元素_6 - the 6th element. 第6个元素static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型T4 - type of the 4th element. 第4个元素的类型T5 - type of the 5th element. 第5个元素的类型T6 - type of the 6th element. 第6个元素的类型T7 - type of the 7th element. 第7个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素_4 - the 4th element. 第4个元素_5 - the 5th element. 第5个元素_6 - the 6th element. 第6个元素_7 - the 7th element. 第7个元素static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7, T8 _8)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型T4 - type of the 4th element. 第4个元素的类型T5 - type of the 5th element. 第5个元素的类型T6 - type of the 6th element. 第6个元素的类型T7 - type of the 7th element. 第7个元素的类型T8 - type of the 8th element. 第8个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素_4 - the 4th element. 第4个元素_5 - the 5th element. 第5个元素_6 - the 6th element. 第6个元素_7 - the 7th element. 第7个元素_8 - the 8th element. 第8个元素static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> of(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7, T8 _8, T9 _9)
T1 - type of the 1st element. 第1个元素的类型T2 - type of the 2nd element. 第2个元素的类型T3 - type of the 3rd element. 第3个元素的类型T4 - type of the 4th element. 第4个元素的类型T5 - type of the 5th element. 第5个元素的类型T6 - type of the 6th element. 第6个元素的类型T7 - type of the 7th element. 第7个元素的类型T8 - type of the 8th element. 第8个元素的类型T9 - type of the 9th element. 第9个元素的类型_1 - the 1st element. 第1个元素_2 - the 2nd element. 第2个元素_3 - the 3rd element. 第3个元素_4 - the 4th element. 第4个元素_5 - the 5th element. 第5个元素_6 - the 6th element. 第6个元素_7 - the 7th element. 第7个元素_8 - the 8th element. 第8个元素_9 - the 9th element. 第9个元素Copyright © 2021. All rights reserved.