How about this?
val pair = query.getSingleOrNone
pair collect { case Array(x: MyClass1, y: MyClass2, _*) => (x,y) }
// result would be Option[(MyClass1, MyClass2)]
More Related Contents:
- How can I convert an array to a tuple?
- Creating a specific pattern with two-dimensional array in scala
- Printing array in Scala
- Converting a C char array to a String
- How to pass Scala array into Scala vararg method?
- How to create and use a multi-dimensional array in Scala?
- Why are Arrays invariant, but Lists covariant?
- Why does `Array(0,1,2) == Array(0,1,2)` not return the expected result?
- Access Array column in Spark
- Appending an element to the end of a list in Scala
- How to turn off array range check [closed]
- Not all properties displayed
- Remove an element from a Bash array
- Weighted random selection from array
- Multidimensional array with different lengths
- Malloc a 2D array in C [duplicate]
- Find the 2nd largest element in an array with minimum number of comparisons
- I am getting error “array.sh: 3: array.sh: Syntax error: “(” unexpected”
- How do I pass an array as a parameter to another script?
- Is there a way to instantly generate an array filled with a range of values in Swift?
- Turn Excel range into VBA string
- Generic function to sort array of class or struct by properties in Swift
- Powershell: Piping output of pracl command to array
- How do I assign ls to an array in Linux Bash?
- How to merge two arrays in Swift
- How to parse json in flutter?
- Create a multidimesional key of hash from array?
- MongoDB: find and findOne with nested array filtering
- Check if an element is present in a Bash array [duplicate]
- ReDim Preserve “Subscript Out of Range”