Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  PollVoter.swift   Sprache: JAVA

 

import Foundation
import UIKit

public struct PollVoter: Identifiable, Hashable, Comparable {

    // MARK: - Public types

    public enum ProfilePictureSource: Hashable {
        case contact(ContactEntity)
        case me(any MyIdentityStoreProtocol)

        public static func == (lhs: ProfilePictureSource, rhs: ProfilePictureSource) -> Bool {
            switch (lhs, rhs) {
            case let (.contact(l), .contact(r)):
                l.objectID == r.objectID
            case (.me, .me):
                true
            default:
                false
            }
        }

        public func hash(into hasher: inout Hasher) {
            switch self {
            case let .contact(entity):
                hasher.combine(0)
                hasher.combine(entity.objectID)
            case .me:
                hasher.combine(1)
            }
        }
    }

    // MARK: - Public properties

    public let id = UUID()
    public let identity: String
    public let displayName: String

    // MARK: - Private properties

    private let source: ProfilePictureSource

    public var profilePicture: UIImage? {
        switch source {
        case let .contact(entity):
            Contact(contactEntity: entity).profilePicture
        case let .me(identityStore):
            identityStore.resolvedProfilePicture
        }
    }

    // MARK: - Lifecycle

    public init(identity: String, displayName: String, source: ProfilePictureSource) {
        self.identity = identity
        self.displayName = displayName
        self.source = source
    }

    // MARK: - Public static methods

    public static func < (lhs: PollVoter, rhs: PollVoter) -> Bool {
        lhs.identity < rhs.identity
    }
}

Messung
CHZG
829610092

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1104845
#Domains=499267