コード例 #1
0
 private static ConstructorDef<?> parseConstructorDef(
     org.apache.reef.tang.proto.ClassHierarchyProto.ConstructorDef def, boolean isInjectable) {
   List<ConstructorArg> args = new ArrayList<>();
   for (ClassHierarchyProto.ConstructorArg arg : def.getArgsList()) {
     args.add(
         new ConstructorArgImpl(
             arg.getFullArgClassName(), arg.getNamedParameterName(), arg.getIsInjectionFuture()));
   }
   return new ConstructorDefImpl<>(
       def.getFullClassName(), args.toArray(new ConstructorArg[0]), isInjectable);
 }
コード例 #2
0
 private static ClassHierarchyProto.ConstructorArg newConstructorArg(
     String fullArgClassName, String namedParameterName, boolean isFuture) {
   ClassHierarchyProto.ConstructorArg.Builder builder =
       ClassHierarchyProto.ConstructorArg.newBuilder()
           .setFullArgClassName(fullArgClassName)
           .setIsInjectionFuture(isFuture);
   if (namedParameterName != null) {
     builder.setNamedParameterName(namedParameterName).build();
   }
   return builder.build();
 }