mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
c027fce9e9
commit_hash:bf241c3958d26bad19ee35a08ae65b1c393de58e
47 lines
1.2 KiB
Swift
47 lines
1.2 KiB
Swift
// Generated code. Do not modify.
|
|
|
|
import CommonCore
|
|
import Foundation
|
|
import Serialization
|
|
|
|
public final class EntityWithStringArrayProperty: Sendable {
|
|
public static let type: String = "entity_with_string_array_property"
|
|
public let array: [Expression<String>] // at least 1 elements
|
|
|
|
public func resolveArray(_ resolver: ExpressionResolver) -> [String]? {
|
|
array.map { resolver.resolveString($0) }.compactMap { $0 }
|
|
}
|
|
|
|
static let arrayValidator: AnyArrayValueValidator<Expression<String>> =
|
|
makeArrayValidator(minItems: 1)
|
|
|
|
init(
|
|
array: [Expression<String>]
|
|
) {
|
|
self.array = array
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
extension EntityWithStringArrayProperty: Equatable {
|
|
public static func ==(lhs: EntityWithStringArrayProperty, rhs: EntityWithStringArrayProperty) -> Bool {
|
|
guard
|
|
lhs.array == rhs.array
|
|
else {
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
}
|
|
#endif
|
|
|
|
extension EntityWithStringArrayProperty: Serializable {
|
|
@_optimize(size)
|
|
public func toDictionary() -> [String: ValidSerializationValue] {
|
|
var result: [String: ValidSerializationValue] = [:]
|
|
result["type"] = Self.type
|
|
result["array"] = array.map { $0.toValidSerializationValue() }
|
|
return result
|
|
}
|
|
}
|