@Test public void testGetPropertyNameForBranch() { Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, -1), PROPERTY_FOO); Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, 0), PROPERTY_FOO + ".0"); Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, 1), PROPERTY_FOO + ".1"); Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, 0, 0), PROPERTY_FOO); Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, 1, 0), PROPERTY_FOO); Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, 2, 0), PROPERTY_FOO + ".0"); Assert.assertEquals(ForkOperatorUtils.getPropertyNameForBranch(PROPERTY_FOO, 2, 1), PROPERTY_FOO + ".1"); }
public static String getPropertyNameForBranch(String key, int numBranches, int branchId) { Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branchId >= 0, "The branchId is expected to be non-negative"); return numBranches > 1 ? key + "." + branchId : key; }
ForkOperatorUtils { public static String getPropertyNameForBranch(String key, int numBranches, int branchId) { Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branchId >= 0, "The branchId is expected to be non-negative"); return numBranches > 1 ? key + "." + branchId : key; } }
ForkOperatorUtils { public static String getPropertyNameForBranch(String key, int numBranches, int branchId) { Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branchId >= 0, "The branchId is expected to be non-negative"); return numBranches > 1 ? key + "." + branchId : key; }  }
ForkOperatorUtils { public static String getPropertyNameForBranch(String key, int numBranches, int branchId) { Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branchId >= 0, "The branchId is expected to be non-negative"); return numBranches > 1 ? key + "." + branchId : key; }  static String getPropertyNameForBranch(String key, int numBranches, int branchId); static String getPropertyNameForBranch(String key, int branch); static String getPropertyNameForBranch(WorkUnitState workUnitState, String key); static String getPathForBranch(State state, String path, int numBranches, int branchId); static String getForkId(String taskId, int index); }
ForkOperatorUtils { public static String getPropertyNameForBranch(String key, int numBranches, int branchId) { Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branchId >= 0, "The branchId is expected to be non-negative"); return numBranches > 1 ? key + "." + branchId : key; }  static String getPropertyNameForBranch(String key, int numBranches, int branchId); static String getPropertyNameForBranch(String key, int branch); static String getPropertyNameForBranch(WorkUnitState workUnitState, String key); static String getPathForBranch(State state, String path, int numBranches, int branchId); static String getForkId(String taskId, int index);  }