views:

88

answers:

2

Sample case:

class Test {
    final Set<String> uniqueNames = new HashSet<String>();
}

But w/ the help of a plugin can generate methods like this (similar to Generate getters/setters)

class Test {
    final Set<String> uniqueNames = new HashSet<String>();

    public boolean add(String name) {
     return uniqueNames.add(name);
    }

    public boolean remove(Object name) {
     return uniqueNames.remove(name);
    }

}
+2  A: 

Maybe I should be more attentive, found the answer directly next to the "Generate Getters/Setters" option. It's called "Generate Delegate Methods."

Thanks

carwash
+1  A: 
VonC