@SuppressWarnings("unchecked") public B plainAttrs(final Collection<AttrPatch> plainAttrs) { getInstance().getPlainAttrs().addAll(plainAttrs); return (B) this; }
@SuppressWarnings("unchecked") public B plainAttrs(final AttrPatch... plainAttrs) { getInstance().getPlainAttrs().addAll(Arrays.asList(plainAttrs)); return (B) this; }
@SuppressWarnings("unchecked") public B plainAttr(final AttrPatch plainAttr) { getInstance().getPlainAttrs().add(plainAttr); return (B) this; }
/** * Add PLAIN attribute DELETE patch for those attributes of the input AnyTO without values or containing null value * * @param anyTO User, Group or Any Object to look for attributes with no value * @param anyUR update req to enrich with DELETE statements */ public static void cleanEmptyAttrs(final AnyTO anyTO, final AnyUR anyUR) { anyUR.getPlainAttrs().addAll(anyTO.getPlainAttrs().stream(). filter(plainAttr -> isEmpty(plainAttr)). map(plainAttr -> new AttrPatch.Builder(new Attr.Builder(plainAttr.getSchema()).build()). operation(PatchOperation.DELETE). build()).collect(Collectors.toSet())); }
result.getPlainAttrs().addAll(patch(EntityTOUtils.buildAttrMap(to.getPlainAttrs()), req.getPlainAttrs()));
Map<String, Attr> originalAttrs = EntityTOUtils.buildAttrMap(original.getPlainAttrs()); result.getPlainAttrs().clear(); result.getPlainAttrs().add(new AttrPatch.Builder(new Attr.Builder(schema).build()). operation(PatchOperation.DELETE). build()); if (isEmpty(attr)) { if (!incremental) { result.getPlainAttrs().add(new AttrPatch.Builder(new Attr.Builder(attr.getSchema()).build()). operation(PatchOperation.DELETE). build()); result.getPlainAttrs().add(patch);