@Alex Ljunggren Alex Ljunggren authored on 29 Mar 2022
src Code cleanup 4 years ago
.gitignore Initial commit 5 years ago
README.md Typo 5 years ago
lombok.config Initial commit 5 years ago
pom.xml Updated lombok and junit versions 4 years ago
README.md

Transformer

Annotate member variables for transformation

public class User {
    @DateFormat(from = "MM-dd-yyyy", to = "yyyy/MM/dd")
    private String date;
}

Instantiate

Transformer transformer = new Transformer(object);

Transform

transformer.transform();

Custom

Transforms against a custom class

@CustomTransformer(MyManipulation.class)

Required

  • value - Class that implements Manipulation

Note: Custom transformation class must implement the Manipulation interface

Date Format

Change the format of a date string

@DateFormat(from = "MM-dd-yyyy", to = "yyyy/MM/dd")

Data types supported

  • String

Format used by java.text.SimpleDateFormat

Base 64

Transforms to Base 64

@ToBase64()

Data types supported

  • String