public static Class < ? extends Tuple > classOfTuple ( int cardinality ) { switch ( cardinality ) { case 1 : return Unit . class ; case 2 : return Pair . class ; case 3 : return Triplet . class ; case 4 : return Quartet . class ; case 5 : return Quintet . class ; case 6 : return Sextet . class ; case 7 : return Septet . class ; case 8 : return Octet . class ; case 9 : return Ennead . class ; case 10 : return Decade . class ; default : throw new IllegalArgumentException ( "Cannot create a tuple with " + cardinality + " element(s)" ) ; } }
Returns the tuple class corresponding to the specified cardinality .