{"id":22611249,"url":"https://github.com/bzdgn/merdiven","last_synced_at":"2025-03-28T23:20:46.858Z","repository":{"id":48988930,"uuid":"379925028","full_name":"bzdgn/merdiven","owner":"bzdgn","description":"A generic statement builder tool for all-purpose","archived":false,"fork":false,"pushed_at":"2021-07-02T19:45:55.000Z","size":53,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-03T09:47:47.490Z","etag":null,"topics":["builder","statement","statementbuilder"],"latest_commit_sha":null,"homepage":"","language":"Java","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/bzdgn.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":"2021-06-24T12:56:43.000Z","updated_at":"2021-07-02T19:45:58.000Z","dependencies_parsed_at":"2022-09-26T22:11:08.137Z","dependency_job_id":null,"html_url":"https://github.com/bzdgn/merdiven","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fmerdiven","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fmerdiven/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fmerdiven/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bzdgn%2Fmerdiven/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bzdgn","download_url":"https://codeload.github.com/bzdgn/merdiven/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112659,"owners_count":20725302,"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":["builder","statement","statementbuilder"],"created_at":"2024-12-08T16:09:54.611Z","updated_at":"2025-03-28T23:20:46.839Z","avatar_url":"https://github.com/bzdgn.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"TOC\n---\n- [0  Introduction](#0-introduction) \u003cbr/\u003e\n- [1  Setup](#1-setup) \u003cbr/\u003e\n- [2  Example](#2-example) \u003cbr/\u003e\n- [3  TODO List](#3-todo-list) \u003cbr/\u003e\n- [4  Future Plan](#4-future-plan) \u003cbr/\u003e\n\n 0 Introduction\n---------------\n\n![merdiven-logo](https://github.com/bzdgn/merdiven/blob/main/misc/merdiven.bmp)\n\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.bzdgn/merdiven.svg)](https://search.maven.org/artifact/io.github.bzdgn/merdiven)\n\n**Merdiven** is a simple generic statement builder for generic purposes. During different development projects, there was the need to have a generic statement builder that produces immutable statements thus I've created this open-source project.\n\n\n[Go back to TOC](#toc)\n\n\n 1 Setup\n--------\n\nYou can simply add **merdiven** to your project as a maven dependency;\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.bzdgn\u003c/groupId\u003e\n    \u003cartifactId\u003emerdiven\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\n[Go back to TOC](#toc)\n\n\n 2 Example\n----------\n**Merdiven** is easy to use. A simple example to produce a statement is as follows to produce a **json** object;\n\n```java\nStatement statement = builder\n\t\t.openBracket()\n\t\t\t.openCurlyBracket()\n\t\t\t\t.add(\"name\", \"Levent\", \":\", \"\\\"\")\n\t\t\t\t.and(\",\")\n\t\t\t\t.add(\"id\", \"717\", \":\", \"\\\"\")\n\t\t\t\t.and(\",\")\n\t\t\t\t.add(\"isOccupied\", \"true\", \":\", \"\\\"\")\n\t\t\t\t.and(\",\")\n\t\t\t\t.addParam(\"info\", \"\\\"\")\n\t\t\t\t.eq(\":\")\n\t\t\t\t.openCurlyBracket()\n\t\t\t\t\t.addParam(\"languages\", \"\\\"\")\n\t\t\t\t\t.eq(\":\")\n\t\t\t\t\t.openBracket()\n\t\t\t\t\t\t.addParam(\"english\", \"\\\"\")\n\t\t\t\t\t\t.and(\",\")\n\t\t\t\t\t\t.addParam(\"turkish\", \"\\\"\")\n\t\t\t\t\t\t.and(\",\")\n\t\t\t\t\t\t.addParam(\"dutch\", \"\\\"\")\n\t\t\t\t\t.closeBracket()\n\t\t\t\t.closeCurlyBracket()\n\t\t\t.closeCurlyBracket()\n\t\t.closeBracket()\n\t\t.build();\n\t\t\nSystem.out.println(statement.toString());\n```\n\nAnd the output will be as follows;\n\n```\n[ { \"name\":\"Levent\" , \"id\":\"717\" , \"isOccupied\":\"true\" , \"info\" : { \"languages\" : [ \"english\" , \"turkish\" , \"dutch\" ] } } ]\n```\n\nPretty printed output will be;\n\n```json\n[\n    {\n        \"name\": \"Levent\",\n        \"id\": \"717\",\n        \"isOccupied\": \"true\",\n        \"info\": {\n            \"languages\": [\n                \"english\",\n                \"turkish\",\n                \"dutch\"\n            ]\n        }\n    }\n]\n```\n\nOr to make an undefined query by your own as follows;\n\n```java\nStatement statement = builder\n        .add(\"firstName\", \"Levent\")\n        .and()\n        .add(\"lastName\", \"Divilioglu\")\n        .add(\"number\", \"717\")\n        .add(\"github\", \"bzdgn\")\n        .openBracket()\n            .add(\"type\", \"Engineer\")\n            .or()\n            .add(\"type\", \"Guitarist\")\n        .closeBracket()\n        .build();\n        \nSystem.out.println(statement.toString());\n```\n\nAnd the string output is as follows;\n\n```\nfirstName=\"Levent\" and lastName=\"Divilioglu\" number=\"717\" github=\"bzdgn\" [ type=\"Engineer\" or type=\"Guitarist\" ]\n```\n\n\n[Go back to TOC](#toc)\n\n\n 3 TODO List\n------------\n\n- Field to list structure to be added.\n- Configuration object to be implemented for generic templates\n- Pretty Print functionality to be added\n\n\n[Go back to TOC](#toc)\n\n\n 4 Future Plan\n--------------\n\nAs a Camel user, I want to dig into the Camel components and want to create a camel component for **merdiven**. Also json/xml conversions may be added to the project.\n\n\n[Go back to TOC](#toc)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzdgn%2Fmerdiven","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbzdgn%2Fmerdiven","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbzdgn%2Fmerdiven/lists"}