Skip to content

rhaeguard/dumbok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dumbok

basically dumb lombok.

dumbok allows you to create type aliases in Java. Like this:

@WithTypeAlias(
        alias = "Person",
        aliasFor = io.rhaeguard.demo.GenericPerson.class
)
public class Main {

    public static void main(String[] args) {
        Person person = new Person("Jane", 22);
        System.out.println(person.getName());
    }

}

// a class from another package
public class GenericPerson {

    private final String name;
    private final int age;

    public GenericPerson(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }
}

It also allows you to have multiple type aliases:

@WithTypeAlias(
        alias = "AliasA",
        aliasFor = io.rhaeguard.demo.ClassA.class
)
@WithTypeAlias(
        alias = "AliasB",
        aliasFor = io.rhaeguard.demo.ClassB.class
)
public class Main {}

About

a dumb annotation processor for Java

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages