0

I came across some piece of code in my organization that I don't even know how to begin

understanding. Could someone shed some light on what the code in class A is doing in java?

is doing and why its called passing a template type to a static method?

Class A:

 List<SearchIndexResponse> indexResponseList = ConnectionHelper

.<List<SearchIndexResponse>> tryExecute(new Callable<List<SearchIndexResponse>>()

Class B:

public class ConnectionHelper<T>
{
    private static final Logger logger = LoggerFactory
    .getLogger(ConnectionHelper.class);

    private static final int    CONNECTION_RETRIES = 3;

    private static final int    MIN_TIMEOUT        = 100;

    public static <T> T tryExecute(Callable<T> command)
    {
        T returnValue = null;
        long delay = 0;

        for (int retry = 0; retry < CONNECTION_RETRIES; retry++)
        {
            try ....
Karibasappa G C
  • 2,686
  • 1
  • 18
  • 27
Horse Voice
  • 8,138
  • 15
  • 69
  • 120

0 Answers0