Abbreviator

@Alex Ljunggren Alex Ljunggren authored on 3 Apr 2022
src Moved case-insensitive regex out of enum def. 4 years ago
.gitignore Initial commit 4 years ago
README.md Updated readme 4 years ago
lombok.config Initial commit 4 years ago
pom.xml Initial commit 4 years ago
README.md

Abbreviator

Annotate member variables for abbreviation

public class User {
    @AbbreviateState
    private String state;
}

Instantiate

Abbreviator abbreviator = new Abbreviator(object);

Abbreviate

abbreviator.abbreviate();

Address

Abbreviate address

@AbbreviateAddress(capitalize = false, usePeriod = true)

Required

  • capitalize - Capitalize the abbreviation, e.g. Street to ST
  • usePeriod - Add period to abbreviation, e.g. Street to ST.

Optional

  • aggressive - Default is false.
    • false - Only words separated by non alphabetic characters will be abbreviated
    • true - All words, even substrings, will abbreviated. E.g. Streetstreet -> StSt

Data types supported

  • String

State

Abbreviate states

@AbbreviateState

Optional

  • aggressive - Default is false

Data types supported

  • String