@Test(expected = IllegalArgumentException.class) public void partitionPath_cannot_be_null() throws Exception { mapping.convertOperation(road, PatchOperation.replace("/foo", null)); }
@Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of " + name); checkArgument(modelOperation.getValue() instanceof String, name + " must be a string"); checkArgument(StringUtils.isNotBlank((CharSequence) modelOperation.getValue()), name + " cannot be blank"); return PatchOperation.replace("/" + name, modelOperation.getValue()); }
DefaultStringPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of " + name); checkArgument(modelOperation.getValue() instanceof String, name + " must be a string"); checkArgument(StringUtils.isNotBlank((CharSequence) modelOperation.getValue()), name + " cannot be blank"); return PatchOperation.replace("/" + name, modelOperation.getValue()); } }
DefaultStringPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of " + name); checkArgument(modelOperation.getValue() instanceof String, name + " must be a string"); checkArgument(StringUtils.isNotBlank((CharSequence) modelOperation.getValue()), name + " cannot be blank"); return PatchOperation.replace("/" + name, modelOperation.getValue()); } DefaultStringPatchMapping(String name); }
DefaultStringPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of " + name); checkArgument(modelOperation.getValue() instanceof String, name + " must be a string"); checkArgument(StringUtils.isNotBlank((CharSequence) modelOperation.getValue()), name + " cannot be blank"); return PatchOperation.replace("/" + name, modelOperation.getValue()); } DefaultStringPatchMapping(String name); @Override String getPath(); @Override PatchOperation convertOperation(Road road, PatchOperation modelOperation); }
DefaultStringPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of " + name); checkArgument(modelOperation.getValue() instanceof String, name + " must be a string"); checkArgument(StringUtils.isNotBlank((CharSequence) modelOperation.getValue()), name + " cannot be blank"); return PatchOperation.replace("/" + name, modelOperation.getValue()); } DefaultStringPatchMapping(String name); @Override String getPath(); @Override PatchOperation convertOperation(Road road, PatchOperation modelOperation);  }