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个元素的类型Tuple, SerializableEasyTuple7public class Tuple7<T1,T2,T3,T4,T5,T6,T7> extends TupleBase
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
T1 |
_1 |
The 1st element of this tuple.
|
T2 |
_2 |
The 2nd element of this tuple.
|
T3 |
_3 |
The 3rd element of this tuple.
|
T4 |
_4 |
The 4th element of this tuple.
|
T5 |
_5 |
The 5th element of this tuple.
|
T6 |
_6 |
The 6th element of this tuple.
|
T7 |
_7 |
The 7th element of this tuple.
|
private static long |
serialVersionUID |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Tuple7<T1,T2,T3,T4,T5,T6,T7> |
alias(TupleAlias... aliases) |
Setting tuple's aliases.
|
Tuple7<T1,T2,T3,T4,T5,T6,T7> |
alias(String... aliases) |
Setting tuple's aliases.
|
int |
arity() |
The size of this Tuple.
元组的元素数量 |
Tuple7<T1,T2,T3,T4,T5,T6,T7> |
copy() |
clone a tuple by shallow copy.
|
Tuple7<T1,T2,T3,T4,T5,T6,T7> |
copyAliases(Tuple tuple) |
Copy aliases from other tuple.
|
<R> R |
element(int n) |
The nth element of this tuple
从元组中取第n个元素 |
__, __, aliasesEquals, aliasType, clearAlias, containsAlias, containsAlias, elementWithAlias, elementWithTupleAlias, equals, getAliases, getTupleAliases, toMap, toSI, toStringprivate static final long serialVersionUID
public final T1 _1
public final T2 _2
public final T3 _3
public final T4 _4
public final T5 _5
public final T6 _6
public final T7 _7
public Tuple7(T1 _1, T2 _2, T3 _3, T4 _4, T5 _5, T6 _6, T7 _7)
Tuple7. Tuple7构造器。_1 - The value of 1st element_2 - The value of 2nd element_3 - The value of 3rd element_4 - The value of 4th element_5 - The value of 5th element_6 - The value of 6th element_7 - The value of 7th elementpublic int arity()
Tuplepublic Tuple7<T1,T2,T3,T4,T5,T6,T7> alias(TupleAlias... aliases)
TupleTuple.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);
public Tuple7<T1,T2,T3,T4,T5,T6,T7> alias(String... aliases)
TupleTuple.alias(TupleAlias...) Tuple.alias(TupleAlias...) 这个方法设置别名。alias 在接口中 Tuplealias 在类中 TupleBasealiases - aliases. 别名Tuple.alias(TupleAlias...)public Tuple7<T1,T2,T3,T4,T5,T6,T7> copyAliases(Tuple tuple)
TuplecopyAliases 在接口中 TuplecopyAliases 在类中 TupleBasetuple - other tuplepublic <R> R element(int n)
TupleR - return type 返回值类型n - index 序号Copyright © 2023 io-fairy. All rights reserved.