@aljunggren aljunggren authored on 29 May 2021
src Added Base64 tranformation 5 years ago
.gitignore Initial commit 5 years ago
README.md Added Base64 tranformation 5 years ago
lombok.config Initial commit 5 years ago
pom.xml Initial commit 5 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.clss)

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("value")

Data types supported

  • String