@Override public final Collection<FunctionDesc> getFunctions() { List<FunctionDesc> list = new ArrayList<FunctionDesc>(); try { final BlockingInterface stub = getStub(); final GetFunctionsResponse response = stub.getFunctions(null, NullProto.newBuilder().build()); ensureOk(response.getState()); for (int i = 0; i < response.getFunctionDescCount(); i++) { try { list.add(new FunctionDesc(response.getFunctionDesc(i))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return list; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final Collection<FunctionDesc> getFunctions() { List<FunctionDesc> list = new ArrayList<>(); try { final BlockingInterface stub = getStub(); final GetFunctionsResponse response = stub.getFunctions(null, NullProto.newBuilder().build()); ensureOk(response.getState()); for (int i = 0; i < response.getFunctionDescCount(); i++) { try { list.add(new FunctionDesc(response.getFunctionDesc(i))); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } return list; } catch (ServiceException e) { throw new RuntimeException(e); } }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; if (!hasState()) { memoizedIsInitialized = 0; return false; } if (!getState().isInitialized()) { memoizedIsInitialized = 0; return false; } for (int i = 0; i < getFunctionDescCount(); i++) { if (!getFunctionDesc(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }