{"id":20397595,"url":"https://github.com/professordeveloper/kotlin-pattern","last_synced_at":"2025-04-12T13:09:11.058Z","repository":{"id":45728812,"uuid":"514232415","full_name":"professorDeveloper/Kotlin-Pattern","owner":"professorDeveloper","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-15T10:44:17.000Z","size":50,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T13:09:07.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/professorDeveloper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-15T10:43:54.000Z","updated_at":"2023-02-20T19:40:03.000Z","dependencies_parsed_at":"2022-09-22T21:31:40.035Z","dependency_job_id":null,"html_url":"https://github.com/professorDeveloper/Kotlin-Pattern","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/professorDeveloper%2FKotlin-Pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/professorDeveloper%2FKotlin-Pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/professorDeveloper%2FKotlin-Pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/professorDeveloper%2FKotlin-Pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/professorDeveloper","download_url":"https://codeload.github.com/professorDeveloper/Kotlin-Pattern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571886,"owners_count":21126522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T04:14:54.150Z","updated_at":"2025-04-12T13:09:11.030Z","avatar_url":"https://github.com/professorDeveloper.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pattern-Kotlin\nMy Best The Best\nexample\npackage amaliyot7\n\nimport FloppyDisk\n\nfun main(args: Array\u003cString\u003e) {\n    var cabbinet = Cabbinet()\n    cabbinet.add(FloppyDisk())\n    cabbinet.add(HardDrive())\n    cabbinet.add(Memory())\n    println(\"Cabinet Price: ${cabbinet.getPrice()}\")//Bizga Barcha Mahsulotlarni Yigindisini ekranga chiqaradi\n}\n  \n  //Cabinent\n  class Cabbinet : Composite(\"cabbinet\")\n//open class Compsoite\n  package amaliyot7\n\n\n/*\n[composite] Design Pattern nol yoki undan ko'p o'xshash ob'ektlarni yaratish uchun ishlatiladi,\n shunda ularni bitta ob'ekt sifatida boshqarish mumkin !\n Masalan:\n*/\nopen class Composite(name: String) : Equipment(0, name) {\n    val equipments = ArrayList\u003cEquipment\u003e()\n\n    fun add(equipment: Equipment) {\n        this.equipments.add(equipment)\n    }\n\n    override fun getPrice(): Int {\n        return equipments.sumOf { it.getPrice() }\n    }\n}\n//open class equipments\n  \nopen class Equipment(private var price: Int, private var name: String) {\n    open fun getPrice(): Int = price\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofessordeveloper%2Fkotlin-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofessordeveloper%2Fkotlin-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofessordeveloper%2Fkotlin-pattern/lists"}