dimanche 31 mars 2019

How to find all sub classes of implemented interface in java?

How to get Subclass object using implemented interface, if interface is used as Type Parameter for DynamoDBTypeConverter.(e.g. DynamoDBTypeConverter ).

public enum state implements EnumInterface{
    CREATED("0");
}

public enum color implements EnumInterface{
    GREEN("0");
}

public interface EnumInterface{
    void getStatus();
}

public class DynamoDbEnumConverter implements DynamoDBTypeConvereter<String,EnumInterface>{
    public EnumInterface unconvert(String value){
        // find Object run time, EnumInterface represent color or stat
    }
}

Get whether Enum interface represents color or state in unconvert method.





Aucun commentaire:

Enregistrer un commentaire