WrappedVariable

class WrappedVariable : Modifiable

Variable wrapped SourceryVariable

  • Declaration

    Swift

    var annotation: Annotation?
  • Undocumented

    Declaration

    Swift

    internal init(
        name: String,
        defaultValue: String? = nil,
        isMutable: Bool,
        isEnum: Bool,
        isCustomType: Bool,
        isArray: Bool,
        isCustomInternalEnumType: Bool,
        isOptional: Bool,
        isStatic: Bool,
        typeName: WrappedTypeName
    )
  • Undocumented

    Declaration

    Swift

    convenience init(from: SourceryVariable)
  • name of variable

    Declaration

    Swift

    var name: String
  • default value of variable

    Declaration

    Swift

    var defaultValue: String?
  • true if variable is not a constant

    Declaration

    Swift

    var isMutable: Bool
  • true if variable is an enum type

    Declaration

    Swift

    var isEnum: Bool
  • true if variable is an custom type

    Declaration

    Swift

    var isCustomType: Bool
  • true if variable is an array type

    Declaration

    Swift

    var isArray: Bool
  • true if variable is an internal enum type

    Declaration

    Swift

    var isCustomInternalEnumType: Bool
  • true if variable is optional

    Declaration

    Swift

    var isOptional: Bool
  • true if variable is static

    Declaration

    Swift

    var isStatic: Bool
  • true if variable is a typealias

    Declaration

    Swift

    var isTypeAlias: Bool { get }
  • the type of the variable

    Declaration

    Swift

    var typeName: WrappedTypeName
  • Declaration string of variable

    Declaration

    Swift

    lazy var declaration: () -> String { get set }
  • Initializer parameter string of variable

    Declaration

    Swift

    lazy var initParam: () -> String { get set }
  • String of variable inside of initializer

    Declaration

    Swift

    lazy var initBody: () -> String { get set }
  • String of variable inside to() method

    Declaration

    Swift

    lazy var convertTo: () -> String { get set }
  • String of variable inside from() method

    Declaration

    Swift

    lazy var convertFrom: () -> String { get set }
  • Adaption string of variable inside to() or from() method if variable was replaced

    Declaration

    Swift

    lazy var replaceAdaption: (_ isFromConversion: Bool) -> String? { get set }
  • id

    Declaration

    Swift

    var id: String { get }
  • Declaration

    Swift

    var modified: Bool
  • Declaration

    Swift

    func modify(change: Change)
  • unmodified version for from() method

    Declaration

    Swift

    var unmodifiedFrom: String { get }
  • replacement string for from() method

    Declaration

    Swift

    func replacedFrom(_ name: String) -> String
  • unmodified version of to() conversion

    Declaration

    Swift

    var unmodifiedTo: String { get }
  • Replace to() string of variable

    Declaration

    Swift

    func replacedTo(_ name: String) -> String

    Parameters

    name

    name of variable which replaces this variable

    Return Value

    replacement string

  • handle added a variable

    Declaration

    Swift

    internal func handleAddChange(_ addChange: AddChange)

    Parameters

    addChange

    AddChange affecting this variable

  • handle deletion of a property

    Declaration

    Swift

    internal func handleDeletedChange(_ delChange: DeleteChange)

    Parameters

    delChange

    DeleteChange affecting this variable

  • handle renaming of property

    Declaration

    Swift

    internal func handleRenameChange(_ renameChange: RenameChange)

    Parameters

    renameChange

    RenameChange affecting this variable

  • handle replacing of property

    Declaration

    Swift

    internal func handleReplacedChange(_ replaceChange: ReplaceChange)

    Parameters

    replaceChange

    ReplaceChange affecting this variable

  • handle replacing of the parent model of a property

    Declaration

    Swift

    internal func handleReplacedParentChange(_ replaceChange: ReplaceChange)

    Parameters

    replaceChange

    ReplaceChange affecting the parent model