org.apache.commons.lang3.tuple.Pair
References
Instance create
Pair.of(key, value)
MutablePair.of(key, value)
キー・値の取り出し
- Key :
getKey()かgetLeft() - Value :
getValue()かgetRight()
値の変更
- MutablePair は setValue() メソッドにより値だけ変更可能
- Pair ないし ImmutablePair は変更不可
- setValue()を使うと UnsupportedOperationException が発生