Package datahub.client.patch
Class AbstractPatchBuilder<T extends AbstractPatchBuilder<T>>
- java.lang.Object
-
- datahub.client.patch.AbstractPatchBuilder<T>
-
- Direct Known Subclasses:
DatasetPropertiesPatchBuilder,EditableSchemaMetadataPatchBuilder,GlobalTagsPatchBuilder,GlossaryTermsPatchBuilder,OwnershipPatchBuilder,UpstreamLineagePatchBuilder
public abstract class AbstractPatchBuilder<T extends AbstractPatchBuilder<T>> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static com.fasterxml.jackson.databind.ObjectMapperOBJECT_MAPPERprotected java.lang.Stringopstatic java.lang.StringOP_KEYstatic java.lang.StringPATH_KEYprotected com.linkedin.common.urn.UrntargetEntityUrnstatic java.lang.StringVALUE_KEY
-
Constructor Summary
Constructors Constructor Description AbstractPatchBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description com.linkedin.mxe.MetadataChangeProposalbuild()Builder methodprotected com.linkedin.mxe.GenericAspectbuildPatch()Generates Json patch for this builder to be set on the returned proposal from the buidler methodprotected abstract java.lang.StringgetAspectName()The aspect name associated with this builderprotected abstract java.lang.StringgetPath()Path of the patch to apply, patch builders with complex object subpath will use a FieldPath enum to specifyprotected abstract java.util.stream.Stream<java.lang.Object>getRequiredProperties()Properties required by this builder to properly construct a patchprotected abstract com.fasterxml.jackson.databind.JsonNodegetValue()Json Patch value in JsonNode format, Note: field values initialize as null, so setting a field to null will be ignored rather than actually setting the field to null.Top(PatchOperationType op)Sets the operation of the patchTurn(com.linkedin.common.urn.Urn urn)Sets the target entity urn to be updated by this patch
-
-
-
Field Detail
-
op
protected java.lang.String op
-
targetEntityUrn
protected com.linkedin.common.urn.Urn targetEntityUrn
-
OP_KEY
public static final java.lang.String OP_KEY
- See Also:
- Constant Field Values
-
VALUE_KEY
public static final java.lang.String VALUE_KEY
- See Also:
- Constant Field Values
-
PATH_KEY
public static final java.lang.String PATH_KEY
- See Also:
- Constant Field Values
-
OBJECT_MAPPER
public static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
-
-
Method Detail
-
build
public com.linkedin.mxe.MetadataChangeProposal build()
Builder method- Returns:
- a
MetadataChangeProposalconstructed from the builder's properties
-
buildPatch
protected com.linkedin.mxe.GenericAspect buildPatch()
Generates Json patch for this builder to be set on the returned proposal from the buidler method- Returns:
- a JsonPatch wrapped by GenericAspect
-
getRequiredProperties
protected abstract java.util.stream.Stream<java.lang.Object> getRequiredProperties()
Properties required by this builder to properly construct a patch- Returns:
- a list of properties to execute a null check on
-
getPath
protected abstract java.lang.String getPath()
Path of the patch to apply, patch builders with complex object subpath will use a FieldPath enum to specify- Returns:
- path string
-
getValue
protected abstract com.fasterxml.jackson.databind.JsonNode getValue()
Json Patch value in JsonNode format, Note: field values initialize as null, so setting a field to null will be ignored rather than actually setting the field to null.- Returns:
JsonNode
-
getAspectName
protected abstract java.lang.String getAspectName()
The aspect name associated with this builder- Returns:
- aspect name
-
op
public T op(PatchOperationType op)
Sets the operation of the patch- Parameters:
op- The op value- Returns:
- this PatchBuilder subtype's instance
-
urn
public T urn(com.linkedin.common.urn.Urn urn)
Sets the target entity urn to be updated by this patch- Parameters:
urn- The target entity whose aspect is to be patched by this update- Returns:
- this PatchBuilder subtype's instance
-
-