Merge branch 'feature/molecule_id_replacement' into 'develop'
DecodableDefault for UUID ### Summary Adding DecodableDefault for a UUID string. Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/280
This commit is contained in:
commit
20d6149918
@ -65,6 +65,10 @@ extension DecodableDefault {
|
||||
public enum EmptyMap<T: Map>: Source {
|
||||
public static var defaultValue: T { [:] }
|
||||
}
|
||||
|
||||
public struct UUIDStringSource: DecodableDefaultSource {
|
||||
public static var defaultValue: String { UUID().uuidString }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,6 +78,7 @@ extension DecodableDefault {
|
||||
public typealias EmptyString = Wrapper<Sources.EmptyString>
|
||||
public typealias EmptyList<T: List> = Wrapper<Sources.EmptyList<T>>
|
||||
public typealias EmptyMap<T: Map> = Wrapper<Sources.EmptyMap<T>>
|
||||
public typealias UUIDString = Wrapper<Sources.UUIDStringSource>
|
||||
}
|
||||
|
||||
extension DecodableDefault.Wrapper: Equatable where Value: Equatable {}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user