Code Monkey home page Code Monkey logo

intellij-stepbuilder-codegen-plugin's Introduction

intellij-stepbuilder-codegen-plugin

Build join discord Version Downloads Quality Gate Status Maintainability Rating Security Rating Lines of Code

A plugin to generate step builders for your Java classes. With step builder, you can easily provide fluent creation for your objects (i.e: Address.builder().ip("192.168.1.1").port(80).build();

What is the difference with a basic builder ?

The step builder enforce all mandatories (private final fields) to be setted you can never forget to provide a property anymore and it also enforce the order of declaration of elements.

In a normal builder you might forget some withName() invokation and the compilation will be fine. With a step builder, you cannot invoke .build(); while you didn't invoke all the required withXZY() methods.

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "Stepbuilder Codegen" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > โš™๏ธ > Install plugin from disk...

Usage

Create a small class having some properties such as:

public class Animal {
  
  private final int size;
  private final String name;
  private final boolean visible;
}

Alt + insert:

Alt + insert

Then select Generate Step Builder:

Alt + insert

Choose the fields you like to have in your step builder And you can also specify some custom options such as javadoc or not etc.

Click OK

And voila you have your generated step builder right away:

Alt + insert


This project is a maintained fork of: https://github.com/iamMehedi/stepbuilder

I try to keep it running for new versions of intelliJ feel free to contribute to it if you have ideas :)

Plugin based on the IntelliJ Platform Plugin Template.

intellij-stepbuilder-codegen-plugin's People

Contributors

actions-user avatar dependabot[bot] avatar patrick-brielmayer avatar sebastienvermeille avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

intellij-stepbuilder-codegen-plugin's Issues

Having a GUI builder for complex builders might be useful

Sometimes, I need to create builders with some optional parameters and if one of them is set then a couple of others are required.

Or do some build inheritance.

Would be great to have help from the IDE wizzard for such use cases as it can be quite tricky to perform such operations.

What about an eclipse version of the plugin ?

This plugin architecture should be decoupled from the IDE implementation so that we have a "common module" usable by any IDE implementation.

That would ease a lot reusage of central logic within Eclipse, Netbeans, and other IDE.

Migrate doc website to Docusaurus

Currently the doc is hosted on docs.page which render really nice and is very convenient.

However, the project lack of reactivity and as documentation writer, I can't afford to wait months to get a PR approved or their bot to be fixed so that I can keep using this tool.

With Docusaurus which I used in another project of mine, we can keep the control as we self build the doc.

The goal is then to migrate to this OSS tool instead of docs.page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.