{"id":15403635,"url":"https://github.com/rogervinas/spring-immutable-configuration-properties","last_synced_at":"2026-03-05T02:03:02.981Z","repository":{"id":44958686,"uuid":"178004200","full_name":"rogervinas/spring-immutable-configuration-properties","owner":"rogervinas","description":"🍀 Spring Immutable ConfigurationProperties PoC","archived":false,"fork":false,"pushed_at":"2026-02-22T10:56:42.000Z","size":329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-22T16:48:46.852Z","etag":null,"topics":["java","kotlin","spring","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"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/rogervinas.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-27T13:51:04.000Z","updated_at":"2026-02-22T10:56:45.000Z","dependencies_parsed_at":"2023-12-28T18:44:44.308Z","dependency_job_id":"6dcae5e4-8d24-4a98-beb8-2ab5cabdb89f","html_url":"https://github.com/rogervinas/spring-immutable-configuration-properties","commit_stats":{"total_commits":73,"total_committers":4,"mean_commits":18.25,"dds":0.410958904109589,"last_synced_commit":"ebbaaacdae1a63c017e6e6d843c19f6c0b4d38e8"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rogervinas/spring-immutable-configuration-properties","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervinas%2Fspring-immutable-configuration-properties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervinas%2Fspring-immutable-configuration-properties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervinas%2Fspring-immutable-configuration-properties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervinas%2Fspring-immutable-configuration-properties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rogervinas","download_url":"https://codeload.github.com/rogervinas/spring-immutable-configuration-properties/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rogervinas%2Fspring-immutable-configuration-properties/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30106150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T01:39:18.192Z","status":"online","status_checked_at":"2026-03-05T02:00:06.710Z","response_time":93,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["java","kotlin","spring","spring-boot"],"created_at":"2024-10-01T16:09:30.718Z","updated_at":"2026-03-05T02:03:02.974Z","avatar_url":"https://github.com/rogervinas.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/rogervinas/spring-immutable-configuration-properties/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/rogervinas/spring-immutable-configuration-properties/actions/workflows/ci.yml)\n![Java](https://img.shields.io/badge/Java-21-blue?labelColor=black)\n![Kotlin](https://img.shields.io/badge/Kotlin-2.x-blue?labelColor=black)\n![SpringBoot](https://img.shields.io/badge/SpringBoot-4.x-blue?labelColor=black)\n\n# Spring Immutable @ConfigurationProperties\n\nThere are at least 4 ways of having **immutable** properties loaded from configuration:\n\n1) [A plain Java class](src/main/java/com/acme/AcmeJavaClassProperties.java)\n```java\n@ConfigurationProperties(\"acme\")\npublic class AcmeJavaClassProperties {\n\n  private final boolean enabled;\n  private final String text;\n  private final List\u003cString\u003e list;\n  private final float number;\n\n  public AcmeJavaClassProperties(\n    boolean enabled,\n    String text,\n    List\u003cString\u003e list,\n    float number\n  ) {\n    this.enabled = enabled;\n    this.text = text;\n    this.list = unmodifiableList(list);\n    this.number = number;\n    }\n}\n```\n\n2) [A Java record](src/main/java/com/acme/AcmeJavaRecordProperties.java)\n```java\n@ConfigurationProperties(\"acme\")\npublic record AcmeJavaRecordProperties(\n  boolean enabled,\n  String text,\n  List\u003cString\u003e list,\n  float number\n) {\n}\n```\n\n3) [A plain Kotlin class](src/main/java/com/acme/AcmeKotlinClassProperties.kt)\n```kotlin\n@ConfigurationProperties(\"acme\")\nclass AcmeKotlinClassProperties(\n  val enabled: Boolean,\n  val text: String,\n  val list: List\u003cString\u003e,\n  val number: Float\n)\n```\n\n4) [A Kotlin data class](src/main/java/com/acme/AcmeKotlinDataClassProperties.kt)\n```kotlin\n@ConfigurationProperties(\"acme\")\ndata class AcmeKotlinDataClassProperties (\n  val enabled: Boolean,\n  val text: String,\n  val list: List\u003cString\u003e,\n  val number: Float\n)\n```\n\nNote that since Spring Boot 3.x [@ConstructorBinding](https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/context/properties/bind/ConstructorBinding.html) annotation is only required to indicate which constructor to use in case there is more than one.\n\nYou can also browse older versions:\n* [Spring Boot 2.x](https://github.com/rogervinas/spring-immutable-configuration-properties/tree/spring-boot-2.x)\n\n## Test\n\nReview [AcmeApplicationTest](src/test/java/com/acme/AcmeApplicationTest.java) and ...\n\n```bash\n./gradlew test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogervinas%2Fspring-immutable-configuration-properties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frogervinas%2Fspring-immutable-configuration-properties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frogervinas%2Fspring-immutable-configuration-properties/lists"}