|
18 | 18 | import Foundation |
19 | 19 |
|
20 | 20 | public class FlightDescriptor { |
21 | | - public enum DescriptorType { |
22 | | - case unknown |
23 | | - case path |
24 | | - case cmd |
25 | | - } |
| 21 | + public enum DescriptorType { |
| 22 | + case unknown |
| 23 | + case path |
| 24 | + case cmd |
| 25 | + } |
26 | 26 |
|
27 | | - public let type: FlightDescriptor.DescriptorType |
28 | | - public let cmd: Data |
29 | | - public let paths: [String] |
| 27 | + public let type: FlightDescriptor.DescriptorType |
| 28 | + public let cmd: Data |
| 29 | + public let paths: [String] |
30 | 30 |
|
31 | | - init(_ descriptor: Arrow_Flight_Protocol_FlightDescriptor) { |
32 | | - self.type = descriptor.type == .cmd ? .cmd : .path |
33 | | - self.cmd = descriptor.cmd |
34 | | - self.paths = descriptor.path |
35 | | - } |
| 31 | + init(_ descriptor: Arrow_Flight_Protocol_FlightDescriptor) { |
| 32 | + self.type = descriptor.type == .cmd ? .cmd : .path |
| 33 | + self.cmd = descriptor.cmd |
| 34 | + self.paths = descriptor.path |
| 35 | + } |
36 | 36 |
|
37 | | - public init(cmd: Data) { |
38 | | - self.type = .cmd |
39 | | - self.cmd = cmd |
40 | | - self.paths = [String]() |
41 | | - } |
| 37 | + public init(cmd: Data) { |
| 38 | + self.type = .cmd |
| 39 | + self.cmd = cmd |
| 40 | + self.paths = [String]() |
| 41 | + } |
42 | 42 |
|
43 | | - public init(paths: [String]) { |
44 | | - self.type = .path |
45 | | - self.cmd = Data() |
46 | | - self.paths = paths |
47 | | - } |
| 43 | + public init(paths: [String]) { |
| 44 | + self.type = .path |
| 45 | + self.cmd = Data() |
| 46 | + self.paths = paths |
| 47 | + } |
48 | 48 |
|
49 | | - func toProtocol() -> Arrow_Flight_Protocol_FlightDescriptor { |
50 | | - var descriptor = Arrow_Flight_Protocol_FlightDescriptor() |
51 | | - descriptor.type = self.type == .cmd ? .cmd : .path |
52 | | - descriptor.cmd = self.cmd |
53 | | - descriptor.path = self.paths |
54 | | - return descriptor |
55 | | - } |
| 49 | + func toProtocol() -> Arrow_Flight_Protocol_FlightDescriptor { |
| 50 | + var descriptor = Arrow_Flight_Protocol_FlightDescriptor() |
| 51 | + descriptor.type = self.type == .cmd ? .cmd : .path |
| 52 | + descriptor.cmd = self.cmd |
| 53 | + descriptor.path = self.paths |
| 54 | + return descriptor |
| 55 | + } |
56 | 56 | } |
0 commit comments