public final class EntityDtoConverters
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
setJsonField(com.fasterxml.jackson.databind.JsonNode json,
java.util.function.Consumer<java.lang.String> consumer)
Given a JSON node convert it to a string representation and hand it to the consumer.
|
static com.netflix.genie.common.internal.dto.v4.Criterion |
toCriterionDto(CriterionEntity criterionEntity)
Convert a given
CriterionEntity to the equivalent Criterion DTO representation. |
static com.netflix.genie.common.internal.dto.v4.JobSpecification |
toJobSpecificationDto(JobSpecificationProjection jobSpecificationProjection)
Convert the values contained in the
JobSpecificationProjection to an immutable JobSpecification
DTO. |
static com.netflix.genie.common.internal.dto.v4.Application |
toV4ApplicationDto(ApplicationEntity applicationEntity)
Convert an application entity to a DTO for external exposure.
|
static com.netflix.genie.common.internal.dto.v4.Cluster |
toV4ClusterDto(ClusterEntity clusterEntity)
Convert a cluster entity to a DTO for external exposure.
|
static com.netflix.genie.common.internal.dto.v4.Command |
toV4CommandDto(CommandEntity commandEntity)
Convert a command entity to a DTO for external exposure.
|
static com.netflix.genie.common.internal.dto.v4.JobRequest |
toV4JobRequestDto(V4JobRequestProjection jobRequestProjection)
Convert a job request entity to a DTO.
|
public static com.netflix.genie.common.internal.dto.v4.Application toV4ApplicationDto(ApplicationEntity applicationEntity)
applicationEntity - The entity to convertpublic static com.netflix.genie.common.internal.dto.v4.Cluster toV4ClusterDto(ClusterEntity clusterEntity)
clusterEntity - The entity to convertpublic static com.netflix.genie.common.internal.dto.v4.Command toV4CommandDto(CommandEntity commandEntity)
commandEntity - The entity to convertpublic static com.netflix.genie.common.internal.dto.v4.JobRequest toV4JobRequestDto(V4JobRequestProjection jobRequestProjection)
jobRequestProjection - The projection of the JobEntity to
convertcom.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException - When criterion can't be properly convertedpublic static com.netflix.genie.common.internal.dto.v4.Criterion toCriterionDto(CriterionEntity criterionEntity)
CriterionEntity to the equivalent Criterion DTO representation.criterionEntity - The entity to convertpublic static void setJsonField(@Nullable
com.fasterxml.jackson.databind.JsonNode json,
java.util.function.Consumer<java.lang.String> consumer)
json - The JSON node to convert. If null null will be passed to the consumerconsumer - The consumer function to call with the string representationpublic static com.netflix.genie.common.internal.dto.v4.JobSpecification toJobSpecificationDto(JobSpecificationProjection jobSpecificationProjection)
JobSpecificationProjection to an immutable JobSpecification
DTO.jobSpecificationProjection - The entity values to convertcom.netflix.genie.common.internal.exceptions.unchecked.GenieClusterNotFoundException - When the cluster isn't found in the database which it should be at this
point given the input to the db was valid at the time of persistencecom.netflix.genie.common.internal.exceptions.unchecked.GenieCommandNotFoundException - When the command isn't found in the database which it should be at this
point given the input to the db was valid at the time of persistencecom.netflix.genie.common.internal.exceptions.unchecked.GenieRuntimeException - All input should be valid at this point so if we can't create a job spec
dto something has become corrupted in the db