本文整理了Java中org.mapstruct.Mapping
类的一些代码示例,展示了Mapping
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mapping
类的具体详情如下:
包路径:org.mapstruct.Mapping
类名称:Mapping
暂无
代码示例来源:origin: Vedenin/useful-java-links
@Mapping(source = "message", target = "text")
Destination sourceToDestination(Source source);
}
代码示例来源:origin: blox/blox
@Mapping(source = "environmentId.accountId", target = "accountId")
@Mapping(source = "environmentId.cluster", target = "clusterName")
@Mapping(source = "environmentId.environmentName", target = "environmentName")
@Mapping(source = "environmentType", target = "type")
@Mapping(source = "environmentHealth", target = "health")
@Mapping(source = "environmentStatus", target = "status")
@Mapping(target = "recordVersion", ignore = true)
@Mapping(
target = "accountIdCluster",
expression = "java(environment.getEnvironmentId().generateAccountIdCluster())"
)
EnvironmentDDBRecord toEnvironmentDDBRecord(Environment environment);
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "cluster")
@Mapping(target = "environmentId.environmentName", source = "request.environmentName")
CreateEnvironmentRequest toDataServiceRequest(
ApiGatewayRequestContext context,
String cluster,
CreateEnvironment.CreateEnvironmentRequest request);
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "cluster")
@Mapping(target = "environmentId.environmentName", source = "environmentName")
DeleteEnvironmentRequest toDataServiceRequest(
ApiGatewayRequestContext context,
String cluster,
String environmentName,
boolean forceDelete);
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "environment.cluster")
@Mapping(target = "environmentId.environmentName", source = "environment.environmentName")
// TODO: Add timestamps and status to frontend
@Mapping(target = "createdTime", ignore = true)
@Mapping(target = "lastUpdatedTime", ignore = true)
@Mapping(target = "environmentStatus", ignore = true)
Environment toDataService(
ApiGatewayRequestContext context, com.amazonaws.blox.frontend.models.Environment environment);
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "cluster")
@Mapping(target = "environmentId.environmentName", source = "environmentName")
StartDeploymentRequest toDataServiceRequest(
ApiGatewayRequestContext context,
String cluster,
String environmentName,
String environmentRevisionId);
代码示例来源:origin: blox/blox
@Mapping(target = "createdTime", ignore = true)
@Mapping(target = "lastUpdatedTime", ignore = true)
@Mapping(target = "environmentStatus", ignore = true)
@Mapping(target = "environmentHealth", ignore = true)
@Mapping(target = "activeEnvironmentRevisionId", ignore = true)
@Mapping(target = "latestEnvironmentRevisionId", ignore = true)
@Mapping(target = "validEnvironment", ignore = true)
Environment toEnvironment(CreateEnvironmentRequest createEnvironmentRequest);
代码示例来源:origin: blox/blox
@Mapping(
target = "environmentNames",
expression =
"java(response.getEnvironmentIds().stream().map(e -> e.getEnvironmentName()).collect(java.util.stream.Collectors.toList()))"
)
ListEnvironments.ListEnvironmentsResponse fromDataServiceResponse(
ListEnvironmentsResponse response);
}
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "cluster")
@Mapping(target = "environmentId.environmentName", source = "environmentName")
DescribeEnvironmentRevisionRequest toDataServiceRequest(
ApiGatewayRequestContext context,
String cluster,
String environmentName,
String environmentRevisionId);
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "cluster")
@Mapping(target = "environmentId.environmentName", source = "environmentName")
UpdateEnvironmentRequest toDataServiceRequest(
ApiGatewayRequestContext context,
String cluster,
String environmentName,
UpdateEnvironment.UpdateEnvironmentRequest request);
代码示例来源:origin: blox/blox
@Mapping(target = "environmentId.accountId", source = "context.accountId")
@Mapping(target = "environmentId.cluster", source = "cluster")
@Mapping(target = "environmentId.environmentName", source = "environmentName")
DescribeEnvironmentRequest toDataServiceRequest(
ApiGatewayRequestContext context, String cluster, String environmentName);
代码示例来源:origin: blox/blox
@Mapping(source = "environmentId.cluster", target = "clusterName")
@Mapping(source = "environmentId.environmentName", target = "environmentName")
@Mapping(
target = "accountIdClusterEnvironmentName",
expression =
"java(environmentRevision.getEnvironmentId().generateAccountIdClusterEnvironmentName())"
)
@Mapping(source = "instanceGroup.attributes", target = "attributes")
@Mapping(target = "recordVersion", ignore = true)
EnvironmentRevisionDDBRecord toEnvironmentRevisionDDBRecord(
EnvironmentRevision environmentRevision);
代码示例来源:origin: blox/blox
@Mapping(target = "counts", ignore = true)
EnvironmentRevision fromDataService(
com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentRevision environmentRevision);
}
代码示例来源:origin: blox/blox
@Mapping(target = "cluster.accountId", source = "context.accountId")
@Mapping(target = "cluster.clusterName", source = "cluster")
ListEnvironmentsRequest toListEnvironmentsRequest(
ApiGatewayRequestContext context, String cluster, String environmentNamePrefix);
代码示例来源:origin: blox/blox
@Mapping(source = "environmentRevision.environmentRevisionId", target = "environmentRevisionId")
CreateEnvironment.CreateEnvironmentResponse fromDataServiceResponse(
com.amazonaws.blox.dataservicemodel.v1.model.wrappers.CreateEnvironmentResponse response);
}
代码示例来源:origin: blox/blox
@Mapping(target = "cluster", source = "environmentId.cluster")
@Mapping(target = "environmentName", source = "environmentId.environmentName")
com.amazonaws.blox.frontend.models.Environment fromDataService(Environment environment);
}
代码示例来源:origin: blox/blox
@InheritInverseConfiguration
@Mapping(
target = "environmentId.accountId",
expression =
"java(EnvironmentId.getAccountIdFromAccountIdCluster(environmentDDBRecord.getAccountIdCluster()))"
)
@Mapping(
target = "environmentId.cluster",
expression =
"java(EnvironmentId.getClusterFromAccountIdCluster(environmentDDBRecord.getAccountIdCluster()))"
)
// TODO map deploymentConfiguration
@Mapping(target = "deploymentConfiguration", ignore = true)
Environment toEnvironment(EnvironmentDDBRecord environmentDDBRecord);
代码示例来源:origin: blox/blox
@InheritInverseConfiguration
@Mapping(
target = "environmentId.accountId",
expression =
"java(EnvironmentId.getAccountIdFromAccountIdClusterEnvironmentName(environmentRevisionDDBRecord.getAccountIdClusterEnvironmentName()))"
)
EnvironmentRevision toEnvironmentRevision(
EnvironmentRevisionDDBRecord environmentRevisionDDBRecord);
代码示例来源:origin: mapstruct/mapstruct-examples
@Mapping(target = "fish.kind", source = "fish.type")
@Mapping(target = "fish.name", constant = "Nemo")
@Mapping(target = "ornament", ignore = true )
@Mapping(target = "material.materialType", source = "material")
@Mapping(target = "material.manufacturer", constant = "MMM" )
@Mapping(target = "quality", ignore = true)
FishTankDto map(FishTank source);
代码示例来源:origin: mapstruct/mapstruct-examples
@Mapping(target = "fish.kind", source = "fish.type")
@Mapping(target = "fish.name", expression = "java(\"Jaws\")")
@Mapping(target = "plant", ignore = true )
@Mapping(target = "ornament", ignore = true )
@Mapping(target = "material", ignore = true)
@Mapping(target = "quality.report.organisation.name", expression = "java(\"Dunno\")" )
FishTankDto map(FishTank source);
内容来源于网络,如有侵权,请联系作者删除!