AttributeNameTransformer
public struct AttributeNameTransformer
extension AttributeNameTransformer: Equatable
extension AttributeNameTransformer: Codable
Defines rules to transform name from JSON to CoreData
-
An info name
Declaration
Swift
public var name: String
-
Map to the wanted field
Declaration
Swift
public var decode: (String) -> String
-
Encode for network
Declaration
Swift
public var encode: (String) -> String
-
Transformer could manage this case
Declaration
Swift
public var couldManage: (String) -> Bool
-
Undocumented
Declaration
Swift
@nonobjc public static var suffixForReserved: String
-
Undocumented
Declaration
Swift
@nonobjc public static var reservedSwiftVars: [String]
-
Undocumented
Declaration
Swift
@nonobjc public static var suffixForServerReserved: String
-
Init a transformer passing closures.
Declaration
Swift
public init(name: String, decode: @escaping (String) -> String, encode: @escaping (String) -> String, couldManage: @escaping (String) -> Bool = { _ in true })
-
Undocumented
Declaration
Swift
public init(encoded: String, decoded: String, name: String? = nil)
-
Do not transform anything
Declaration
Swift
public static var none: AttributeNameTransformer
-
Set first letter as lower case
Declaration
Swift
public static var firstLetterLowerCased: AttributeNameTransformer
-
Apply some transformation to reserved language variable
Declaration
Swift
public static var runtimeReservedVariable: AttributeNameTransformer
-
A transformer to capitalize.
Declaration
Swift
public static var capitalizedRuntimeReservedVariable: AttributeNameTransformer
-
A transformer to remove some reserved keyword.
Declaration
Swift
public static var serverReservedVariable: AttributeNameTransformer
-
Declaration
Swift
public static func == (lhs: AttributeNameTransformer, rhs: AttributeNameTransformer) -> Bool
-
Declaration
Swift
public init(from decoder: Decoder) throws