-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(properties) Add upsertStructuredProperties graphql endpoint for …
…assets (#9906)
- Loading branch information
1 parent
c1f6efa
commit 5a3df32
Showing
48 changed files
with
951 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...main/java/com/linkedin/datahub/graphql/resolvers/mutate/util/StructuredPropertyUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.linkedin.datahub.graphql.resolvers.mutate.util; | ||
|
||
import com.linkedin.datahub.graphql.generated.PropertyValueInput; | ||
import com.linkedin.structured.PrimitivePropertyValue; | ||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
public class StructuredPropertyUtils { | ||
|
||
private StructuredPropertyUtils() {} | ||
|
||
@Nullable | ||
public static PrimitivePropertyValue mapPropertyValueInput( | ||
@Nonnull final PropertyValueInput valueInput) { | ||
if (valueInput.getStringValue() != null) { | ||
return PrimitivePropertyValue.create(valueInput.getStringValue()); | ||
} else if (valueInput.getNumberValue() != null) { | ||
return PrimitivePropertyValue.create(valueInput.getNumberValue().doubleValue()); | ||
} | ||
return null; | ||
} | ||
} |
Oops, something went wrong.