{"id":18336001,"url":"https://github.com/auritylab/kotlin-object-path","last_synced_at":"2025-04-09T19:52:22.974Z","repository":{"id":57717565,"uuid":"232111201","full_name":"AurityLab/kotlin-object-path","owner":"AurityLab","description":"Access properties and lists using a path.","archived":false,"fork":false,"pushed_at":"2020-01-17T16:30:55.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-23T15:20:26.399Z","etag":null,"topics":["kotlin","object-path"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AurityLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T13:52:59.000Z","updated_at":"2023-07-18T02:52:09.000Z","dependencies_parsed_at":"2022-09-10T18:03:11.894Z","dependency_job_id":null,"html_url":"https://github.com/AurityLab/kotlin-object-path","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/AurityLab%2Fkotlin-object-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AurityLab%2Fkotlin-object-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AurityLab%2Fkotlin-object-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AurityLab%2Fkotlin-object-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AurityLab","download_url":"https://codeload.github.com/AurityLab/kotlin-object-path/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238987653,"owners_count":19563761,"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":["kotlin","object-path"],"created_at":"2024-11-05T20:05:31.544Z","updated_at":"2025-02-15T12:17:54.554Z","avatar_url":"https://github.com/AurityLab.png","language":"Kotlin","readme":"# Kotlin Object Path\n![GitHub Actions](https://github.com/AurityLab/kotlin-object-path/workflows/Gradle/badge.svg)\n[![ktlint](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg)](https://ktlint.github.io/)\n![Maven Central](https://img.shields.io/maven-central/v/com.auritylab/kotlin-object-path?label=codegen)\n\nA library for [Kotlin](https://kotlinlang.org/) which lets you access properties and lists using a simple path (e.g \"users.0.name\").\n\nSupports simple reflective access and is compatible with parsed JSON values from Jackson/Gson.\n\nInspired by [object-path](https://github.com/mariocasciaro/object-path).\n\n## Install\n#### Gradle\n```kotlin\ndependencies {\n    implementation(\"com.auritylab:kotlin-object-path:1.0.0\")\n}\n```\n#### Maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.auritylab\u003c/groupId\u003e\n    \u003cartifactId\u003ekotlin-object-path\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n```kotlin\n// Simple container which holds three values.\ndata class Container(val a: Any, val b: Any, val c: Any)\n\n// Create an instance with some simple values.\nval value = Container(\"0a\", \"0b\", Container(\"0c1a\", listOf(\"0c1b0\", \"0c1b1\", \"0c1b2\"), mapOf(Pair(\"aa\", \"0c1c0\"), Pair(\"bb\", \"0c1c2\"))))\n\n// Get a value:\nKObjectPath(value).path(\"c.a\").get() // returns \"0c1a\"\nKObjectPath(value).path(\"c.b.0\").get() // returns \"0c1b0\"\nKObjectPath(value).path(\"c.c.aa\").get() // returns \"0c1c0\"\n\n// Set a value (Currently only supported on mutable Maps and Lists):\nKObjectPath(value).path(\"c.b.0\").set(\"new value\")\nKObjectPath(value).path(\"c.c.aa\").set(\"new value\")\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauritylab%2Fkotlin-object-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauritylab%2Fkotlin-object-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauritylab%2Fkotlin-object-path/lists"}