How can I force a class to implement specific constructor?

Viewed 78

I want to force some classes to implement constructor that initialize the object from Map. Is there a way to do it like interfaces make it for regular methods?

public class SomeClass implements SomeInterface {
    public SomeClass(Map data) {
        // init object
    }
}

For example, I want all classes that implements SomeInterface to be forced to have constructor with one parameter Map. Is there any way to do it?

0 Answers
Related