Skip to content

Rshalika/kenerator

Repository files navigation

Kenerator

Build Version Downloads

Intellij Idea And Android Studio plugin for generating compact equals method for Kotlin classes

Usage

  • Click alt+insert (Generate menu)
  • Choose Kenerator
  • Choose Equals or Hashcode

Code format

override fun equals(other: Any?): Boolean = other is BannerFace
        && super.equals(other)
        && name == other.name
        && image == other.image
        
override fun hashCode(): Int = Objects.hash(
        super.hashCode(),
        name,
        image
)

Limitations

  • Will not care for existing equals and hashcode methods. You have to delete them yourself.
  • Will not import used classes automatically.
  • You have to do the reformatting afterwards yourself.
  • Will not compare arrays with Arrays.equals() method.
  • Tested only on standard Kotlin classes. May have edge-cases.

Installation

  • Using IDE built-in plugin system:

    Preferences > Plugins > Marketplace > Search for "Kenerator" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Preferences > Plugins > ⚙️ > Install plugin from disk...


Plugin based on the IntelliJ Platform Plugin Template.