Newer
Older
transformer / README.md
@aljunggren aljunggren on 29 May 2021 835 bytes Added Base64 tranformation

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