instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public void recreateADElementLinkForFieldId(@NonNull final AdFieldId adFieldId) { deleteExistingADElementLinkForFieldId(adFieldId); createADElementLinkForFieldId(adFieldId); } @Override public void createADElementLinkForFieldId(@NonNull final AdFieldId adFieldId) { // NOTE: no params because we want to log ...
public void recreateADElementLinkForWindowId(final AdWindowId adWindowId) { deleteExistingADElementLinkForWindowId(adWindowId); createADElementLinkForWindowId(adWindowId); } @Override public void createADElementLinkForWindowId(final AdWindowId adWindowId) { // NOTE: no params because we want to log migratio...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\element\api\impl\ElementLinkBL.java
1
请在Spring Boot框架中完成以下Java代码
public class RoleController extends BladeController { private IRoleService roleService; /** * 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @Operation(summary = "详情", description = "传入role") public R<RoleVO> detail(Role role) { Role detail = roleService.getOne(Condition.getQueryWrapper(role...
@Operation(summary = "新增或修改", description = "传入role") public R submit(@Valid @RequestBody Role role, BladeUser user) { CacheUtil.clear(SYS_CACHE); if (Func.isEmpty(role.getId())) { role.setTenantId(user.getTenantId()); } return R.status(roleService.saveOrUpdate(role)); } /** * 删除 */ @PostMapping("/r...
repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\controller\RoleController.java
2
请完成以下Java代码
public class LocationElement extends GridElement { /** * Constructor * @param ctx context * @param C_Location_ID location * @param font font * @param color color * @param isHeightOneLine * @param label * @param labelSuffix */ public LocationElement(Properties ctx, int C_Location_ID, Font font, Paint...
if (ml.getAddress2() != null && ml.getAddress2().length() > 0) setData(index++, 0, ml.getAddress2(), font, color); if (ml.getAddress3() != null && ml.getAddress3().length() > 0) setData(index++, 0, ml.getAddress3(), font, color); if (ml.getAddress4() != null && ml.getAddress4().length() > 0) setD...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\layout\LocationElement.java
1
请完成以下Java代码
public void setCaseDefinitionId(String caseDefinitionId) { this.caseDefinitionId = caseDefinitionId; } public String getCaseDefinitionKey() { return caseDefinitionKey; } public void setCaseDefinitionKey(String caseDefinitionKey) { this.caseDefinitionKey = caseDefinitionKey; } public String ge...
return finishedCaseInstanceCount; } public void setFinishedCaseInstanceCount(Long finishedCaseInstanceCount) { this.finishedCaseInstanceCount = finishedCaseInstanceCount; } public long getCleanableCaseInstanceCount() { return cleanableCaseInstanceCount; } public void setCleanableCaseInstanceCount...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\CleanableHistoricCaseInstanceReportResultEntity.java
1
请在Spring Boot框架中完成以下Java代码
public class PersistenceConfig { @Autowired private Environment env; @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); em.s...
@Bean public PlatformTransactionManager transactionManager() { final JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); return transactionManager; } @Bean public PersistenceExce...
repos\tutorials-master\persistence-modules\spring-data-jpa-repo\src\main\java\com\baeldung\jpa\config\PersistenceConfig.java
2
请完成以下Java代码
public void setDescription (final @Nullable java.lang.String Description) { set_Value (COLUMNNAME_Description, Description); } @Override public java.lang.String getDescription() { return get_ValueAsString(COLUMNNAME_Description); } /** * HU_UnitType AD_Reference_ID=540472 * Reference name: HU_UnitTyp...
return get_ValueAsString(COLUMNNAME_HU_UnitType); } @Override public void setM_HU_PackagingCode_ID (final int M_HU_PackagingCode_ID) { if (M_HU_PackagingCode_ID < 1) set_ValueNoCheck (COLUMNNAME_M_HU_PackagingCode_ID, null); else set_ValueNoCheck (COLUMNNAME_M_HU_PackagingCode_ID, M_HU_PackagingCode_ID...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_PackagingCode.java
1
请完成以下Java代码
public void setSize (double Width, double Height) { this.width = Width; this.height = Height; } // setSize /** * Set Size * @param dim dimension */ public void setSize (Dimension dim) { this.width = dim.getWidth(); this.height = dim.getHeight(); } // setSize /** * Add Size below existing *...
* Hash Code * @return hash code */ public int hashCode() { long bits = Double.doubleToLongBits(width); bits ^= Double.doubleToLongBits(height) * 31; return (((int) bits) ^ ((int) (bits >> 32))); } // hashCode /** * Equals * @param obj object * @return true if w/h is same */ public boolean e...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\layout\Dimension2DImpl.java
1
请在Spring Boot框架中完成以下Java代码
public class GLCategoryId implements RepoIdAware { int repoId; @JsonCreator public static GLCategoryId ofRepoId(final int repoId) { return new GLCategoryId(repoId); } public static GLCategoryId ofRepoIdOrNull(final int repoId) { return repoId > 0 ? new GLCategoryId(repoId) : null; } public static int to...
{ return glCategoryId != null ? glCategoryId.getRepoId() : -1; } private GLCategoryId(final int repoId) { this.repoId = Check.assumeGreaterThanZero(repoId, "GL_Category_ID"); } @Override @JsonValue public int getRepoId() { return repoId; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\gljournal\GLCategoryId.java
2
请在Spring Boot框架中完成以下Java代码
public class PrimaryConfig { @Autowired @Qualifier("primaryDataSource") private DataSource primaryDataSource; @Autowired private JpaProperties jpaProperties; @Autowired private HibernateProperties hibernateProperties; private Map<String, Object> getVendorProperties() { return ...
@Bean(name = "entityManagerFactoryPrimary") public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary (EntityManagerFactoryBuilder builder) { // HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter(); // jpaVendorAdapter.setGenerateDdl(true); return builde...
repos\SpringBoot-Learning-master\2.x\chapter3-8\src\main\java\com\didispace\chapter38\PrimaryConfig.java
2
请在Spring Boot框架中完成以下Java代码
public String getTenantId() { return tenantId; } @JsonTypeInfo(use = Id.CLASS, defaultImpl = RestVariable.class) @ApiModelProperty(value = "Array of variables (in the general variables format) to use as payload to pass along with the signal. Cannot be used in case async is set to true, this will re...
public String getSignalName() { return signalName; } public void setSignalName(String signalName) { this.signalName = signalName; } public void setAsync(boolean async) { this.async = async; } @ApiModelProperty(value = "If true, handling of the signal will happen asynch...
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\process\SignalEventReceivedRequest.java
2
请在Spring Boot框架中完成以下Java代码
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { Resource resource = new ClassPathResource("META-INF/spring.integration.properties"); if (resource.exists()) { registerIntegrationPropertiesPropertySource(environment, resource); } } protected void regist...
mappings.put(PREFIX + "endpoint.no-auto-startup", IntegrationProperties.ENDPOINTS_NO_AUTO_STARTUP); KEYS_MAPPING = Collections.unmodifiableMap(mappings); } private final OriginTrackedMapPropertySource delegate; IntegrationPropertiesPropertySource(OriginTrackedMapPropertySource delegate) { super("META-INF/...
repos\spring-boot-4.0.1\module\spring-boot-integration\src\main\java\org\springframework\boot\integration\autoconfigure\IntegrationPropertiesEnvironmentPostProcessor.java
2
请在Spring Boot框架中完成以下Java代码
protected void configureGemFireProperties(@NonNull ConfigurableEnvironment environment, @NonNull CacheFactoryBean cache) { Assert.notNull(environment, "Environment must not be null"); Assert.notNull(cache, "CacheFactoryBean must not be null"); MutablePropertySources propertySources = environment.getPropertyS...
private boolean isNotSet(Properties gemfireProperties, String propertyName) { return !gemfireProperties.containsKey(normalizeGemFirePropertyName(propertyName)); } private boolean isValidGemFireProperty(String propertyName) { try { GemFireProperties.from(normalizeGemFirePropertyName(propertyName)); return t...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\EnvironmentSourcedGemFirePropertiesAutoConfiguration.java
2
请完成以下Java代码
public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) { if (C_InvoiceLine_ID < 1) set_ValueNoCheck (COLUMNNAME_C_InvoiceLine_ID, null); else set_ValueNoCheck (COLUMNNAME_C_InvoiceLine_ID, Integer.valueOf(C_InvoiceLine_ID)); } /** Get Rechnungsposition. @return Rechnungszeile */ @Override public ...
return get_ValueAsPO(COLUMNNAME_M_Product_ID, org.compiere.model.I_M_Product.class); } @Override public void setM_Product(org.compiere.model.I_M_Product M_Product) { set_ValueFromPO(COLUMNNAME_M_Product_ID, org.compiere.model.I_M_Product.class, M_Product); } /** Set Produkt. @param M_Product_ID Produkt, ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BPartner_Product_Stats_Invoice_Online_V.java
1
请完成以下Java代码
public class RemoveService { /** * 设置集合名称 */ private static final String COLLECTION_NAME = "users"; @Resource private MongoTemplate mongoTemplate; /** * 删除集合中【符合条件】的【一个]或[多个】文档 * * @return 删除用户信息的结果 */ public Object remove() { // 设置查询条件参数 int age ...
String name = "zhangsansan"; // 创建条件对象 Criteria criteria = Criteria.where("name").is(name); // 创建查询对象,然后将条件对象添加到其中 Query query = new Query(criteria); // 执行删除查找到的匹配的第一条文档,并返回删除的文档信息 User result = mongoTemplate.findAndRemove(query, User.class, COLLECTION_NAME); // 输...
repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\RemoveService.java
1
请在Spring Boot框架中完成以下Java代码
public class PersistenceUserAutoConfiguration { @Autowired private Environment env; public PersistenceUserAutoConfiguration() { super(); } // @Primary @Bean public LocalContainerEntityManagerFactoryBean userEntityManager() { final LocalContainerEntityManagerFactoryBean...
properties.put("hibernate.dialect", env.getProperty("hibernate.dialect")); em.setJpaPropertyMap(properties); return em; } @Bean @Primary @ConfigurationProperties(prefix="spring.datasource") public DataSource userDataSource() { return DataSourceBuilder.create().build(); ...
repos\tutorials-master\persistence-modules\spring-data-jpa-enterprise\src\main\java\com\baeldung\multipledb\PersistenceUserAutoConfiguration.java
2
请完成以下Java代码
private CommissionPoints extractInvoicedCommissionPoints(@NonNull final I_C_Invoice_Candidate icRecord) { final CommissionPoints commissionPointsToInvoice = CommissionPoints.of(icRecord.getNetAmtInvoiced()); return deductTaxAmount(commissionPointsToInvoice, icRecord); } @NonNull private CommissionPoints deduc...
return CommissionPoints.of(taxAdjustedAmount); } @NonNull private Optional<BPartnerId> getSalesRepId(@NonNull final I_C_Invoice_Candidate icRecord) { final BPartnerId invoiceCandidateSalesRepId = BPartnerId.ofRepoIdOrNull(icRecord.getC_BPartner_SalesRep_ID()); if (invoiceCandidateSalesRepId != null) { re...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\commission\commissioninstance\businesslogic\sales\commissiontrigger\salesinvoicecandidate\SalesInvoiceCandidateFactory.java
1
请在Spring Boot框架中完成以下Java代码
public void setS_Issue(final de.metas.serviceprovider.model.I_S_Issue S_Issue) { set_ValueFromPO(COLUMNNAME_S_Issue_ID, de.metas.serviceprovider.model.I_S_Issue.class, S_Issue); } @Override public void setS_Issue_ID (final int S_Issue_ID) { if (S_Issue_ID < 1) set_Value (COLUMNNAME_S_Issue_ID, null); el...
return get_ValueAsInt(COLUMNNAME_S_Issue_ID); } @Override public void setS_IssueLabel_ID (final int S_IssueLabel_ID) { if (S_IssueLabel_ID < 1) set_ValueNoCheck (COLUMNNAME_S_IssueLabel_ID, null); else set_ValueNoCheck (COLUMNNAME_S_IssueLabel_ID, S_IssueLabel_ID); } @Override public int getS_Issue...
repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java-gen\de\metas\serviceprovider\model\X_S_IssueLabel.java
2
请完成以下Java代码
public boolean overlapsWith(Interval other) { return this.start <= other.getEnd() && this.end >= other.getStart(); } /** * 区间是否覆盖了这个点 * @param point * @return */ public boolean overlapsWith(int point) { return this.start <= point && point <= this....
public int hashCode() { return this.start % 100 + this.end % 100; } @Override public int compareTo(Object o) { if (!(o instanceof Intervalable)) { return -1; } Intervalable other = (Intervalable) o; int comparison = this.start - other.getS...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\algorithm\ahocorasick\interval\Interval.java
1
请完成以下Java代码
public boolean isHighVolume() { return true; } @Override public boolean isAllowAnyValue() { return true; } @Override public Evaluatee prepareContext(final IAttributeSet attributeSet) { return Evaluatees.empty(); } @Override public List<? extends NamePair> getAvailableValues(final Evaluatee evalCtx_...
{ final I_C_BPartner bpartner = bpartnerDAO.getByIdOutOfTrx(bpartnerId); return bpartner != null ? toKeyNamePair(bpartner) : null; } @Nullable @Override public AttributeValueId getAttributeValueIdOrNull(final Object valueKey) { return null; } private List<KeyNamePair> getCachedVendors() { final Immuta...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\org\adempiere\mm\attributes\spi\impl\HUVendorBPartnerAttributeValuesProvider.java
1
请完成以下Java代码
public class DownloadMediaResponse extends BaseResponse { private static final Logger LOG = LoggerFactory.getLogger(DownloadMediaResponse.class); private String fileName; private byte[] content; public String getFileName() { return fileName; } public void setFileName(String fileName) ...
this.content = temp; } } catch (IOException e) { LOG.error("异常", e); } } /** * 如果成功,则可以靠这个方法将数据输出 * * @param out 调用者给的输出流 * @throws IOException 写流出现异常 */ public void writeTo(OutputStream out) throws IOException { out.write(this.conten...
repos\spring-boot-quick-master\quick-wx-public\src\main\java\com\wx\pn\api\response\DownloadMediaResponse.java
1
请完成以下Java代码
public String escapeReservedWord(String name) { return "_" + name; // add an underscore to the name } /** * Location to write model files. You can use the modelPackage() as defined when the class is * instantiated */ public String modelFileFolder() { return outputFolder() +...
* @return */ @Override protected ImmutableMap.Builder<String, Mustache.Lambda> addMustacheLambdas() { // Start with parent lambdas ImmutableMap.Builder<String, Mustache.Lambda> builder = super.addMustacheLambdas(); // Add custom lambda to convert operationIds in suitable java const...
repos\tutorials-master\spring-swagger-codegen-modules\openapi-custom-generator\src\main\java\com\baeldung\openapi\generators\camelclient\JavaCamelClientGenerator.java
1
请完成以下Java代码
public FlowElement getSourceFlowElement() { return sourceFlowElement; } public void setSourceFlowElement(FlowElement sourceFlowElement) { this.sourceFlowElement = sourceFlowElement; } public FlowElement getTargetFlowElement() { return targetFlowElement; } public void s...
public String toString() { return sourceRef + " --> " + targetRef; } public SequenceFlow clone() { SequenceFlow clone = new SequenceFlow(); clone.setValues(this); return clone; } public void setValues(SequenceFlow otherFlow) { super.setValues(otherFlow); ...
repos\Activiti-develop\activiti-core\activiti-bpmn-model\src\main\java\org\activiti\bpmn\model\SequenceFlow.java
1
请完成以下Java代码
public class Result<T> implements Serializable { private static final long serialVersionUID = 5925101851082556646L; private T data; @ApiModelProperty(value = "状态码",example = "SUCCESS") private Status status; @ApiModelProperty(value = "错误编码",example = "4001") private String code; private Stri...
} public void setMessage(String message) { this.message = message; } public Status getStatus() { return status; } public void setStatus(Status status) { this.status = status; } public static enum Status { SUCCESS("OK"), ERROR("ERROR"); pri...
repos\spring-boot-student-master\spring-boot-student-swagger\src\main\java\com\xiaolyuh\Result.java
1
请完成以下Java代码
public class AnnotationConfigReactiveWebApplicationContext extends AnnotationConfigApplicationContext implements ConfigurableReactiveWebApplicationContext { /** * Create a new AnnotationConfigReactiveWebApplicationContext that needs to be * populated through {@link #register} calls and then manually {@linkplain...
*/ public AnnotationConfigReactiveWebApplicationContext(String... basePackages) { super(basePackages); } @Override protected ConfigurableEnvironment createEnvironment() { return new StandardReactiveWebEnvironment(); } @Override protected Resource getResourceByPath(String path) { // We must be careful not...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\web\context\reactive\AnnotationConfigReactiveWebApplicationContext.java
1
请在Spring Boot框架中完成以下Java代码
public class ProductsRestController { private static final Logger logger = LogManager.getLogger(ProductsRestController.class); private final ProductsServicesFacade productsServicesFacade; public ProductsRestController(@NonNull final ProductsServicesFacade productsServicesFacade) { this.productsServicesFacade = p...
.adLanguage(adLanguage) .execute(); return ResponseEntity.ok(response); } catch (final Exception ex) { logger.debug("Got exception", ex); return ResponseEntity .status(HttpStatus.NOT_FOUND) .body(JsonGetProductsResponse.error(ex, adLanguage)); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v1\product\ProductsRestController.java
2
请完成以下Java代码
public Integer getPermissionId() { return permissionId; } /** * 设置 权限ID. * * @param permissionId 权限ID. */ public void setPermissionId(Integer permissionId) { this.permissionId = permissionId; } /** * 获取 创建时间. * * @return 创建时间. */ public D...
* * @return 更新时间. */ public Date getUpdatedTime() { return updatedTime; } /** * 设置 更新时间. * * @param updatedTime 更新时间. */ public void setUpdatedTime(Date updatedTime) { this.updatedTime = updatedTime; } protected Serializable pkVal() { retur...
repos\SpringBootBucket-master\springboot-jwt\src\main\java\com\xncoding\jwt\dao\domain\RolePermission.java
1
请完成以下Java代码
public BigDecimal getTotalLinesWithSurchargeAmt() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_TotalLinesWithSurchargeAmt); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setTotalTaxBaseAmt (final @Nullable BigDecimal TotalTaxBaseAmt) { set_Value (COLUMNNAME_TotalTaxBaseAmt, ...
{ set_ValueNoCheck (COLUMNNAME_TotalVatWithSurchargeAmt, TotalVatWithSurchargeAmt); } @Override public BigDecimal getTotalVatWithSurchargeAmt() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_TotalVatWithSurchargeAmt); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setVATaxID...
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_invoic_v.java
1
请完成以下Java代码
public static String reverseTheOrderOfWordsUsingApacheCommons(String sentence) { return StringUtils.reverseDelimited(sentence, ' '); } public static String reverseUsingIntStreamRangeMethod(String str) { if (str == null) { return null; } char[] charArray = str.toChar...
return Stream.of(str) .map(string -> new StringBuilder(string).reverse()) .collect(Collectors.joining()); } public static String reverseUsingCharsMethod(String str) { if (str == null) { return null; } return str.chars() .mapToObj(c -> (char) c)...
repos\tutorials-master\core-java-modules\core-java-string-algorithms\src\main\java\com\baeldung\reverse\ReverseStringExamples.java
1
请完成以下Java代码
private FactLine createFactLine(final FactLine baseLine, final GLDistributionResultLine glDistributionLine) { final BigDecimal amount = glDistributionLine.getAmount(); if (amount.signum() == 0) { return null; } final AccountDimension accountDimension = glDistributionLine.getAccountDimension(); final MA...
switch (glDistributionLine.getAmountSign()) { case CREDIT: factLine.setAmtSource(null, amount); break; case DEBIT: factLine.setAmtSource(amount, null); break; case DETECT: if (amount.signum() < 0) { factLine.setAmtSource(null, amount.negate()); } else { factLin...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\FactGLDistributor.java
1
请完成以下Java代码
public static void main(String[] args) throws Exception { int port = args.length > 0 ? Integer.parseInt(args[0]) : 8080; new HttpServer(port).run(); } public void run() throws Exception { EventLoopGroup bossGroup = new NioEventLoopGroup(1); EventLoopGroup workerGroup = new Nio...
ChannelPipeline p = ch.pipeline(); p.addLast(new HttpRequestDecoder()); p.addLast(new HttpResponseEncoder()); p.addLast(new CustomHttpServerHandler()); } }); ChannelFuture f = b.bind(port) ...
repos\tutorials-master\server-modules\netty\src\main\java\com\baeldung\http\server\HttpServer.java
1
请完成以下Java代码
LocalDate getLocalDateFromClock() { LocalDate localDate = LocalDate.now(); return localDate; } LocalDate getNextDay(LocalDate localDate) { return localDate.plusDays(1); } LocalDate getPreviousDay(LocalDate localDate) { return localDate.minus(1, ChronoUnit.DAYS); } ...
return startofDay; } LocalDateTime getStartOfDayAtMinTime(LocalDate localDate) { LocalDateTime startofDay = localDate.atTime(LocalTime.MIN); return startofDay; } LocalDateTime getStartOfDayAtMidnightTime(LocalDate localDate) { LocalDateTime startofDay = localDate.atTime(LocalTi...
repos\tutorials-master\core-java-modules\core-java-8-datetime\src\main\java\com\baeldung\datetime\UseLocalDate.java
1
请在Spring Boot框架中完成以下Java代码
public class DefaultTbDomainService extends AbstractTbEntityService implements TbDomainService { private final DomainService domainService; @Override public Domain save(Domain domain, List<OAuth2ClientId> oAuth2Clients, User user) throws Exception { ActionType actionType = domain.getId() == null ?...
try { domainService.updateOauth2Clients(tenantId, domainId, oAuth2ClientIds); logEntityActionService.logEntityAction(tenantId, domainId, domain, actionType, user, oAuth2ClientIds); } catch (Exception e) { logEntityActionService.logEntityAction(tenantId, domainId, domain, acti...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\entitiy\domain\DefaultTbDomainService.java
2
请完成以下Java代码
public final @Nullable String getLoginUrl() { return this.loginUrl; } public final ServiceProperties getServiceProperties() { return this.serviceProperties; } public final void setLoginUrl(String loginUrl) { this.loginUrl = loginUrl; } public final void setServiceProperties(ServiceProperties servicePrope...
this.encodeServiceUrlWithSessionId = encodeServiceUrlWithSessionId; } /** * Sets whether to encode the service url with the session id or not. * @return whether to encode the service url with the session id or not. * */ protected boolean getEncodeServiceUrlWithSessionId() { return this.encodeServiceUrlWit...
repos\spring-security-main\cas\src\main\java\org\springframework\security\cas\web\CasAuthenticationEntryPoint.java
1
请完成以下Java代码
public void setPP_Order_ID (int PP_Order_ID) { if (PP_Order_ID < 1) set_Value (COLUMNNAME_PP_Order_ID, null); else set_Value (COLUMNNAME_PP_Order_ID, Integer.valueOf(PP_Order_ID)); } /** Get Produktionsauftrag. @return Produktionsauftrag */ @Override public int getPP_Order_ID () { Integer ii =...
@return Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein */ @Override public java.lang.String getValue () { return (java.lang.String)get_Value(COLUMNNAME_Value); } /** Set Zahlwert. @param ValueNumber Numeric Value */ @Override public void setValueNumber (java.math.BigD...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_ProductAttribute.java
1
请完成以下Java代码
public class RelationEdgeProcessor extends BaseRelationProcessor implements RelationProcessor { @Override public ListenableFuture<Void> processRelationMsgFromEdge(TenantId tenantId, Edge edge, RelationUpdateMsg relationUpdateMsg) { log.trace("[{}] executing processRelationMsgFromEdge [{}] from edge [{}...
} @Override public DownlinkMsg convertEdgeEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) { EntityRelation entityRelation = JacksonUtil.convertValue(edgeEvent.getBody(), EntityRelation.class); UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction()); RelationUpdateM...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\edge\rpc\processor\relation\RelationEdgeProcessor.java
1
请完成以下Java代码
public double getBestFitness() { return bestFitness; } /* * (non-Javadoc) * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(bestFitness); result = prime * result + (int) (temp ^ (temp >>> 32...
return false; } else if (!fitnessFunction.equals(other.fitnessFunction)) return false; if (random == null) { if (other.random != null) return false; } else if (!random.equals(other.random)) return false; if (!Arrays.equals(swarms, other.swarms)) return false; return true; } /* * (non-Java...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-4\src\main\java\com\baeldung\algorithms\multiswarm\Multiswarm.java
1
请在Spring Boot框架中完成以下Java代码
static PrePostAdviceReactiveMethodInterceptor securityMethodInterceptor(AbstractMethodSecurityMetadataSource source, MethodSecurityExpressionHandler handler) { ExpressionBasedPostInvocationAdvice postAdvice = new ExpressionBasedPostInvocationAdvice(handler); ExpressionBasedPreInvocationAdvice preAdvice = new Exp...
} return handler; } @Override public void setImportMetadata(AnnotationMetadata importMetadata) { this.advisorOrder = (int) importMetadata.getAnnotationAttributes(EnableReactiveMethodSecurity.class.getName()) .get("order"); } @Autowired(required = false) void setGrantedAuthorityDefaults(GrantedAuthorityDe...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\ReactiveMethodSecurityConfiguration.java
2
请完成以下Java代码
protected IScriptFactory createScriptFactory() { return new WorkspaceScriptFactory(); } @Override protected IScriptScanner createScriptScanner(final IScriptScannerFactory IGNORED) { final WorkspaceScriptScanner scanner = WorkspaceScriptScanner.builder() .workspaceDir(config.getWorkspaceDir()) .support...
@Override protected ScriptsApplier createScriptApplier(final IDatabase database) { final ScriptsApplier scriptApplier = super.createScriptApplier(database); scriptApplier.setSkipExecutingAfterScripts(config.isSkipExecutingAfterScripts()); return scriptApplier; } @Override protected IScriptsApplierListener c...
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\workspace_migrate\WorkspaceScriptsApplier.java
1
请完成以下Java代码
public class Pizza { private static String cookedCount; private boolean isThinCrust; // Accessible globally public static class PizzaSalesCounter { private static String orderedCount; public static String deliveredCount; PizzaSalesCounter() { System.out.println("S...
} } Pizza() { System.out.println("Non private static field of static class is " + PizzaSalesCounter.deliveredCount); System.out.println("Private static field of static class is " + PizzaSalesCounter.orderedCount); } public static void main(String[] a) { // C...
repos\tutorials-master\core-java-modules\core-java-lang-oop-modifiers\src\main\java\com\baeldung\staticclass\Pizza.java
1
请完成以下Java代码
public class InvoiceSourceDAO implements IInvoiceSourceDAO { @Override public Timestamp retrieveDueDate(final org.compiere.model.I_C_Invoice invoice) { final String trxName = InterfaceWrapperHelper.getTrxName(invoice); return DB.getSQLValueTSEx(trxName, "SELECT paymentTermDueDate(?,?)", invoice.getC_PaymentTerm_...
final ICompositeQueryFilter<I_C_Dunning_Candidate_Invoice_v1> dunningGraceFilter = queryBL .createCompositeQueryFilter(I_C_Dunning_Candidate_Invoice_v1.class) .setJoinOr() .addEqualsFilter(I_C_Dunning_Candidate_Invoice_v1.COLUMN_DunningGrace, null) .addCompareFilter(I_C_Dunning_Candidate_Invoice_v1.COLU...
repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\invoice\api\impl\InvoiceSourceDAO.java
1
请完成以下Java代码
public void alphanumericRegex(Blackhole blackhole) { final Matcher matcher = PATTERN.matcher(TEST_STRING); boolean result = matcher.matches(); blackhole.consume(result); } @Benchmark @BenchmarkMode(Mode.Throughput) public void alphanumericRegexDirectlyOnString(Blackhole blackhol...
if (!isAlphanumeric(c)) { result = false; break; } } blackhole.consume(result); } @Benchmark @BenchmarkMode(Mode.Throughput) public void alphanumericIterationWithStream(Blackhole blackhole) { boolean result = TEST_STRING.chars().allMat...
repos\tutorials-master\core-java-modules\core-java-regex\src\main\java\com\baeldung\alphanumeric\AlphanumericPerformanceBenchmark.java
1
请完成以下Java代码
public class MovieWithNullValue { private String imdbId; @JsonIgnore private String director; private List<ActorJackson> actors; public MovieWithNullValue(String imdbID, String director, List<ActorJackson> actors) { super(); this.imdbId = imdbID; this.director = director;...
public void setImdbID(String imdbID) { this.imdbId = imdbID; } public String getDirector() { return director; } public void setDirector(String director) { this.director = director; } public List<ActorJackson> getActors() { return actors; } public void ...
repos\tutorials-master\jackson-modules\jackson-core\src\main\java\com\baeldung\jackson\jacksonvsgson\MovieWithNullValue.java
1
请在Spring Boot框架中完成以下Java代码
protected ImmutableSet<ServiceRepairProjectTaskId> getSelectedSparePartsTaskIds(final @NonNull IProcessPreconditionsContext context) { final ImmutableSet<ServiceRepairProjectTaskId> taskIds = getSelectedTaskIds(context); return projectService.retainIdsOfTypeSpareParts(taskIds); } protected ImmutableSet<ServiceR...
.stream() .filter(recordRef -> I_C_Project_Repair_Task.Table_Name.equals(recordRef.getTableName())) .map(recordRef -> ServiceRepairProjectTaskId.ofRepoId(projectId, recordRef.getRecord_ID())) .collect(ImmutableSet.toImmutableSet()); } protected List<ServiceRepairProjectTask> getSelectedTasks(final @NonNu...
repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.webui\src\main\java\de\metas\servicerepair\project\process\ServiceOrRepairProjectBasedProcess.java
2
请完成以下Java代码
public void setDisplayName(String displayName) { this.displayName = displayName; } @Override public String getEmail() { return email; } @Override public void setEmail(String email) { this.email = email; } @Override public String getPassword() { retu...
public boolean isPictureSet() { return pictureByteArrayRef != null && pictureByteArrayRef.getId() != null; } @Override public ByteArrayRef getPictureByteArrayRef() { return pictureByteArrayRef; } @Override public String getTenantId() { return tenantId; } @Overr...
repos\flowable-engine-main\modules\flowable-idm-engine\src\main\java\org\flowable\idm\engine\impl\persistence\entity\UserEntityImpl.java
1
请完成以下Java代码
public void traversePreOrder(Node node) { if (node != null) { visit(node.value); traversePreOrder(node.left); traversePreOrder(node.right); } } public void traversePostOrder(Node node) { if (node != null) { traversePostOrder(node.left); ...
current = stack.pop(); visit(current.value); if (current.right != null) stack.push(current.right); if (current.left != null) stack.push(current.left); } } public void traversePostOrderWithoutRecursion() { Stack<Node> stac...
repos\tutorials-master\data-structures\src\main\java\com\baeldung\tree\BinaryTree.java
1
请完成以下Java代码
public String index() { return "index"; } @GetMapping(path = "/sba-settings.js", produces = "application/javascript") public String sbaSettings() { return "sba-settings.js"; } @GetMapping(path = "/variables.css", produces = "text/css") public String variablesCss() { return "variables.css"; } @GetMappin...
/** * A list of child views. */ private final List<ExternalView> children; public ExternalView(String label, String url, Integer order, boolean iframe, List<ExternalView> children) { Assert.hasText(label, "'label' must not be empty"); if (isEmpty(children)) { Assert.hasText(url, "'url' must not be ...
repos\spring-boot-admin-master\spring-boot-admin-server-ui\src\main\java\de\codecentric\boot\admin\server\ui\web\UiController.java
1
请完成以下Java代码
public void setCurrentSubProcess(SubProcess subProcess) { currentSubprocessStack.push(subProcess); } public SubProcess getCurrentSubProcess() { return currentSubprocessStack.peek(); } public void removeCurrentSubProcess() { currentSubprocessStack.pop(); } public void s...
return currentScopeStack.peek(); } public void removeCurrentScope() { currentScopeStack.pop(); } public BpmnParse setSourceSystemId(String systemId) { sourceSystemId = systemId; return this; } public String getSourceSystemId() { return this.sourceSystemId; ...
repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\BpmnParse.java
1
请完成以下Java代码
public void setOldCostPrice (final BigDecimal OldCostPrice) { set_Value (COLUMNNAME_OldCostPrice, OldCostPrice); } @Override public BigDecimal getOldCostPrice() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_OldCostPrice); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setQ...
} @Override public java.lang.String getRevaluationType() { return get_ValueAsString(COLUMNNAME_RevaluationType); } @Override public void setSeqNo (final int SeqNo) { set_Value (COLUMNNAME_SeqNo, SeqNo); } @Override public int getSeqNo() { return get_ValueAsInt(COLUMNNAME_SeqNo); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_CostRevaluation_Detail.java
1
请完成以下Java代码
public String getRole() { return role; } /** * 设置 角色名称. * * @param role 角色名称. */ public void setRole(String role) { this.role = role; } /** * 获取 角色说明. * * @return 角色说明. */ public String getDescription() { return description; }...
/** * 获取 更新时间. * * @return 更新时间. */ public Date getUpdatedTime() { return updatedTime; } /** * 设置 更新时间. * * @param updatedTime 更新时间. */ public void setUpdatedTime(Date updatedTime) { this.updatedTime = updatedTime; } protected Serializabl...
repos\SpringBootBucket-master\springboot-jwt\src\main\java\com\xncoding\jwt\dao\domain\Role.java
1
请完成以下Java代码
private void markAsSaved() { this.alreadySaved = true; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } ...
return author; } public void setAuthor(String author) { this.author = author; } public boolean isAlreadySaved() { return alreadySaved; } public void setAlreadySaved(boolean alreadySaved) { this.alreadySaved = alreadySaved; } }
repos\tutorials-master\persistence-modules\spring-boot-persistence-5\src\main\java\com\baeldung\returnedvalueofsave\entity\BaeldungArticle.java
1
请完成以下Java代码
public Object getBeanIfExists() { return this.bean; } /** * Sets the given callback used to destroy the managed bean. * * @param destructionCallback The destruction callback to use. */ public void setDestructionCallback(final Runnable destructionC...
public synchronized void destroy() { Runnable callback = this.destructionCallback; if (callback != null) { callback.run(); } this.bean = null; this.destructionCallback = null; } @Override public String toString() { ...
repos\grpc-spring-master\grpc-server-spring-boot-starter\src\main\java\net\devh\boot\grpc\server\scope\GrpcRequestScope.java
1
请在Spring Boot框架中完成以下Java代码
public class TodoController { public TodoController(TodoService todoService) { super(); this.todoService = todoService; } private final TodoService todoService; @RequestMapping("list-todos") public String listAllTodos(ModelMap model) { String username = getLoggedInUsername(model); List<Todo> todos ...
@RequestMapping(value="update-todo", method = RequestMethod.GET) public String showUpdateTodoPage(@RequestParam int id, ModelMap model) { Todo todo = todoService.findById(id); model.addAttribute("todo", todo); return "todo"; } @RequestMapping(value="update-todo", method = RequestMethod.POST) public String up...
repos\master-spring-and-spring-boot-main\11-web-application\src\main\java\com\in28minutes\springboot\myfirstwebapp\todo\TodoController.java
2
请完成以下Java代码
public ObjectNode parseElement(FlowElement flowElement, ObjectNode flowElementNode, ObjectMapper mapper) { ObjectNode resultNode = mapper.createObjectNode(); resultNode.put(ELEMENT_ID, flowElement.getId()); resultNode.put(ELEMENT_TYPE, flowElement.getClass().getSimpleName()); if (support...
for (String value : values) { arrayNode.add(value); } } } protected void putPropertyValue(String key, JsonNode node, ObjectNode propertiesNode) { if (node != null) { if (!node.isMissingNode() && !node.isNull()) { propertiesNode.set(key, no...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\dynamic\BasePropertiesParser.java
1
请完成以下Java代码
private ObjectIdentity mapObjectIdentityRow(ResultSet rs) throws SQLException { String javaType = rs.getString("class"); Serializable identifier = (Serializable) rs.getObject("obj_id"); identifier = this.aclClassIdUtils.identifierFrom(identifier, rs); return this.objectIdentityGenerator.createObjectIdentity(ide...
if (this.findChildrenSql.equals(DEFAULT_SELECT_ACL_WITH_PARENT_SQL)) { this.findChildrenSql = DEFAULT_SELECT_ACL_WITH_PARENT_SQL_WITH_CLASS_ID_TYPE; } else { log.debug("Find children statement has already been overridden, so not overridding the default"); } } } public void setConversionService(Con...
repos\spring-security-main\acl\src\main\java\org\springframework\security\acls\jdbc\JdbcAclService.java
1
请完成以下Java代码
public ClusterFlowConfig getClusterConfig() { return clusterConfig; } public FlowRuleEntity setClusterConfig(ClusterFlowConfig clusterConfig) { this.clusterConfig = clusterConfig; return this; } @Override public Date getGmtCreate() { return gmtCreate; } pub...
FlowRule flowRule = new FlowRule(); flowRule.setCount(this.count); flowRule.setGrade(this.grade); flowRule.setResource(this.resource); flowRule.setLimitApp(this.limitApp); flowRule.setRefResource(this.refResource); flowRule.setStrategy(this.strategy); if (this.con...
repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\rule\FlowRuleEntity.java
1
请在Spring Boot框架中完成以下Java代码
public class CompositeSaveHandlers { @NonNull private final ImmutableMap<String, SaveHandler> byTableName; @NonNull private final DefaultSaveHandler defaultHandler; CompositeSaveHandlers(@NonNull final Optional<List<SaveHandler>> optionalHandlers) { this.defaultHandler = new DefaultSaveHandler(); this.byTableN...
}); return builder.build(); } private SaveHandler getHandler(@NonNull final String tableName) {return byTableName.getOrDefault(tableName, defaultHandler);} public boolean isReadonly(@NonNull final GridTabVO gridTabVO) { final String tableName = gridTabVO.getTableName(); return getHandler(tableName).isReadon...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\sql\save\CompositeSaveHandlers.java
2
请完成以下Java代码
private static Instant convertClientSecretExpiresAt(Object clientSecretExpiresAt) { if (clientSecretExpiresAt != null && String.valueOf(clientSecretExpiresAt).equals("0")) { // 0 indicates that client_secret_expires_at does not expire return null; } return (Instant) INSTANT_CONVERTER.convert(clientSecr...
if (source.getClientIdIssuedAt() != null) { responseClaims.put(OAuth2ClientMetadataClaimNames.CLIENT_ID_ISSUED_AT, source.getClientIdIssuedAt().getEpochSecond()); } if (source.getClientSecret() != null) { long clientSecretExpiresAt = 0; if (source.getClientSecretExpiresAt() != null) { clien...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\http\converter\OAuth2ClientRegistrationHttpMessageConverter.java
1
请完成以下Java代码
public void actionPerformed(ActionEvent e) { final FavoriteItem item = component2item.get(e.getSource()); if(item == null) { return; } container.fireItemClicked(item); } }; public FavoritesGroup(final FavoritesGroupContainer container, final MTreeNode ndTop) { super(); Check.assumeNotNul...
{ toolbar.removeAll(); } public void addFavorite(final MTreeNode node) { if (node2item.get(node) != null) { // already added return; } final FavoriteItem item = new FavoriteItem(this, node); item.addMouseListener(itemMouseListener); item.addActionListener(itemActionListener); final JComponen...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\tree\FavoritesGroup.java
1
请完成以下Java代码
default boolean isAnyComponentIssueOrCoProduct(final I_PP_Cost_Collector cc) { final CostCollectorType costCollectorType = CostCollectorType.ofCode(cc.getCostCollectorType()); final PPOrderBOMLineId orderBOMLineId = PPOrderBOMLineId.ofRepoIdOrNull(cc.getPP_Order_BOMLine_ID()); return costCollectorType.isAnyCompo...
/** * Checks if given cost collector is a reversal. * * We consider given cost collector as a reversal if it's ID is bigger then the Reversal_ID. * * @param cc cost collector * @return true if given cost collector is actually a reversal. */ boolean isReversal(I_PP_Cost_Collector cc); boolean isFloorSto...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\IPPCostCollectorBL.java
1
请完成以下Java代码
public Set<CtxName> getParameters() { return parametersAsCtxName; } @Override public String evaluate(final Evaluatee ctx, final OnVariableNotFound onVariableNotFound) throws ExpressionEvaluationException { try { return StringExpressionsHelper.evaluateParam(parameter, ctx, onVariableNotFound); } catch...
{ try { final String value = StringExpressionsHelper.evaluateParam(parameter, ctx, OnVariableNotFound.ReturnNoResult); if (value == null || value == EMPTY_RESULT) { return this; } return ConstantStringExpression.of(value); } catch (final Exception e) { throw ExpressionEvaluationExceptio...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\SingleParameterStringExpression.java
1
请完成以下Java代码
public class ZxingBarcodeGenerator { public static BufferedImage generateUPCABarcodeImage(String barcodeText) throws Exception { UPCAWriter barcodeWriter = new UPCAWriter(); BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.UPC_A, 300, 150); return MatrixToImageWriter.t...
} public static BufferedImage generatePDF417BarcodeImage(String barcodeText) throws Exception { PDF417Writer barcodeWriter = new PDF417Writer(); BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.PDF_417, 700, 700); return MatrixToImageWriter.toBufferedImage(bitMatrix); ...
repos\tutorials-master\spring-boot-modules\spring-boot-libraries\src\main\java\com\baeldung\barcodes\generators\ZxingBarcodeGenerator.java
1
请完成以下Java代码
public String getType() { return type; } @Override public void setType(String type) { this.type = type; } @Override public String getImplementation() { return implementation; } @Override public void setImplementation(String implementation) { this.im...
@Override public String getResourceName() { return resourceName; } @Override public void setResourceName(String resourceName) { this.resourceName = resourceName; } @Override public String getTenantId() { return tenantId; } @Override public void setTenan...
repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\persistence\entity\ChannelDefinitionEntityImpl.java
1
请完成以下Java代码
public class SecurityUser implements UserDetails { private String userName; private String password; private List<GrantedAuthority> grantedAuthorityList; private boolean accessToRestrictedPolicy; public static SecurityUser builder() { return new SecurityUser(); } public SecurityUse...
public SecurityUser withUserName(String userName) { this.userName = userName; return this; } @Override public String getUsername() { return this.userName; } @Override public boolean isAccountNonExpired() { return false; } @Override public boolean is...
repos\tutorials-master\spring-security-modules\spring-security-web-boot-4\src\main\java\com\baeldung\enablemethodsecurity\user\SecurityUser.java
1
请完成以下Java代码
default String getWebsite() { return this.getClaimAsString(StandardClaimNames.WEBSITE); } /** * Returns the user's preferred e-mail address {@code (email)}. * @return the user's preferred e-mail address */ default String getEmail() { return this.getClaimAsString(StandardClaimNames.EMAIL); } /** * Ret...
* Returns {@code true} if the user's phone number has been verified * {@code (phone_number_verified)}, otherwise {@code false}. * @return {@code true} if the user's phone number has been verified, otherwise * {@code false} */ default Boolean getPhoneNumberVerified() { return this.getClaimAsBoolean(StandardCl...
repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\oidc\StandardClaimAccessor.java
1
请在Spring Boot框架中完成以下Java代码
private Object mkParamValueObj(final String valueStr, final int displayType) { final Object result; if (displayType == DisplayType.String) { result = valueStr; } else if (displayType == DisplayType.Integer) { result = Integer.parseInt(valueStr); } else if (displayType == DisplayType.Number) { ...
else if (displayType == DisplayType.Integer) { result = Integer.toString((Integer)valueObj); } else if (displayType == DisplayType.Number) { result = ((BigDecimal)valueObj).toString(); } else if (displayType == DisplayType.YesNo) { result = ((Boolean)valueObj) ? "Y" : "N"; } else { throw...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\service\impl\ParameterBL.java
2
请完成以下Java代码
public int getEventId() { return eventId; } public void setEventId(int eventId) { this.eventId = eventId; } public String getEventName() { return eventName; } public void setEventName(String eventName) { this.eventName = eventName; } public String getC...
this.eventType = eventType; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getDeviceId() { return deviceId; } public void setDeviceId(String deviceId) { this.deviceId = device...
repos\tutorials-master\netflix-modules\hollow\src\main\java\com\baeldung\hollow\model\MonitoringEvent.java
1
请完成以下Java代码
public class JsonConverterV1 { public static final GlobalQRCodeVersion GLOBAL_QRCODE_VERSION = GlobalQRCodeVersion.ofInt(1); public static GlobalQRCode toGlobalQRCode(@NonNull final LocatorQRCode qrCode) { return GlobalQRCode.of(LocatorQRCodeJsonConverter.GLOBAL_QRCODE_TYPE, GLOBAL_QRCODE_VERSION, toJson(qrCode))...
public static LocatorQRCode fromGlobalQRCode(@NonNull final GlobalQRCode globalQRCode) { Check.assumeEquals(globalQRCode.getVersion(), GLOBAL_QRCODE_VERSION, "QR Code version"); final JsonLocatorQRCodePayloadV1 payload = globalQRCode.getPayloadAs(JsonLocatorQRCodePayloadV1.class); return fromJson(payload); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\qrcode\v1\JsonConverterV1.java
1
请完成以下Java代码
public static PPOrderLineType cast(final IViewRowType type) { return (PPOrderLineType)type; } public boolean canReceive() { return canReceive; } public boolean canIssue() { return canIssue; } public boolean isBOMLine() { return this == BOMLine_Component || this == BOMLine_Component_Service ...
} public boolean isHUOrHUStorage() { return this == HU_LU || this == HU_TU || this == HU_VHU || this == HU_Storage; } public static PPOrderLineType ofHUEditorRowType(final HUEditorRowType huType) { final PPOrderLineType type = huType2type.get(huType); if (type == null) { throw new Illeg...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pporder\PPOrderLineType.java
1
请完成以下Java代码
public class ProcessUtils { public static String getClassPath() { String cp = System.getProperty("java.class.path"); // System.out.println("ClassPath is " + cp); return cp; } public static File getJavaCmd() throws IOException { String javaHome = System.getProperty("java.hom...
} else { throw new UnsupportedOperationException(javaCmd.getCanonicalPath() + " is not executable"); } } public static String getMainClass() { return System.getProperty("sun.java.command"); } public static String getSystemProperties() { StringBuilder sb = new String...
repos\tutorials-master\core-java-modules\core-java-os-2\src\main\java\com\baeldung\java9\process\ProcessUtils.java
1
请在Spring Boot框架中完成以下Java代码
public long setSize(String key) { return setOperations.size(key); } public long setRemove(String key, Object... values) { return setOperations.remove(key, values); } //===============================list================================= public List<Object> lGet(String key, long st...
public long listRightPushAll(String key, List<Object> value) { return listOperations.rightPushAll(key, value); } public boolean listRightPushAll(String key, List<Object> value, long milliseconds) { listOperations.rightPushAll(key, value); if (milliseconds > 0) { return expir...
repos\spring-boot-best-practice-master\spring-boot-redis\src\main\java\cn\javastack\springboot\redis\service\RedisOptService.java
2
请完成以下Java代码
public String getProcessDefinitionKey() { return processDefinitionKey; } public String getProcessDefinitionParentDeploymentId() { return processDefinitionParentDeploymentId; } public String getMessageName() { return messageName; } public String getStartEventId() { ...
public String getOwnerId() { return ownerId; } public String getAssigneeId() { return assigneeId; } public Map<String, Object> getVariables() { return variables; } public Map<String, Object> getTransientVariables() { return transientVariables; } public...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\runtime\ProcessInstanceBuilderImpl.java
1
请完成以下Java代码
public NamePair get (final IValidationContext evalCtx, Object value) { if (value == null) return null; MLocation loc = getLocation (value, null); if (loc == null) return null; return new KeyNamePair (loc.getC_Location_ID(), loc.toString()); } // get /** * The Lookup contains the key * @param ke...
public String getTableName() { return I_C_Location.Table_Name; } @Override public String getColumnName() { return I_C_Location.Table_Name + "." + I_C_Location.COLUMNNAME_C_Location_ID; } // getColumnName @Override public String getColumnNameNotFQ() { return I_C_Location.COLUMNNAME_C_Location_ID; } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MLocationLookup.java
1
请完成以下Java代码
public int getM_ProductMember_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_ProductMember_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); }
/** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_B_TopicType.java
1
请完成以下Java代码
public String getSourceState() { return sourceState; } public void setSourceState(String sourceState) { this.sourceState = sourceState; } public String getTargetState() { return targetState; } public void setTargetState(String targetState) { this.targetState = ...
this.scriptInfo = scriptInfo; } public Object getInstance() { return instance; } public void setInstance(Object instance) { this.instance = instance; } @Override public FlowableListener clone() { FlowableListener clone = new FlowableListener(); clone.setVal...
repos\flowable-engine-main\modules\flowable-cmmn-model\src\main\java\org\flowable\cmmn\model\FlowableListener.java
1
请完成以下Java代码
public void requestHeadersStart(Call call) { logTimedEvent("requestHeadersStart"); } @Override public void requestHeadersEnd(Call call, Request request) { logTimedEvent("requestHeadersEnd"); } @Override public void requestBodyStart(Call call) { logTimedEvent("requestBod...
logTimedEvent("responseBodyEnd"); } @Override public void responseFailed(Call call, IOException ioe) { logTimedEvent("responseFailed"); } @Override public void callEnd(Call call) { logTimedEvent("callEnd"); } @Override public void callFailed(Call call, IOException ...
repos\tutorials-master\libraries-http-2\src\main\java\com\baeldung\okhttp\events\EventTimer.java
1
请完成以下Java代码
public static Date getThisWeekStartDay() { Date today = new Date(); return DateUtil.beginOfWeek(today); } /** * 获得本周最后一天 周日 23:59:59 */ public static Date getThisWeekEndDay() { Date today = new Date(); return DateUtil.endOfWeek(today); } /** * 获得下周第一天...
/** * 昨天结束时间 * * @return */ public static Date getYesterdayEndTime() { return DateUtil.endOfDay(getYesterdayStartTime()); } /** * 明天开始时间 * * @return */ public static Date getTomorrowStartTime() { return DateUtil.beginOfDay(DateUtil.tomorrow()); ...
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\DateRangeUtils.java
1
请在Spring Boot框架中完成以下Java代码
private class MsgPackCallback implements TbQueueCallback { private final AtomicInteger msgCount; private final TransportServiceCallback<Void> callback; public MsgPackCallback(Integer msgCount, TransportServiceCallback<Void> callback) { this.msgCount = new AtomicInteger(msgCount); ...
} finally { callback.onSuccess(msg); } } @Override public void onError(Throwable e) { callback.onError(e); } } @Override public ExecutorService getCallbackExecutor() { return transportCallbackExecutor; } @Override ...
repos\thingsboard-master\common\transport\transport-api\src\main\java\org\thingsboard\server\common\transport\service\DefaultTransportService.java
2
请完成以下Java代码
public static void printLogNodes(List<ObjectNode> logNodes, String logLevel) { if (logNodes == null) { return; } StringBuilder logBuilder = new StringBuilder("\n"); for (ObjectNode logNode : logNodes) { logBuilder.append(logNode.get(LoggingSessionUtil.TIM...
logBuilder.append("', elementType: '").append(logNode.get("elementType").asString()).append("'"); } logBuilder.append(")\n"); } log(logBuilder.toString(), logLevel); } protected static void log(String message, String logLevel) { if ("inf...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\logging\LoggingSessionLoggerOutput.java
1
请完成以下Java代码
private static boolean declaresToBuilder(Authentication authentication) { for (Method method : authentication.getClass().getDeclaredMethods()) { if (method.getName().equals("toBuilder") && method.getParameterTypes().length == 0) { return true; } } return false; } @Override protected String getAlread...
private void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authentication) throws IOException, ServletException { SecurityContext context = this.securityContextHolderStrategy.createEmptyContext(); context.setAuthentication(authentication); ...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\AuthenticationFilter.java
1
请完成以下Java代码
public class ProprietaryReference1 { @XmlElement(name = "Tp", required = true) protected String tp; @XmlElement(name = "Ref", required = true) protected String ref; /** * Gets the value of the tp property. * * @return * possible object is * {@link String } * ...
public String getRef() { return ref; } /** * Sets the value of the ref property. * * @param value * allowed object is * {@link String } * */ public void setRef(String value) { this.ref = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\ProprietaryReference1.java
1
请完成以下Java代码
private CellValue getValueAt(final int row, final int col) { final GridField f = m_tab.getField(col); final Object key = m_tab.getValue(row, f.getColumnName()); Object value = key; Lookup lookup = f.getLookup(); if (lookup != null) { // nothing to do } else if (f.getDisplayType() == DisplayType.Butt...
return false; } private final HashMap<String, MLookup> m_buttonLookups = new HashMap<>(); private MLookup getButtonLookup(final GridField mField) { MLookup lookup = m_buttonLookups.get(mField.getColumnName()); if (lookup != null) { return lookup; } // TODO: refactor with org.compiere.grid.ed.VButton...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\impexp\spreadsheet\excel\GridTabExcelExporter.java
1
请完成以下Java代码
public String validate() { return ""; } // validate /** * Check whether all Elements exist * @return true if updated */ protected boolean checkElements () { X_CM_Template thisTemplate = new X_CM_Template(getCtx(), this.getCM_Template_ID(), get_TrxName()); StringBuffer thisElementList = new StringBuffe...
protected boolean checkTemplateTable () { int [] tableKeys = X_CM_TemplateTable.getAllIDs("CM_TemplateTable", "CM_Template_ID=" + this.getCM_Template_ID(), get_TrxName()); if (tableKeys!=null) { for (int i=0;i<tableKeys.length;i++) { X_CM_TemplateTable thisTemplateTable = new X_CM_TemplateTable(getCtx(), tab...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MCStage.java
1
请完成以下Spring Boot application配置
server.port=${port:8080} management.endpoint.health.group.custom.include=diskSpace,ping management.endpoint.health.group.custom.show-components=always management.endpoint.health.group.custom.show-details=always management.endpoint.health.group.custom.status.http-mapping.up=207 management.endpoints.web.exposure.includ...
classpath:ssl/baeldung.p12 spring.ssl.bundle.jks.server.keystore.password=password spring.ssl.bundle.jks.server.keystore.type=PKCS12 server.ssl.bundle=server server.ssl.enabled=false
repos\tutorials-master\spring-boot-modules\spring-boot-core\src\main\resources\application.properties
2
请完成以下Java代码
public JSONResetPassword getResetPasswordInfo(@PathVariable("token") final String token) { return resetPasswordInitByToken(token); } @PostMapping("/resetPassword/{token}/init") public JSONResetPassword resetPasswordInitByToken(@PathVariable("token") final String token) { userSession.assertNotLoggedIn(); fi...
final WebuiImageId avatarId = WebuiImageId.ofRepoIdOrNull(user.getAvatar_ID()); if (avatarId == null) { return imageService.getEmptyImage(); } return imageService.getWebuiImage(avatarId, maxWidth, maxHeight) .toResponseEntity(); } @PostMapping("/resetPassword/{token}") public JSONLoginAuthResponse r...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\login\LoginRestController.java
1
请完成以下Java代码
public class CountingSort { public static int[] sort(int[] input, int k) { verifyPreconditions(input, k); if (input.length == 0) return input; int[] c = countElements(input, k); int[] sorted = new int[input.length]; for (int i = input.length - 1; i >= 0; i--) { ...
} for (int i = 1; i < c.length; i++) { c[i] += c[i - 1]; } return c; } private static void verifyPreconditions(int[] input, int k) { if (input == null) { throw new IllegalArgumentException("Input is required"); } int min = IntStream.of(i...
repos\tutorials-master\algorithms-modules\algorithms-sorting-2\src\main\java\com\baeldung\algorithms\counting\CountingSort.java
1
请在Spring Boot框架中完成以下Java代码
public List<RestVariable> getVariables() { return variables; } public void setVariables(List<RestVariable> variables) { this.variables = variables; } @JsonIgnore public boolean isCustomTenantSet() { return tenantId != null && !StringUtils.isEmpty(tenantId); } @ApiM...
public void setSignalName(String signalName) { this.signalName = signalName; } public void setAsync(boolean async) { this.async = async; } @ApiModelProperty(value = "If true, handling of the signal will happen asynchronously. Return code will be 202 - Accepted to indicate the request i...
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\process\SignalEventReceivedRequest.java
2
请完成以下Java代码
public Boolean isYldd() { return yldd; } /** * Sets the value of the yldd property. * * @param value * allowed object is * {@link Boolean } * */ public void setYldd(Boolean value) { this.yldd = value; } /** * Gets the value of t...
* */ public PriceValueType1Code getValTp() { return valTp; } /** * Sets the value of the valTp property. * * @param value * allowed object is * {@link PriceValueType1Code } * */ public void setValTp(PriceValueType1Code value) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\YieldedOrValueType1Choice.java
1
请完成以下Java代码
public class BatchSetVariablesHandler extends AbstractBatchJobHandler<BatchConfiguration> { public static final BatchJobDeclaration JOB_DECLARATION = new BatchJobDeclaration(Batch.TYPE_SET_VARIABLES); @Override public void executeHandler(BatchConfiguration batchConfiguration, ...
@Override public String getType() { return Batch.TYPE_SET_VARIABLES; } @Override protected void postProcessJob(BatchConfiguration configuration, JobEntity job, BatchConfiguration jobConfiguration) { // if there is only one process instance to adjust, set its ID to the job so exclusive scheduling is pos...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\variables\BatchSetVariablesHandler.java
1
请完成以下Java代码
public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Country...
} @Override public int hashCode() { return Objects.hash(id, name); } @Override public String toString() { return "Country{" + "id=" + id + ", name='" + name + '\'' + '}'; } }
repos\tutorials-master\persistence-modules\spring-boot-persistence-h2\src\main\java\com\baeldung\h2db\springboot\models\Country.java
1
请完成以下Java代码
public Integer visitAssign(LabeledExprParser.AssignContext ctx) { String id = ctx.ID().getText(); // id is left-hand side of '=' int value = visit(ctx.expr()); // compute value of expression on right memory.put(id, value); // store it in our memory return value; } /** ...
@Override public Integer visitInt(LabeledExprParser.IntContext ctx) { return Integer.valueOf(ctx.INT().getText()); } /** expr : ID */ @Override public Integer visitId(LabeledExprParser.IdContext ctx) { String id = ctx.ID().getText(); if (memory.containsKey(id)) return memory...
repos\springboot-demo-master\ANTLR\src\main\java\com\et\antlr\EvalVisitor.java
1
请在Spring Boot框架中完成以下Java代码
public abstract class BarHibernateDAO { @Autowired private SessionFactory sessionFactory; public TestEntity findEntity(int id) { return getCurrentSession().find(TestEntity.class, 1); } public void createEntity(TestEntity entity) { getCurrentSession().save(entity); } pub...
TestEntity entity = findEntity(id); entity.setDescription(newDescription); getCurrentSession().save(entity); } public void deleteEntity(int id) { TestEntity entity = findEntity(id); getCurrentSession().delete(entity); } protected Session getCurrentSession() { r...
repos\tutorials-master\persistence-modules\spring-hibernate-6\src\main\java\com\baeldung\hibernate\bootstrap\BarHibernateDAO.java
2
请完成以下Java代码
public Object getParameterDefaultValue(final IProcessDefaultParameter parameter) { final String parameterName = parameter.getColumnName(); if (PARAM_M_LocatorTo_ID.equals(parameterName)) { final IViewRow row = getSingleSelectedRow(); return row.getFieldValueAsInt(I_DD_OrderLine.COLUMNNAME_M_LocatorTo_ID, -...
.toDDOrderLine(ddOrderLine) .failIfCannotAllocate() .allocateHUAndPrepareGeneratingMovements(hu) .locatorToIdOverride(p_M_LocatorTo_ID > 0 ? warehouseBL.getLocatorIdByRepoId(p_M_LocatorTo_ID) : null) .generateDirectMovements(); return MSG_OK; } @Override protected void postProcess(final boolean s...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\ddorder\process\WEBUI_DD_OrderLine_MoveHU.java
1
请完成以下Java代码
public <X> JacksonJsonSerde<X> copyWithType(JavaType newTargetType) { return new JacksonJsonSerde<>(this.jsonSerializer.copyWithType(newTargetType), this.jsonDeserializer.copyWithType(newTargetType)); } // Fluent API /** * Designate this Serde for serializing/deserializing keys (default is values). * @re...
* Ignore type information headers and use the configured target class. * @return the serde. */ public JacksonJsonSerde<T> ignoreTypeHeaders() { this.jsonDeserializer.ignoreTypeHeaders(); return this; } /** * Use the supplied {@link JacksonJavaTypeMapper}. * @param mapper the mapper. * @return the serd...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\serializer\JacksonJsonSerde.java
1
请完成以下Java代码
public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return Boolean.TRUE.equal...
@InstanceName @DependsOnProperties({"firstName", "lastName", "username"}) public String getDisplayName() { return String.format("%s %s [%s]", (firstName != null ? firstName : ""), (lastName != null ? lastName : ""), username).trim(); } @Override public String getTimeZoneId()...
repos\tutorials-master\spring-boot-modules\jmix\src\main\java\com\baeldung\jmix\expensetracker\entity\User.java
1
请完成以下Java代码
public Incident handleIncident(IncidentContext context, String message) { return createIncident(context, message); } public Incident createIncident(IncidentContext context, String message) { IncidentEntity newIncident = IncidentEntity.createAndInsertIncident(type, context, message); if(context.getExec...
} protected void removeIncident(IncidentContext context, boolean incidentResolved) { List<Incident> incidents = Context .getCommandContext() .getIncidentManager() .findIncidentByConfiguration(context.getConfiguration()); for (Incident currentIncident : incidents) { IncidentEnti...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\incident\DefaultIncidentHandler.java
1
请完成以下Java代码
public void notifySegmentChanged(@NonNull final IShipmentScheduleSegment segment) { notifySegmentsChanged(ImmutableSet.of(segment)); } @Override public void notifySegmentsChanged(@NonNull final Collection<IShipmentScheduleSegment> segments) { if (segments.isEmpty()) { return; } final ImmutableList<I...
this.getClass().getSimpleName()); } } private Stream<IShipmentScheduleSegment> explodeByPickingBOMs(final IShipmentScheduleSegment segment) { if (segment.isAnyProduct()) { return Stream.of(segment); } final PickingBOMsReversedIndex pickingBOMsReversedIndex = pickingBOMService.getPickingBOMsReversedInd...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\invalidation\impl\ShipmentScheduleInvalidateBL.java
1
请完成以下Java代码
protected boolean onLoginSuccess( AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception { ShiroUser user = (ShiroUser) subject.getPrincipal(); user.setToken(subject.getSession().getId().toString()); ...
* @param response * @param entity * @return */ private boolean responseDirectly(HttpServletResponse response, ResponseEntity entity) { response.reset(); response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE); //设置跨域信息。 response.setHeader("Access-Control-Allow-...
repos\springBoot-master\springboot-shiro2\src\main\java\cn\abel\rest\shiro\filter\ShiroFormAuthenticationFilter.java
1
请在Spring Boot框架中完成以下Java代码
private void packRemainingQtyToDestination() { if (!hasPackToDestination()) { return; } if (!isQtyToPackEnforced()) { return; } final Quantity qtyToPack = getQtyToPackRemaining(); if (qtyToPack.signum() <= 0) { return; } packItem( qtyToPack, part -> DeliveryRule.FORCE.equals(p...
// Make sure result is completed // NOTE: this shall not happen because "forceQtyAllocation" is set to true if (!result.isCompleted()) { final String errmsg = MessageFormat.format(ERR_CANNOT_FULLY_LOAD, destination); throw new AdempiereException(errmsg); } } private IAllocationSource createAllocationSo...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\picking\service\impl\HU2PackingItemsAllocator.java
2
请完成以下Java代码
public class TaskCandidateGroupAddedListenerDelegate implements ActivitiEventListener { private final List<TaskRuntimeEventListener<TaskCandidateGroupAddedEvent>> listeners; private final ToAPITaskCandidateGroupAddedEventConverter converter; public TaskCandidateGroupAddedListenerDelegate( List<Ta...
if (event instanceof ActivitiEntityEvent) { converter .from((ActivitiEntityEvent) event) .ifPresent(convertedEvent -> { for (TaskRuntimeEventListener<TaskCandidateGroupAddedEvent> listener : listeners) { listener.onEvent(convertedEv...
repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-task-runtime-impl\src\main\java\org\activiti\runtime\api\event\internal\TaskCandidateGroupAddedListenerDelegate.java
1
请在Spring Boot框架中完成以下Java代码
public class UserController { private final IUserService userService; @Autowired public UserController(IUserService userService) { this.userService = userService; } @PostMapping("/user") public Dict save(@RequestBody User user) { Boolean save = userService.save(user); r...
@PutMapping("/user/{id}") public Dict update(@RequestBody User user, @PathVariable Long id) { Boolean update = userService.update(user, id); return Dict.create().set("code", update ? 200 : 500).set("msg", update ? "成功" : "失败").set("data", update ? user : null); } @GetMapping("/user/{id}") ...
repos\spring-boot-demo-master\demo-orm-jdbctemplate\src\main\java\com\xkcoding\orm\jdbctemplate\controller\UserController.java
2