1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package com.android.systemui.util.kotlin
18 
19 class Utils {
20     companion object {
21         fun <A, B, C> toTriple(a: A, bc: Pair<B, C>) = Triple(a, bc.first, bc.second)
22 
23         fun <A, B, C, D> toQuad(a: A, b: B, c: C, d: D) = Quad(a, b, c, d)
24         fun <A, B, C, D> toQuad(a: A, bcd: Triple<B, C, D>) =
25             Quad(a, bcd.first, bcd.second, bcd.third)
26 
27         fun <A, B, C, D, E> toQuint(a: A, bcde: Quad<B, C, D, E>) =
28             Quint(a, bcde.first, bcde.second, bcde.third, bcde.fourth)
29     }
30 }
31 
32 data class Quad<A, B, C, D>(val first: A, val second: B, val third: C, val fourth: D)
33 
34 data class Quint<A, B, C, D, E>(
35     val first: A,
36     val second: B,
37     val third: C,
38     val fourth: D,
39     val fifth: E
40 )
41