instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
private CustomerTradeMargin toCustomerTradeMargin(@NonNull final I_C_Customer_Trade_Margin record) { final CustomerTradeMarginId customerTradeMarginId = CustomerTradeMarginId.ofRepoId(record.getC_Customer_Trade_Margin_ID()); return CustomerTradeMargin.builder() .customerTradeMarginId(customerTradeMarginId) ...
} @NonNull private CustomerTradeMarginLine toCustomerTradeMarginLine(@NonNull final I_C_Customer_Trade_Margin_Line record) { final CustomerTradeMarginId customerTradeMarginId = CustomerTradeMarginId.ofRepoId(record.getC_Customer_Trade_Margin_ID()); return CustomerTradeMarginLine.builder() .customerTradeMar...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\pricing\trade_margin\CustomerTradeMarginRepository.java
1
请在Spring Boot框架中完成以下Java代码
public class UserService { private Logger log = LoggerFactory.getLogger(this.getClass()); @Autowired private RestTemplate restTemplate; @HystrixCollapser(batchMethod = "findUserBatch", collapserProperties = { @HystrixProperty(name = "timerDelayInMilliseconds", value = "100") }) pu...
user.setPassword("123456"); return user; } public User getUserDefault2(Long id, Throwable e) { System.out.println(e.getMessage()); User user = new User(); user.setId(-2L); user.setUsername("defaultUser2"); user.setPassword("123456"); return user; } ...
repos\SpringAll-master\30.Spring-Cloud-Hystrix-Circuit-Breaker\Ribbon-Consumer\src\main\java\com\example\demo\Service\UserService.java
2
请在Spring Boot框架中完成以下Java代码
public void execute() { trxManager.runInThreadInheritedTrx(this::reopenPickingJob); } private void reopenPickingJob() { if (!jobToReopen.getDocStatus().isCompleted()) { return; } final PickingJob reopenedJob = jobToReopen .withDocStatus(PickingJobDocStatus.Drafted) .withLockedBy(null); pic...
line.getSteps().forEach(this::reactivateStepIfNeeded); } private void reactivateStepIfNeeded(@NonNull final PickingJobStep step) { final IMutableHUContext huContext = huService.createMutableHUContextForProcessing(); step.getPickFroms().getKeys() .stream() .map(key -> step.getPickFroms().getPickFrom(key...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\PickingJobReopenCommand.java
2
请完成以下Java代码
protected final IQueryBuilder<I_C_Conversion_Rate> retrieveRateQuery( @NonNull final CurrencyConversionContext conversionCtx, @NonNull final CurrencyId currencyFromId, @NonNull final CurrencyId currencyToId) { final CurrencyConversionTypeId conversionTypeId = conversionCtx.getConversionTypeId(); final Ins...
} @Override public @Nullable BigDecimal retrieveRateOrNull( final CurrencyConversionContext conversionCtx, final CurrencyId currencyFromId, final CurrencyId currencyToId) { final List<Map<String, Object>> recordsList = retrieveRateQuery(conversionCtx, currencyFromId, currencyToId) .setLimit(QueryLimi...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\currency\impl\CurrencyDAO.java
1
请完成以下Java代码
private MColumn retrieveColumn(final I_EXP_FormatLine formatLine) { final int adColumnId = formatLine.getAD_Column_ID(); if (adColumnId <= 0) { throw new ExportProcessorException(MSG_EXPColumnMandatory) .setParameter(I_EXP_FormatLine.COLUMNNAME_EXP_FormatLine_ID, formatLine); } final Properties ctx ...
private void createAttachment(@NonNull final CreateAttachmentRequest request) { try { final String documentAsString = writeDocumentToString(outDocument); final byte[] data = documentAsString.getBytes(); final AttachmentEntryService attachmentEntryService = SpringContextHolder.instance.getBean(AttachmentE...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\process\rpl\exp\ExportHelper.java
1
请完成以下Java代码
public int size() { return elements.length; } @Override public boolean isEmpty() { return elements.length == 0; } @Override public boolean contains(Object o) { return false; } @Override public Iterator<T> iterator() { return null; } @Overri...
@Override public boolean addAll(Collection<? extends T> c) { return false; } @Override public boolean removeAll(Collection<?> c) { return false; } @Override public boolean retainAll(Collection<?> c) { return false; } @Override public void clear() { ...
repos\tutorials-master\core-java-modules\core-java-streams-5\src\main\java\com\baeldung\streams\parallelstream\MyBookContainer.java
1
请完成以下Java代码
public I_EXP_ProcessorParameter createParameter(String key, String name, String desc, String help, String value) { final String whereClause = I_EXP_ProcessorParameter.COLUMNNAME_EXP_Processor_ID+"=?" +" AND "+I_EXP_ProcessorParameter.COLUMNNAME_Value+"=?"; I_EXP_ProcessorParameter para = new Query(this.getCtx()...
{ deleteParameters(); // deleteLog(true); return true; } @Override protected boolean afterSave(boolean newRecord, boolean success) { if (!success) return false; if (newRecord || is_ValueChanged(COLUMNNAME_EXP_Processor_Type_ID)) { deleteParameters(); final IExportProcessor proc = getIExportP...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MEXPProcessor.java
1
请完成以下Java代码
public String getModifiedBy() { return modifiedBy; } public void setModifiedBy(final String modifiedBy) { this.modifiedBy = modifiedBy; } public void setOperation(final String operation) { this.operation = operation; } @Override public int hashCode() { fina...
public String toString() { return "Bar [name=" + name + "]"; } @PrePersist public void onPrePersist() { LOGGER.info("@PrePersist"); audit(OPERATION.INSERT); } @PreUpdate public void onPreUpdate() { LOGGER.info("@PreUpdate"); audit(OPERATION.UPDATE); ...
repos\tutorials-master\persistence-modules\spring-data-jpa-query\src\main\java\com\baeldung\persistence\model\Bar.java
1
请完成以下Java代码
public class PaymentTypeInformation19CH { @XmlElement(name = "InstrPrty") @XmlSchemaType(name = "string") protected Priority2Code instrPrty; @XmlElement(name = "SvcLvl") protected ServiceLevel8Choice svcLvl; @XmlElement(name = "LclInstrm") protected LocalInstrument2Choice lclInstrm; @Xm...
* */ public LocalInstrument2Choice getLclInstrm() { return lclInstrm; } /** * Sets the value of the lclInstrm property. * * @param value * allowed object is * {@link LocalInstrument2Choice } * */ public void setLclInstrm(LocalInstrument...
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\PaymentTypeInformation19CH.java
1
请完成以下Spring Boot application配置
spring: application: name: listener-demo # RabbitMQ 相关配置项 rabbitmq: host: localhost port: 5672 username: guest password: g
uest server: port: ${random.int[10000,19999]} # 随机端口,方便启动多个消费者
repos\SpringBoot-Labs-master\labx-18\labx-18-sc-bus-rabbitmq-demo-listener\src\main\resources\application.yml
2
请完成以下Java代码
public String getOperationRef() { return operationRef; } public void setOperationRef(String operationRef) { this.operationRef = operationRef; } public String getExtensionId() { return extensionId; } public void setExtensionId(String extensionId) { this.extensio...
} public void setStoreResultVariableAsTransient(boolean storeResultVariableAsTransient) { this.storeResultVariableAsTransient = storeResultVariableAsTransient; } @Override public ServiceTask clone() { ServiceTask clone = new ServiceTask(); clone.setValues(this); return ...
repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\ServiceTask.java
1
请完成以下Java代码
public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Pet {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" category: ").ap...
return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
repos\tutorials-master\spring-swagger-codegen-modules\spring-openapi-generator-api-client\src\main\java\com\baeldung\petstore\client\model\Pet.java
1
请完成以下Java代码
public void setSuspensionState(int suspensionState) { this.suspensionState = suspensionState; } public String getCategory() { return category; } public boolean isSuspended() { return suspensionState == SuspensionState.SUSPENDED.getStateCode(); } public Map<String, Obje...
} public void setQueryVariables(List<VariableInstanceEntity> queryVariables) { this.queryVariables = queryVariables; } public Date getClaimTime() { return claimTime; } public void setClaimTime(Date claimTime) { this.claimTime = claimTime; } public Integer getAppVe...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\TaskEntityImpl.java
1
请完成以下Java代码
private void addClosingDifference(@NonNull final Money closingDifferenceAmt, @NonNull final UserId cashierId, @Nullable final String description) { add(POSCashJournalLine.builder() .type(POSCashJournalLineType.CASH_CLOSING_DIFFERENCE) .amount(closingDifferenceAmt) .cashierId(cashierId) .description(d...
final UserId cashierId = posOrder.getCashierId(); posOrder.streamPaymentsNotDeleted() .filter(POSPayment::isSuccessful) .forEach(posPayment -> addPayment(posPayment, posOrderId, cashierId)); } private void addPayment(final POSPayment posPayment, POSOrderId posOrderId, UserId cashierId) { add( POSCas...
repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSCashJournal.java
1
请完成以下Java代码
public class ReceiptScheduleValidator extends AbstractModuleInterceptor { public static final ReceiptScheduleValidator instance = new ReceiptScheduleValidator(); private ReceiptScheduleValidator() { } @Override protected void onBeforeInit() { // // 07344: Register RS AggregationKey Dependencies registerR...
final String registrationKey = ReceiptScheduleHeaderAggregationKeyBuilder.REGISTRATION_KEY; // // Register Handlers keyRegistry.registerAggregationKeyValueHandler(registrationKey, new ReceiptScheduleKeyValueHandler()); // // Register ReceiptScheduleHeaderAggregationKeyBuilder keyRegistry.registerDependsOn...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\modelvalidator\ReceiptScheduleValidator.java
1
请完成以下Java代码
public void setValidateWorkflow (final @Nullable java.lang.String ValidateWorkflow) { set_Value (COLUMNNAME_ValidateWorkflow, ValidateWorkflow); } @Override public java.lang.String getValidateWorkflow() { return get_ValueAsString(COLUMNNAME_ValidateWorkflow); } @Override public void setValidFrom (final @...
{ return get_ValueAsInt(COLUMNNAME_WaitingTime); } /** * WorkflowType AD_Reference_ID=328 * Reference name: AD_Workflow Type */ public static final int WORKFLOWTYPE_AD_Reference_ID=328; /** General = G */ public static final String WORKFLOWTYPE_General = "G"; /** Document Process = P */ public static f...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Workflow.java
1
请完成以下Java代码
public class MSLAMeasure extends X_PA_SLA_Measure { /** * */ private static final long serialVersionUID = -2844941499854811255L; /** * Standard Constructor * @param ctx context * @param PA_SLA_Measure_ID id * @param trxName transaction */ public MSLAMeasure (Properties ctx, int PA_SLA_Measure_ID, ...
else setDateTrx (new Timestamp(System.currentTimeMillis())); if (MeasureActual != null) setMeasureActual(MeasureActual); else setMeasureActual (Env.ZERO); if (Description != null) setDescription(Description); } // MSLAMeasure /** * Set Link to Source * @param AD_Table_ID table * @param Reco...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MSLAMeasure.java
1
请在Spring Boot框架中完成以下Java代码
public String getContractNumber() { return contractNumber; } /** * Sets the value of the contractNumber property. * * @param value * allowed object is * {@link String } * */ public void setContractNumber(String value) { this.contractNumber = ...
* <p> * Objects of the following type(s) are allowed in the list * {@link FreeTextType } * * */ public List<FreeTextType> getFreeText() { if (freeText == null) { freeText = new ArrayList<FreeTextType>(); } return this.freeText; } /** * Ref...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\ORDERSExtensionType.java
2
请完成以下Java代码
public class DemoController { @Resource private DemoService demoService; @GetMapping("/monoTest") public Mono<Object> monoTest() { // method one // String data = getOneResult("monoTest()"); // return Mono.just(data); // method two return Mono.create(cityMonoSink...
}); } @GetMapping("/fluxTest") public Flux<Object> fluxTest() { // method one // List<String> list = getMultiResult("fluxTest()"); // return Flux.fromIterable(list); // method two return Flux.fromIterable(demoService.getMultiResult("fluxTest()")); } }
repos\springboot-demo-master\webflux\src\main\java\com\et\webflux\DemoController.java
1
请完成以下Java代码
public Optional<String> getTableIdColumnName(@NonNull final String recordIdColumnName) { return tableAndRecordColumnNames.stream() .filter(tableAndRecordColumnName -> tableAndRecordColumnName.equalsByColumnName(recordIdColumnName)) .map(TableAndColumnName::getTableNameAsString) .findFirst(); } @Value ...
@Nullable public POInfo getByTableIdOrNull(@NonNull final AdTableId tableId) { return byTableId.get(tableId); } @NonNull public POInfo getByTableId(@NonNull final AdTableId tableId) { final POInfo poInfo = getByTableIdOrNull(tableId); if (poInfo == null) { throw new AdempiereException("No P...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\POInfo.java
1
请完成以下Spring Boot application配置
jasypt: encryptor: password: G9w0BAQEFAASCBKYwggSiAgEAAoIBAQC property: prefix: "ENC@[" suffix: "]" javastack: username: ENC@[VA058GV86AaUx4wSoCKekKrDJv6tP4eTwWkoCGHnt6Tb3F7ETJnKAs3QiR
kZFD5k] password: ENC@[7Y7FVXO5qS4lAx3o5B4atyHW8kGUv0o6903xL2ofTOicdcJw71/m+UeFUVfX0VPM]
repos\spring-boot-best-practice-master\spring-boot-jasypt\src\main\resources\application.yml
2
请完成以下Java代码
public void setIsSummary (boolean IsSummary) { set_Value (COLUMNNAME_IsSummary, Boolean.valueOf(IsSummary)); } /** Get Summary Level. @return This is a summary entity */ public boolean isSummary () { Object oo = get_Value(COLUMNNAME_IsSummary); if (oo != null) { if (oo instanceof Boolean) ...
return (String)get_Value(COLUMNNAME_MediaType); } /** 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 (Stri...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Media.java
1
请完成以下Java代码
public void setShipmentAllocation_BestBefore_Policy (final @Nullable java.lang.String ShipmentAllocation_BestBefore_Policy) { set_Value (COLUMNNAME_ShipmentAllocation_BestBefore_Policy, ShipmentAllocation_BestBefore_Policy); } @Override public java.lang.String getShipmentAllocation_BestBefore_Policy() { retu...
@Override public java.lang.String getSinglePriceTag_ID() { return get_ValueAsString(COLUMNNAME_SinglePriceTag_ID); } @Override public void setStatus (final @Nullable java.lang.String Status) { set_Value (COLUMNNAME_Status, Status); } @Override public java.lang.String getStatus() { return get_ValueAs...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\inoutcandidate\model\X_M_ShipmentSchedule.java
1
请在Spring Boot框架中完成以下Java代码
public void setData(T data) { this.data = data; } public static class ResponseParam { private int code; private String msg; private ResponseParam(int code, String msg) { this.code = code; this.msg = msg; } public static ResponseParam b...
} public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } } }
repos\spring-boot-leaning-master\2.x_42_courses\第 2-9 课:Spring Boot 中使用 Swagger2 构建 RESTful APIs\spring-boot-swagger\src\main\java\com\neo\config\BaseResult.java
2
请完成以下Java代码
protected HistoricProcessInstanceEntity findProcessInstanceById(String instanceId, CommandContext commandContext) { return commandContext.getHistoricProcessInstanceManager() .findHistoricProcessInstance(instanceId); } protected void registerTransactionHandler(SetRemovalTimeBatchConfiguration configuratio...
protected SetRemovalTimeBatchConfiguration createJobConfiguration(SetRemovalTimeBatchConfiguration configuration, List<String> processInstanceIds) { return new SetRemovalTimeBatchConfiguration(processInstanceIds) .setRemovalTime(configuration.getRemovalTime()) .setHasRemovalTime(configuration.hasR...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\removaltime\ProcessSetRemovalTimeJobHandler.java
1
请完成以下Java代码
public void iterateWithEnhancedForLoop() { for (String country : countries) { System.out.println(country); } } /** * Iterate over a list using an Iterator */ public void iterateWithIterator() { Iterator<String> countriesIterator = countries.iterator(); ...
while(listIterator.hasNext()) { System.out.println(listIterator.next()); } } /** * Iterate over a list using the Iterable.forEach() method */ public void iterateWithForEach() { countries.forEach(System.out::println); } /** * Iterate over a list using the ...
repos\tutorials-master\core-java-modules\core-java-collections-list\src\main\java\com\baeldung\list\WaysToIterate.java
1
请完成以下Java代码
public class FlowableCmmnEventBuilder { public static FlowableCaseStartedEvent createCaseStartedEvent(CaseInstance caseInstance) { return new FlowableCaseStartedEventImpl(caseInstance); } public static FlowableCaseEndedEvent createCaseEndedEvent(CaseInstance caseInstance, String endingState) { ...
return event; } public static FlowableEntityEvent createTaskAssignedEvent(Task task) { FlowableEntityEventImpl event = new FlowableEntityEventImpl(task, FlowableEngineEventType.TASK_ASSIGNED); event.setScopeId(task.getScopeId()); event.setScopeDefinitionId(task.getScopeDefinitionId());...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\event\FlowableCmmnEventBuilder.java
1
请在Spring Boot框架中完成以下Java代码
private void updateContextAfterError(@NonNull final Exchange exchange) { final ImportOrdersRouteContext importOrdersRouteContext = ImportUtil.getOrCreateImportOrdersRouteContext(exchange); final PurchaseOrderRow csvRow = exchange.getProperty(PROPERTY_CURRENT_CSV_ROW, PurchaseOrderRow.class); final Exception ex...
if (importOrdersRouteContext.isDoNotProcessAtAll()) { final Object fileName = exchange.getIn().getHeader(Exchange.FILE_NAME_ONLY); throw new RuntimeCamelException("No purchase order candidates from file " + fileName.toString() + " can be imported to metasfresh"); } final JsonPurchaseCandidatesRequest.JsonP...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-pcm-file-import\src\main\java\de\metas\camel\externalsystems\pcm\purchaseorder\GetPurchaseOrderFromFileRouteBuilder.java
2
请完成以下Java代码
protected IScriptFactory createScriptFactory() { return new RolloutDirScriptFactory(); } @Override protected void configureScriptExecutorFactory(final IScriptExecutorFactory scriptExecutorFactory) { scriptExecutorFactory.setDryRunMode(config.isJustMarkScriptAsExecuted()); } @Override p...
throw new RuntimeException("Cannot create script scanner from " + file); } logger.info("Additional SQL source: {}", file); scriptScanners.addScriptScanner(scriptScanner); }); return new GloballyOrderedScannerDecorator(scriptScanners); } @Override protected IScriptsApplierListen...
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.cli\src\main\java\de\metas\migration\cli\rollout_migrate\MigrationScriptApplier.java
1
请在Spring Boot框架中完成以下Java代码
class TasksController { @Autowired private TasksService tasksService; @PostMapping @ResponseStatus(HttpStatus.CREATED) public TaskResponse createTask(@RequestBody CreateTaskRequest body) { var task = tasksService.createTask(body.title(), body.createdBy()); return buildResponse(task)...
public void deleteTask(@PathVariable("id") String id) { tasksService.deleteTaskById(id); } @PatchMapping("/{id}") public TaskResponse patchTask(@PathVariable("id") String id, @RequestBody PatchTaskRequest body) { var task = tasksService.updateTask(id, body.status(), body.assignedTo()); ...
repos\tutorials-master\lightrun\lightrun-tasks-service\src\main\java\com\baeldung\tasksservice\adapters\http\TasksController.java
2
请完成以下Java代码
public String getTabId() { return tabId; } @JsonIgnore public DocumentId getRowId() { return rowId; } public final void setDeleted() { deleted = Boolean.TRUE; } @JsonAnyGetter private Map<String, Object> getOtherProperties() { return otherProperties; } @JsonAnySetter private void putOtherProp...
public final void setFields(final Collection<JSONDocumentField> fields) { setFields(fields == null ? null : Maps.uniqueIndex(fields, JSONDocumentField::getField)); } @JsonIgnore protected final void setFields(final Map<String, JSONDocumentField> fieldsByName) { this.fieldsByName = fieldsByName; if (unboxPa...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\json\JSONDocumentBase.java
1
请在Spring Boot框架中完成以下Java代码
public class HibernateSearchConfig { @Autowired private Environment env; @Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); em.set...
return transactionManager; } @Bean public PersistenceExceptionTranslationPostProcessor exceptionTranslation() { return new PersistenceExceptionTranslationPostProcessor(); } Properties additionalProperties() { Properties properties = new Properties(); properties.setProperty(...
repos\tutorials-master\persistence-modules\spring-hibernate-5\src\main\java\com\baeldung\hibernatesearch\HibernateSearchConfig.java
2
请在Spring Boot框架中完成以下Java代码
class ProductService { private final String PRODUCT_ADDED_TO_CART_TOPIC = "product-added-to-cart"; private final ProductRepository repository; private final DiscountService discountService; private final KafkaTemplate<String, ProductAddedToCartEvent> kafkaTemplate; public ProductService(ProductRep...
.switchIfEmpty(Mono.error(() -> new IllegalArgumentException("not found!"))) .flatMap(this::computePrice) .map(price -> new ProductAddedToCartEvent(productId, price.value(), price.currency(), cartId)) .subscribe(event -> kafkaTemplate.send(PRODUCT_ADDED_TO_CART_TOPIC, cartId, event)); ...
repos\tutorials-master\spring-reactive-modules\spring-reactive-performance\src\main\java\com\baeldung\spring\reactive\performance\webflux\ProductService.java
2
请完成以下Java代码
private IUserRolePermissions getUserRolePermissions() { if (userRolePermissions != null) { return userRolePermissions; } return Env.getUserRolePermissions(); } public Builder setAD_Tab(final GridTab gridTab) { this.gridTab = gridTab; return this; } public Builder setMaxQueryRecordsP...
private int getMaxQueryRecordsPerTab() { if (maxQueryRecordsPerTab != null) { return maxQueryRecordsPerTab; } else if (gridTab != null) { return gridTab.getMaxQueryRecords(); } return 0; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\model\GridTabMaxRowsRestrictionChecker.java
1
请完成以下Java代码
private ImmutableList<JsonDataEntryLine> toJsonDataEntryLines( @NonNull final DataEntrySection layoutSection, @NonNull final DataEntryRecord dataEntryRecord) { final ImmutableList.Builder<JsonDataEntryLine> lines = ImmutableList.builder(); for (final DataEntryLine layoutLine : layoutSection.getLines()) { ...
return JsonDataEntryField.builder() .id(layoutField.getId()) .caption(layoutField.getCaption().translate(adLanguage)) .description(layoutField.getDescription().translate(adLanguage)) .type(JsonFieldType.getBy(layoutField.getType())) .mandatory(layoutField.isMandatory()) .listValues(toJsonDataEnt...
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\dataentry\impl\JsonDataEntryFactory.java
1
请在Spring Boot框架中完成以下Java代码
public IBarService barJpaService() { return new BarJpaService(); } @Bean public IBarService barSpringDataJpaService() { return new BarSpringDataJpaService(); } @Bean public IFooService fooHibernateService() { return new FooService(); } @Bean public IBarAudi...
} @Bean public IBarAuditableDao barHibernateAuditableDao() { return new BarAuditableDao(); } @Bean public IFooDao fooHibernateDao() { return new FooDao(); } @Bean public IFooAuditableDao fooHibernateAuditableDao() { return new FooAuditableDao(); } priv...
repos\tutorials-master\persistence-modules\spring-data-jpa-query\src\main\java\com\baeldung\hibernate\audit\PersistenceConfig.java
2
请完成以下Java代码
public class AuthorNameAge { private String name; private int age; public AuthorNameAge(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } ...
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AuthorNameAge other = (Author...
repos\Hibernate-SpringBoot-master\HibernateSpringBootDtoViaClassBasedProjections\src\main\java\com\bookstore\projection\AuthorNameAge.java
1
请完成以下Java代码
public ol removeElement (String hashcode) { removeElementFromRegistry (hashcode); return (this); } /** * The onclick event occurs when the pointing device button is clicked over * an element. This attribute may be used with most elements. * * @param script The script */ public void setOnClick (St...
public void setOnMouseMove (String script) { addAttribute ("onmousemove", script); } /** * The onmouseout event occurs when the pointing device is moved away from * an element. This attribute may be used with most elements. * * @param script The script */ public void setOnMouseOut (String script) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\xhtml\ol.java
1
请完成以下Java代码
public java.lang.String getMsgText () { return (java.lang.String)get_Value(COLUMNNAME_MsgText); } /** Set Verarbeitet. @param Processed Checkbox sagt aus, ob der Beleg verarbeitet wurde. */ @Override public void setProcessed (boolean Processed) { set_Value (COLUMNNAME_Processed, Boolean.valueOf(Pro...
@return Checkbox sagt aus, ob der Beleg verarbeitet wurde. */ @Override public boolean isProcessed () { Object oo = get_Value(COLUMNNAME_Processed); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\event\model\X_AD_EventLog_Entry.java
1
请在Spring Boot框架中完成以下Java代码
public Resilience4JConfigBuilder.Resilience4JCircuitBreakerConfiguration apply(String id) { // 创建 TimeLimiterConfig 对象 TimeLimiterConfig timeLimiterConfig = TimeLimiterConfig.ofDefaults(); // 默认 // 创建 CircuitBreakerConfig 对象 ...
// return factory -> factory.configureDefault( // id -> new Resilience4JConfigBuilder(id) // .timeLimiterConfig(TimeLimiterConfig.custom().timeoutDuration(Duration.ofSeconds(4)).build()) // .circuitBreakerConfig(CircuitBreakerConfig.ofDefaults()) // ...
repos\SpringBoot-Labs-master\labx-24\labx-24-resilience4j-demo02\src\main\java\cn\iocoder\springcloud\labx24\resilience4jdemo\config\Resilience4jConfig.java
2
请完成以下Spring Boot application配置
langchain: api: # "demo" is a free API key for testing purposes only. Please replace it with your own API key. key: demo # key: OPEN_API_
KEY # API call to complete before it is timed out. timeout: 30
repos\springboot-demo-master\rag\src\main\resources\application.yml
2
请在Spring Boot框架中完成以下Java代码
public class AD_Archive { private final PrintOutputFacade printOutputFacade; private final IPrintingQueueBL printingQueueBL = Services.get(IPrintingQueueBL.class); public AD_Archive(@NonNull final PrintOutputFacade printOutputFacade) { this.printOutputFacade = printOutputFacade; } /** * Check if the archive...
ifColumnsChanged = { I_AD_Archive.COLUMNNAME_IsDirectProcessQueueItem, I_AD_Archive.COLUMNNAME_IsDirectEnqueue, I_AD_Archive.COLUMNNAME_C_Doc_Outbound_Config_ID, I_AD_Archive.COLUMNNAME_IsActive }) public void printArchive(final I_AD_Archive archive) { final PrintArchiveParameters printArchivePa...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\model\validator\AD_Archive.java
2
请完成以下Java代码
public boolean isUseInASI() { return false; } @Override public boolean isDefinedByTemplate() { return false; } @Override public void addAttributeValueListener(final IAttributeValueListener listener) { // nothing } @Override public List<ValueNamePair> getAvailableValues() { throw new InvalidAttri...
{ return false; } @Override public boolean isMandatory() { return false; } @Override public int getDisplaySeqNo() { return 0; } @Override public NamePair getNullAttributeValue() { return null; } /** * @return true; we consider Null attributes as always generated */ @Override public boole...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\impl\NullAttributeValue.java
1
请完成以下Java代码
public class ExcelUtils { public static Workbook openWorkbook(String filePath) throws IOException { try (InputStream fileInputStream = new FileInputStream(filePath)) { if (filePath.toLowerCase() .endsWith("xlsx")) { return new XSSFWorkbook(fileInputStream); ...
for (Cell cell : headerRow) { if (cell.getCellType() != CellType.BLANK && cell.getStringCellValue() != null && !cell.getStringCellValue() .trim() .isEmpty()) { columnNames.add(cell.getStringCellValue() .trim(...
repos\tutorials-master\apache-poi-3\src\main\java\com\baeldung\poi\columnnames\ExcelUtils.java
1
请完成以下Java代码
public void setIsMembershipBadgeToPrint (boolean IsMembershipBadgeToPrint) { set_Value (COLUMNNAME_IsMembershipBadgeToPrint, Boolean.valueOf(IsMembershipBadgeToPrint)); } /** Get Zu druckende Mitgliederausweise. @return Zu druckende Mitgliederausweise */ @Override public boolean isMembershipBadgeToPrint () ...
@param LetterSubject Subject */ @Override public void setLetterSubject (java.lang.String LetterSubject) { set_Value (COLUMNNAME_LetterSubject, LetterSubject); } /** Get Subject. @return Subject */ @Override public java.lang.String getLetterSubject () { return (java.lang.String)get_Value(COLUMNNAME_L...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\letters\model\X_C_Letter.java
1
请完成以下Java代码
private String encodedNonNullPassword(byte[] digest) { if (this.encodeHashAsBase64) { return Utf8.decode(Base64.getEncoder().encode(digest)); } return new String(Hex.encode(digest)); } /** * Takes a previously encoded password and compares it with a rawpassword after mixing * in the salt and encoding th...
* of iterations. * @param iterations the number of iterations which will be executed on the hashed * password/salt value. Defaults to 1. */ public void setIterations(int iterations) { this.digester.setIterations(iterations); } private String extractSalt(String prefixEncodedPassword) { int start = prefixEn...
repos\spring-security-main\crypto\src\main\java\org\springframework\security\crypto\password\MessageDigestPasswordEncoder.java
1
请完成以下Java代码
public class MMovementLineConfirm extends X_M_MovementLineConfirm { /** * */ private static final long serialVersionUID = 2406580342096137696L; /** * Standard Constructor * @param ctx ctx * @param M_MovementLineConfirm_ID id * @param trxName transaction */ public MMovementLineConfirm (Properties c...
/** * Process Confirmation Line. * - Update Movement Line * @return success */ public boolean processLine () { MMovementLine line = getLine(); line.setTargetQty(getTargetQty()); line.setMovementQty(getConfirmedQty()); line.setConfirmedQty(getConfirmedQty()); line.setScrappedQty(getScrappedQty()...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MMovementLineConfirm.java
1
请完成以下Java代码
public String generateRandomCharacters(int length) { RandomStringGenerator pwdGenerator = new RandomStringGenerator.Builder().withinRange(48, 57) .build(); return pwdGenerator.generate(length); } public String generateRandomAlphabet(int length, boolean lowerCase) { int low; ...
IntStream characters = null; if (upperCase) { characters = random.ints(count, 65, 90); } else { characters = random.ints(count, 97, 122); } return characters.mapToObj(data -> (char) data); } public Stream<Character> getRandomNumbers(int count) { I...
repos\tutorials-master\core-java-modules\core-java-string-apis\src\main\java\com\baeldung\password\RandomPasswordGenerator.java
1
请完成以下Java代码
public IArchiveStorage getArchiveStorage(final Properties ctx) { final ClientId adClientId = Env.getClientId(ctx); final StorageType storageType = getStorageType(adClientId); final AccessMode accessMode = getAccessMode(); return getArchiveStorage(adClientId, storageType, accessMode); } @Override public IA...
.setParameter("storageClass", storageClass); } } @Override public IArchiveStorage getArchiveStorage(final Properties ctx, final StorageType storageType) { final ClientId adClientId = Env.getClientId(ctx); final AccessMode accessMode = getAccessMode(); return getArchiveStorage(adClientId, storageType, acces...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\archive\api\impl\ArchiveStorageFactory.java
1
请完成以下Java代码
private DocumentFieldDescriptor.Builder createQtyFieldDescriptor() { return DocumentFieldDescriptor.builder(IInvoiceLineQuickInput.COLUMNNAME_Qty) .setCaption(msgBL.translatable(IInvoiceLineQuickInput.COLUMNNAME_Qty)) .setWidgetType(DocumentFieldWidgetType.Quantity) .setMandatoryLogic(true) .addChara...
.build()) .setValueClass(LookupValue.IntegerLookupValue.class) .setReadonlyLogic(ConstantLogicExpression.FALSE) .setAlwaysUpdateable(true) .setMandatoryLogic(ConstantLogicExpression.FALSE) .setDisplayLogic(ConstantLogicExpression.TRUE) .addCharacteristic(Characteristic.PublicField); } private...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\quickinput\invoiceline\InvoiceLineQuickInputDescriptorFactory.java
1
请完成以下Java代码
public List<NotificationRequestId> findIdsByRuleId(TenantId tenantId, NotificationRequestStatus requestStatus, NotificationRuleId ruleId) { return notificationRequestRepository.findAllIdsByStatusAndRuleId(requestStatus, ruleId.getId()).stream() .map(NotificationRequestId::new).collect(Collectors...
public NotificationRequestInfo findInfoById(TenantId tenantId, NotificationRequestId id) { NotificationRequestInfoEntity info = notificationRequestRepository.findInfoById(id.getId()); return info != null ? info.toData() : null; } @Override public void removeByTenantId(TenantId tenantId) { ...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\notification\JpaNotificationRequestDao.java
1
请在Spring Boot框架中完成以下Java代码
public SysClientDetails findByClientId(String clientId) { return sysClientDetailsRepository.findFirstByClientId(clientId).orElseThrow(() -> new ClientRegistrationException("Loading client exception.")); } @Override public void addClientDetails(SysClientDetails clientDetails) throws ClientAlreadyExi...
@Override public void updateClientSecret(String clientId, String clientSecret) throws NoSuchClientException { SysClientDetails exist = sysClientDetailsRepository.findFirstByClientId(clientId).orElseThrow(() -> new NoSuchClientException("No such client!")); exist.setClientSecret(passwordEncoder.encod...
repos\spring-boot-demo-master\demo-oauth\oauth-authorization-server\src\main\java\com\xkcoding\oauth\service\impl\SysClientDetailsServiceImpl.java
2
请完成以下Java代码
private void action_treeAddAll() { log.info(""); ListModel model = centerList.getModel(); int size = model.getSize(); int index = -1; for (index = 0; index < size; index++) { ListItem item = (ListItem)model.getElementAt(index); action_treeAdd(item); } } // action_treeAddAll /** * Action: Del...
*/ private void action_treeDeleteAll() { log.info(""); ListModel model = centerList.getModel(); int size = model.getSize(); int index = -1; for (index = 0; index < size; index++) { ListItem item = (ListItem)model.getElementAt(index); action_treeDelete(item); } } // action_treeDeleteAll } // VTr...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\form\VTreeMaintenance.java
1
请完成以下Java代码
public class ExecuteChangeTenantIdCmd extends BaseChangeTenantIdCmd { protected static final Logger LOGGER = LoggerFactory.getLogger(ExecuteChangeTenantIdCmd.class); protected final Set<String> entityTypes; protected final boolean dispatchEvent; public ExecuteChangeTenantIdCmd(ChangeTenantIdBuilderIm...
results.put(entityType, (long) dbSqlSession.directUpdate("changeTenantId" + entityType, parameters)); } return results; } @Override protected void beforeReturn(CommandContext commandContext, ChangeTenantIdResult result) { FlowableEventDispatcher eventDispatcher = getEngineConfigura...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\tenant\ExecuteChangeTenantIdCmd.java
1
请完成以下Java代码
public CaseInstanceMigrationDocument getCaseInstanceMigrationDocument() { return this.caseInstanceMigrationDocumentDocumentBuilder.build(); } @Override public void migrate(String caseInstanceId) { getCmmnMigrationService().migrateCaseInstance(caseInstanceId, getCaseInstanceMigrationDocument...
getCmmnMigrationService().migrateCaseInstancesOfCaseDefinition(caseDefinitionKey, caseDefinitionVersion, caseDefinitionTenantId, getCaseInstanceMigrationDocument()); } @Override public Batch batchMigrateCaseInstances(String caseDefinitionKey, int caseDefinitionVersion, String caseDefinitionTenantId) { ...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\migration\CaseInstanceMigrationBuilderImpl.java
1
请在Spring Boot框架中完成以下Java代码
public BigDecimal getExtraCharge() { return extraCharge; } /** * Sets the value of the extraCharge property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setExtraCharge(BigDecimal value) { this.extraCharge = val...
* Sets the value of the lineItemAmount property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setLineItemAmount(BigDecimal value) { this.lineItemAmount = value; } /** * Gets the value of the listLineItemExtension proper...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ListLineItemType.java
2
请完成以下Java代码
public int getSuspensionState() { return suspensionState; } public void setSuspensionState(int suspensionState) { this.suspensionState = suspensionState; } public boolean isSuspended() { return suspensionState == SuspensionState.SUSPENDED.getStateCode(); } public Strin...
public IOSpecification getIoSpecification() { return ioSpecification; } public void setIoSpecification(IOSpecification ioSpecification) { this.ioSpecification = ioSpecification; } public String toString() { return "ProcessDefinitionEntity[" + id + "]"; } public void se...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ProcessDefinitionEntityImpl.java
1
请在Spring Boot框架中完成以下Java代码
public class LoggingProperties { private static final int DEFAULT_LOG_DISK_SPACE_LIMIT = 0; private static final int DEFAULT_LOG_FILE_SIZE_LIMIT = 0; private static final String DEFAULT_LOG_LEVEL = "config"; private int logDiskSpaceLimit = DEFAULT_LOG_DISK_SPACE_LIMIT; private int logFileSizeLimit = DEFAULT_LOG...
} public void setLogDiskSpaceLimit(int logDiskSpaceLimit) { this.logDiskSpaceLimit = logDiskSpaceLimit; } public String getLogFile() { return this.logFile; } public void setLogFile(String logFile) { this.logFile = logFile; } public int getLogFileSizeLimit() { return this.logFileSizeLimit; } public...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\LoggingProperties.java
2
请完成以下Java代码
public void setIsMultiRowOnly (boolean IsMultiRowOnly) { set_Value (COLUMNNAME_IsMultiRowOnly, Boolean.valueOf(IsMultiRowOnly)); } /** Get Multi Row Only. @return This applies to Multi-Row view only */ public boolean isMultiRowOnly () { Object oo = get_Value(COLUMNNAME_IsMultiRowOnly); if (oo != null)...
*/ public void setIsSingleRow (boolean IsSingleRow) { set_Value (COLUMNNAME_IsSingleRow, Boolean.valueOf(IsSingleRow)); } /** Get Single Row Layout. @return Default for toggle between Single- and Multi-Row (Grid) Layout */ public boolean isSingleRow () { Object oo = get_Value(COLUMNNAME_IsSingleRow); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UserDef_Tab.java
1
请完成以下Java代码
public T execute(CommandContext commandContext) { if (executionId == null) { throw new ActivitiIllegalArgumentException("executionId is null"); } ExecutionEntity execution = commandContext.getExecutionEntityManager().findById(executionId); if (execution == null) { ...
return execute(commandContext, execution); } /** * Subclasses should implement this method. The provided {@link ExecutionEntity} is guaranteed to be active (ie. not suspended). */ protected abstract T execute(CommandContext commandContext, ExecutionEntity execution); /** * Subclasses ca...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\NeedsActiveExecutionCmd.java
1
请完成以下Java代码
public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getMobile() { return...
public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getRole() { return role; } public void setRole(Integer role) { this.role = role; } public String getIdCard() ...
repos\springBoot-master\springboot-elasticsearch\src\main\java\cn\abel\bean\User.java
1
请完成以下Java代码
public int getWF_Initial_User_ID() { return get_ValueAsInt(COLUMNNAME_WF_Initial_User_ID); } /** * WFState AD_Reference_ID=305 * Reference name: WF_Instance State */ public static final int WFSTATE_AD_Reference_ID=305; /** NotStarted = ON */ public static final String WFSTATE_NotStarted = "ON"; /** Ru...
public static final String WFSTATE_Aborted = "CA"; /** Terminated = CT */ public static final String WFSTATE_Terminated = "CT"; @Override public void setWFState (final java.lang.String WFState) { set_Value (COLUMNNAME_WFState, WFState); } @Override public java.lang.String getWFState() { return get_ValueA...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_Process.java
1
请在Spring Boot框架中完成以下Java代码
public Result list(@RequestParam Map<String, Object> params) { if (StringUtils.isEmpty(params.get("page")) || StringUtils.isEmpty(params.get("limit"))) { return ResultGenerator.genErrorResult(Constants.RESULT_CODE_PARAM_ERROR, "参数异常!"); } //查询列表数据 PageUtil pageUtil = new Page...
* 修改 */ @RequestMapping(value = "/update", method = RequestMethod.PUT) public Result update(@RequestBody Article article, @TokenToUser AdminUser loginUser) { if (loginUser == null) { return ResultGenerator.genErrorResult(Constants.RESULT_CODE_NOT_LOGIN, "未登录!"); } if (ar...
repos\spring-boot-projects-main\SpringBoot前后端分离实战项目源码\spring-boot-project-front-end&back-end\src\main\java\cn\lanqiao\springboot3\controller\ArticleController.java
2
请完成以下Java代码
private DocumentPath getDocumentPath() { final DocumentId documentId = getRowId(); return DocumentPath.rootDocumentPath(windowId, documentId); } public Builder setRowId(final DocumentId rowId) { this.rowId = rowId; _rowIdEffective = null; return this; } /** @return view row ID; never null *...
// return DisplayType.toBoolean(values.getOrDefault("Processed", false)); return false; } else { return processed.booleanValue(); } } public Builder putFieldValue(final String fieldName, @Nullable final Object jsonValue) { if (jsonValue == null || JSONNullValue.isNull(jsonValue)) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewRow.java
1
请在Spring Boot框架中完成以下Java代码
public String getReleaseStatus() { return releaseStatus; } public void setReleaseStatus(String releaseStatus) { this.releaseStatus = releaseStatus == null ? null : releaseStatus.trim(); } public BigDecimal getFee() { return fee; } public void setFee(BigDecimal fee) { this.fee = fee; } public String ...
return checkFailMsg; } public void setCheckFailMsg(String checkFailMsg) { this.checkFailMsg = checkFailMsg; } public String getBankErrMsg() { return bankErrMsg; } public void setBankErrMsg(String bankErrMsg) { this.bankErrMsg = bankErrMsg; } }
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\entity\RpAccountCheckBatch.java
2
请完成以下Java代码
public PurchaseCandidateId getPurchaseCandidateId() { return getPurchaseCandidate().getId(); } public ProductId getProductId() { return getPurchaseCandidate().getProductId(); } public int getUomId() { final Quantity purchasedQty = getPurchasedQty(); if (purchasedQty != null) { return purchasedQty....
{ purchaseCandidate.markProcessed(); } } public void markReqCreatedIfNeeded() { if (purchaseMatchesOrExceedsRequiredQty()) { purchaseCandidate.setReqCreated(true); } } @Nullable public BigDecimal getPrice() { return purchaseCandidate.getPriceEnteredEff(); } @Nullable public UomId getPriceUo...
repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remotepurchaseitem\PurchaseOrderItem.java
1
请完成以下Java代码
public boolean isContextReusePossible() { return contextReusePossible; } public TransactionPropagation getTransactionPropagation() { return propagation; } public CommandConfig setContextReusePossible(boolean contextReusePossible) { CommandConfig config = new CommandConfig(this)...
} public CommandConfig transactionRequiresNew() { CommandConfig config = new CommandConfig(); config.contextReusePossible = false; config.propagation = TransactionPropagation.REQUIRES_NEW; return config; } public CommandConfig transactionNotSupported() { CommandConf...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\interceptor\CommandConfig.java
1
请完成以下Java代码
public FormFieldValidator createValidator(Element constraint, BpmnParse bpmnParse, ExpressionManager expressionManager) { String name = constraint.attribute("name"); String config = constraint.attribute("config"); if("validator".equals(name)) { // custom validators if(config == null || confi...
bpmnParse.addError("Cannot find validator implementation for name '"+name+"'.", constraint); } } return null; } protected FormFieldValidator createValidatorInstance(Class<? extends FormFieldValidator> validator) { try { return validator.newInstance(); } catch (InstantiationExcepti...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\form\validator\FormValidators.java
1
请完成以下Java代码
public int getC_Order_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID); if (ii == null) return 0; return ii.intValue(); } public I_C_Payment getC_Payment() throws RuntimeException { return (I_C_Payment)MTable.get(getCtx(), I_C_Payment.Table_Name) .getPO(getC_Payment_ID(), get_TrxNa...
return 0; return ii.intValue(); } /** Set Not Committed Aount. @param NonCommittedAmt Amount not committed yet */ public void setNonCommittedAmt (BigDecimal NonCommittedAmt) { set_Value (COLUMNNAME_NonCommittedAmt, NonCommittedAmt); } /** Get Not Committed Aount. @return Amount not committed yet ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_B_SellerFunds.java
1
请完成以下Java代码
public void addCU(@NonNull final I_M_HU cuHU) { assertCU(cuHU); final TULoaderInstanceKey tuInstanceKey = extractTULoaderInstanceKeyFromCU(cuHU); final TULoaderInstance tuInstance = tuInstances.computeIfAbsent(tuInstanceKey, this::newTULoaderInstance); tuInstance.addCU(cuHU); } public void closeCurrentTUs(...
.bpartnerId(key.getBpartnerId()) .bpartnerLocationRepoId(key.getBpartnerLocationRepoId()) .locatorId(key.getLocatorId()) .huStatus(key.getHuStatus()) .clearanceStatusInfo(key.getClearanceStatusInfo()) .build(); } // // // @Value private static class TULoaderInstanceKey { @Nullable BPartne...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\TULoader.java
1
请完成以下Java代码
public void updatePurchase(Purchase purchase) { CompletableFuture.allOf(CompletableFuture.supplyAsync(() -> getOrderDescription(purchase.getOrderId())) .thenAccept(purchase::setOrderDescription), CompletableFuture.supplyAsync(() -> getPaymentDescription(purchase.getPaymentId(...
public String getUserName(String userId) { ResponseEntity<String> result = restTemplate.getForEntity(format("%s/users/%s", BASE_URL, userId), String.class); return result.getBody(); } private static BiFunction<Void, Throwable, Void> handleGracefully() { return (result, exception) -> { ...
repos\tutorials-master\spring-web-modules\spring-resttemplate-1\src\main\java\com\baeldung\resttemplate\restcallscompletablefuture\PurchaseRestCallsAsyncExecutor.java
1
请完成以下Java代码
public class CategoryPurpose1CHCode { @XmlElement(name = "Cd", required = true) protected String cd; /** * Gets the value of the cd property. * * @return * possible object is * {@link String } * */ public String getCd() { return cd;
} /** * Sets the value of the cd property. * * @param value * allowed object is * {@link String } * */ public void setCd(String value) { this.cd = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\CategoryPurpose1CHCode.java
1
请完成以下Java代码
public int getM_Product_ID() { return forecastLine.getM_Product_ID(); } @Override public void setM_Product_ID(final int productId) { forecastLine.setM_Product_ID(productId); } @Override public int getM_AttributeSetInstance_ID() { return forecastLine.getM_AttributeSetInstance_ID(); } @Override publi...
{ return forecastLine.getQtyEnteredTU(); } @Override public void setQtyTU(final BigDecimal qtyPacks) { forecastLine.setQtyEnteredTU(qtyPacks); } @Override public void setC_BPartner_ID(final int partnerId) { values.setC_BPartner_ID(partnerId); } @Override public int getC_BPartner_ID() { return val...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\adempiere\gui\search\impl\ForecastLineHUPackingAware.java
1
请在Spring Boot框架中完成以下Java代码
public void setBeanClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } private XADataSource createXaDataSource(DataSourceProperties properties, JdbcConnectionDetails connectionDetails) { String className = connectionDetails.getXaDataSourceClassName(); Assert.state(StringUtils.hasLength(cla...
Binder binder = new Binder(getBinderSource(dataSourceProperties, connectionDetails)); binder.bind(ConfigurationPropertyName.EMPTY, Bindable.ofInstance(target)); } private ConfigurationPropertySource getBinderSource(DataSourceProperties dataSourceProperties, JdbcConnectionDetails connectionDetails) { Map<Objec...
repos\spring-boot-4.0.1\module\spring-boot-jdbc\src\main\java\org\springframework\boot\jdbc\autoconfigure\XADataSourceAutoConfiguration.java
2
请完成以下Java代码
public MetricsQuery offset(int offset) { setFirstResult(offset); return this; } @Override public MetricsQuery limit(int maxResults) { setMaxResults(maxResults); return this; } @Override public MetricsQuery aggregateByReporter() { aggregateByReporter = true; return this; } @Ove...
protected class MetricsQueryIntervalCmd implements Command<Object> { protected MetricsQueryImpl metricsQuery; public MetricsQueryIntervalCmd(MetricsQueryImpl metricsQuery) { this.metricsQuery = metricsQuery; } @Override public Object execute(CommandContext commandContext) { return com...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\metrics\MetricsQueryImpl.java
1
请完成以下Java代码
public void setMigrationInstruction(MigrationInstructionDto migrationInstruction) { this.migrationInstruction = migrationInstruction; } public String getActivityInstanceId() { return activityInstanceId; } public void setActivityInstanceId(String activityInstanceId) { this.activityInstanceId = acti...
public void setSourceScopeId(String sourceScopeId) { this.sourceScopeId = sourceScopeId; } public static List<MigratingActivityInstanceValidationReportDto> from(List<MigratingActivityInstanceValidationReport> reports) { ArrayList<MigratingActivityInstanceValidationReportDto> dtos = new ArrayList<MigratingA...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\migration\MigratingActivityInstanceValidationReportDto.java
1
请完成以下Java代码
private boolean isLineTypeIncluded(int PA_ReportLine_ID) { MReportLine line = findReportLine(PA_ReportLine_ID, m_report.getLineSet()); return line.isLineTypeIncluded(); } private int getIncludedLineID(int PA_ReportLine_ID) { if (isLineTypeIncluded(PA_ReportLine_ID)) { Collection<Integer> ids = getAllLin...
} else { return PA_ReportLine_ID; } } protected final MReport getPA_Report() { return m_report; } private int getAD_PInstance_ID() { return getPinstanceId().getRepoId(); } } // FinReport
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\report\FinReport.java
1
请完成以下Java代码
public Builder requireAuthorizationConsent(boolean requireAuthorizationConsent) { return setting(ConfigurationSettingNames.Client.REQUIRE_AUTHORIZATION_CONSENT, requireAuthorizationConsent); } /** * Sets the {@code URL} for the Client's JSON Web Key Set. * @param jwkSetUrl the {@code URL} for the Client's...
} /** * Sets the expected subject distinguished name associated to the client * {@code X509Certificate} received during client authentication when using the * {@code tls_client_auth} method. * @param x509CertificateSubjectDN the expected subject distinguished name * associated to the client {@code X50...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\settings\ClientSettings.java
1
请完成以下Java代码
public static IModelInternalAccessor getModelInternalAccessor(@NonNull final Object model) { if (model instanceof PO) { final PO po = (PO)model; return new POModelInternalAccessor(po); } final POWrapper wrapper = getPOWrapperOrNull(model); if (wrapper != null) { return wrapper.modelInternalAccess...
{ return POWrapper.this.getColumnNames(); } @Override public int getColumnIndex(final String columnName) { return POWrapper.this.getColumnIndex(columnName); } @Override public boolean isVirtualColumn(final String columnName) { return POWrapper.this.isVirtualColumn(columnName); } @Overrid...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\model\POWrapper.java
1
请在Spring Boot框架中完成以下Java代码
public class WorkflowLaunchersQuery { @NonNull MobileApplicationId applicationId; @NonNull UserId userId; @Nullable ScannedCode filterByQRCode; @Nullable DocumentNoFilter filterByDocumentNo; boolean filterByQtyAvailableAtPickFromLocator; @Nullable ImmutableSet<WorkflowLaunchersFacetId> facetIds; boolean excludeA...
{ if (filterByQRCode != null) { throw new AdempiereException("Filtering by QR Code is not supported"); } } public void assertNoFacetIds() { if (facetIds != null && !facetIds.isEmpty()) { throw new AdempiereException("Filtering by facets is not supported"); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.workflow.rest-api\src\main\java\de\metas\workflow\rest_api\model\WorkflowLaunchersQuery.java
2
请完成以下Java代码
private class User { @ApiModelProperty(notes = "name of the User") private String userName; @ApiModelProperty(notes = "salary of the user") private Long salary; public User(String userName, Long salary) { this.userName = userName; this.salary = salary; ...
} public void setUserName(String userName) { this.userName = userName; } public Long getSalary() { return salary; } public void setSalary(Long salary) { this.salary = salary; } } }
repos\SpringBoot-Projects-FullStack-master\Part-4 Spring Boot REST API\SpringSwaggerProjectAgain\src\main\java\spring\swagger\resource\UserRepository.java
1
请在Spring Boot框架中完成以下Java代码
public void insertData(String schemaName, String tableName, Document obj) { try { String path = "/" + schemaName + "/" + tableName + "/" + CanalEntry.EventType.INSERT.getNumber(); mongoTemplate.save(obj,tableName); } catch (MongoClientException | MongoSocketException clientExcep...
logger.error(schemaName, tableName, obj, e); } } public void deleteData(String schemaName, String tableName, Document obj) { String path = "/" + schemaName + "/" + tableName + "/" + CanalEntry.EventType.DELETE.getNumber(); //保存原始数据 try { if (obj.containsKey("id")) {...
repos\spring-boot-leaning-master\2.x_data\3-3 使用 canal 将业务数据从 Mysql 同步到 MongoDB\spring-boot-canal-mongodb\src\main\java\com\neo\service\DataService.java
2
请在Spring Boot框架中完成以下Java代码
public void run(String trxName) { refreshEx(mview, sourcePO, refreshMode, trxName); ok[0] = true; } @Override public boolean doCatch(Throwable e) { // log the error, return true to rollback the transaction but don't throw it forward log.error(e.getLocalizedMessage() + ", mview=" + mview ...
final Set<String> sourceColumns = mdata.getSourceColumns(sourceTableName); if (sourceColumns == null || sourceColumns.isEmpty()) return false; if (changeType == ModelValidator.TYPE_AFTER_NEW || changeType == ModelValidator.TYPE_AFTER_DELETE) { return true; } for (String sourceColumn : sourceColumns) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\service\impl\TableMViewBL.java
2
请完成以下Java代码
public String toString() { // NOTE: keep in sync with the parser!!! final StringBuilder sb = new StringBuilder("CConnection["); sb .append("DBhost=").append(dbHost) .append(",DBport=").append(dbPort) .append(",DBname=").append(dbName) .append(",UID=").append(dbUid) .append(",PWD=").append(db...
{ return -1; } else { return Integer.parseInt(dbPortString); } } catch (final Exception e) { logger.error("Error parsing db port: " + dbPortString, e); return -1; } } // setDbPort }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\db\CConnectionAttributes.java
1
请完成以下Java代码
public static Set<DocumentId> retrieveRowIdsForLineIds( @NonNull final SqlViewKeyColumnNamesMap keyColumnNamesMap, final ViewId viewId, final Set<Integer> lineIds) { final SqlAndParams sqlAndParams = SqlViewSelectionQueryBuilder.buildSqlSelectRowIdsForLineIds(keyColumnNamesMap, viewId.getViewId(), lineIds);...
if (rowId != null) { rowIds.add(rowId); } } return rowIds.build(); } catch (final SQLException ex) { throw new DBException(ex, sqlAndParams.getSql(), sqlAndParams.getSqlParams()); } finally { DB.close(rs, pstmt); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\SqlViewRowIdsOrderedSelectionFactory.java
1
请完成以下Java代码
public String getChangeData(Struct sourceRecordChangeValue, String record) { Map<String, Object> changeDataMap = getChangeDataMap(sourceRecordChangeValue, record); if (CollectionUtils.isEmpty(changeDataMap)) { return null; } return JSON.toJSONString(changeDataMap); } ...
private Map<String, Object> getChangeTableInfo(Struct sourceRecordChangeValue) { Struct struct = (Struct) sourceRecordChangeValue.get(SOURCE); Map<String, Object> map = struct.schema().fields().stream() .map(Field::name) .filter(fieldName -> struct.get(fieldName) != null ...
repos\springboot-demo-master\debezium\src\main\java\com\et\debezium\handler\ChangeEventHandler.java
1
请在Spring Boot框架中完成以下Java代码
public ModelAndView renderErrorPage(HttpServletRequest httpRequest) { ModelAndView errorPage = new ModelAndView("errorPage"); String errorMsg = ""; int httpErrorCode = getErrorCode(httpRequest); switch (httpErrorCode) { case 400: { errorMsg = "Http Error Code : 400 ....
break; } // Handle other 4xx error codes. case 500: { errorMsg = "Http Error Code : 500. Internal Server Error"; break; } // Handle other 5xx error codes. } errorPage.addObject("errorMsg", errorMsg); return errorPage; } pri...
repos\tutorials-master\spring-web-modules\spring-mvc-xml-2\src\main\java\com\baeldung\spring\controller\ErrorController.java
2
请完成以下Java代码
public static InputStream getInputStream(Object classLoaderSource, String filePath) { return getInputStream(classLoaderSource.getClass().getClassLoader(), filePath); } public static InputStream getInputStream(ClassLoader classLoader, String filePath) { boolean classPathResource = false; ...
public static String getUri(Object classLoaderSource, String filePath) { return getUri(classLoaderSource.getClass().getClassLoader(), filePath); } public static String getUri(ClassLoader classLoader, String filePath) { try { File resourceFile = new File(filePath); if (re...
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\ResourceUtils.java
1
请完成以下Java代码
public static OrderPaySchedule ofList(@NonNull final OrderId orderId, @NonNull final List<OrderPayScheduleLine> lines) { return new OrderPaySchedule(orderId, lines); } public static Collector<OrderPayScheduleLine, ?, Optional<OrderPaySchedule>> collect() { return GuavaCollectors.collectUsingListAccumulator((li...
public void updateStatusFromContext(final OrderSchedulingContext context) { final PaymentTerm paymentTerm = context.getPaymentTerm(); for (final OrderPayScheduleLine line : lines) { if (line.getStatus().isPending()) { final PaymentTermBreak termBreak = paymentTerm.getBreakById(line.getPaymentTermBreak...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\paymentschedule\OrderPaySchedule.java
1
请完成以下Java代码
public static int getTotalNumberOfLinesUsingLineNumberReader(String fileName) { int lines = 0; try (LineNumberReader reader = new LineNumberReader(new FileReader(fileName))) { reader.skip(Integer.MAX_VALUE); lines = reader.getLineNumber(); } catch (IOException ioe) { ...
try (FileChannel channel = FileChannel.open(Paths.get(fileName), StandardOpenOption.READ)) { ByteBuffer byteBuffer = channel.map(MapMode.READ_ONLY, 0, channel.size()); while (byteBuffer.hasRemaining()) { byte currentChar = byteBuffer.get(); if (currentChar == '\n'...
repos\tutorials-master\core-java-modules\core-java-nio-3\src\main\java\com\baeldung\lines\NumberOfLineFinder.java
1
请完成以下Java代码
public void setC_RfQ_TopicSubscriberOnly_ID (int C_RfQ_TopicSubscriberOnly_ID) { if (C_RfQ_TopicSubscriberOnly_ID < 1) set_ValueNoCheck (COLUMNNAME_C_RfQ_TopicSubscriberOnly_ID, null); else set_ValueNoCheck (COLUMNNAME_C_RfQ_TopicSubscriberOnly_ID, Integer.valueOf(C_RfQ_TopicSubscriberOnly_ID)); } /** G...
return 0; return ii.intValue(); } @Override public org.compiere.model.I_M_Product getM_Product() throws RuntimeException { 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...
repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java-gen\de\metas\rfq\model\X_C_RfQ_TopicSubscriberOnly.java
1
请完成以下Java代码
private void clearRequestedSessionCache() { this.requestedSessionCached = false; this.requestedSession = null; this.requestedSessionId = null; } /** * Allows creating an HttpSession from a Session instance. * * @author Rob Winch * @since 1.0 */ private final class HttpSessionWrapper exten...
@Override public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException { this.delegate.forward(request, response); } @Override public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException { if (!SessionRepos...
repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\http\SessionRepositoryFilter.java
1
请完成以下Java代码
public GridField getField() { return m_mField; } /** * Action Listener Interface * @param listener listener */ @Override public void addActionListener(ActionListener listener) { // m_text.addActionListener(listener); } // addActionListener /** * Action Listener - start dialog * @param e E...
{ if (evt.getPropertyName().equals(org.compiere.model.GridField.PROPERTY)) setValue(evt.getNewValue()); // metas: request focus (2009_0027_G131) if (evt.getPropertyName().equals(org.compiere.model.GridField.REQUEST_FOCUS)) requestFocus(); // metas end } // propertyChange @Override public boo...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VAssignment.java
1
请完成以下Java代码
public QtyTU add(@NonNull final QtyTU toAdd) { if (this.intValue == 0) { return toAdd; } else if (toAdd.intValue == 0) { return this; } else { return ofInt(this.intValue + toAdd.intValue); } } public QtyTU subtractOrZero(@NonNull final QtyTU toSubtract) { if (toSubtract.intValue == 0) ...
{ throw new AdempiereException("Cannot determine Qty CUs/TU when QtyTU is zero of total CUs " + qtyCUsTotal); } else if (isOne()) { return qtyCUsTotal; } else { return qtyCUsTotal.divide(toInt()); } } public Quantity computeTotalQtyCUsUsingQtyCUsPerTU(@NonNull final Quantity qtyCUsPerTU) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\QtyTU.java
1
请在Spring Boot框架中完成以下Java代码
private static class SecureReactiveWebOperation implements ReactiveWebOperation { private final ReactiveWebOperation delegate; private final SecurityInterceptor securityInterceptor; private final EndpointId endpointId; SecureReactiveWebOperation(ReactiveWebOperation delegate, SecurityInterceptor securityInt...
if (!securityResponse.getStatus().equals(HttpStatus.OK)) { return Mono.just(new ResponseEntity<>(securityResponse.getStatus())); } return this.delegate.handle(exchange, body); } } static class CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints implements RuntimeHintsRegistrar { private final Refle...
repos\spring-boot-4.0.1\module\spring-boot-cloudfoundry\src\main\java\org\springframework\boot\cloudfoundry\autoconfigure\actuate\endpoint\reactive\CloudFoundryWebFluxEndpointHandlerMapping.java
2
请完成以下Java代码
public static Builder with(JwsAlgorithm jwsAlgorithm) { return new Builder(jwsAlgorithm); } /** * Returns a new {@link Builder}, initialized with the provided {@code headers}. * @param headers the headers * @return the {@link Builder} */ public static Builder from(JwsHeader headers) { return new Builder...
algorithm(jwsAlgorithm); } private Builder(JwsHeader headers) { Assert.notNull(headers, "headers cannot be null"); getHeaders().putAll(headers.getHeaders()); } /** * Builds a new {@link JwsHeader}. * @return a {@link JwsHeader} */ @Override public JwsHeader build() { return new JwsHeader...
repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\JwsHeader.java
1
请在Spring Boot框架中完成以下Java代码
public GroupedOpenApi group01() { return GroupedOpenApi.builder() .group("group01") .addOperationCustomizer((operation, handlerMethod) -> { operation.addSecurityItem(new SecurityRequirement().addList(headerName)); return operation; ...
.description("请求头") ); return new OpenAPI() .components(components) .info(apiInfo()); } private Info apiInfo() { Contact contact = new Contact(); contact.setEmail("2449207463@qq.com"); contact.setName("程序员十三"); contact.setUrl("http...
repos\spring-boot-projects-main\玩转SpringBoot系列案例源码\spring-boot-swagger\src\main\java\cn\lanqiao\springboot3\config\SpringDocConfig.java
2
请完成以下Java代码
public static ParserTypeEnum fromValue(String value) { if (value == null || value.trim().isEmpty()) { return SQL; } String trimmedValue = value.trim(); // 首先尝试精确匹配枚举值 for (ParserTypeEnum type : ParserTypeEnum.values()) { if (type.getValue...
return type; } } // 尝试匹配枚举名称 for (ParserTypeEnum type : ParserTypeEnum.values()) { if (type.name().equalsIgnoreCase(trimmedValue)) { return type; } } // 默认返回SQL类型 return SQL; } }
repos\SpringBootCodeGenerator-master\src\main\java\com\softdev\system\generator\entity\enums\ParserTypeEnum.java
1
请完成以下Java代码
public PersonType getPerson() { return person; } /** * Sets the value of the person property. * * @param value * allowed object is * {@link PersonType } * */ public void setPerson(PersonType value) { this.person = value; } /** *...
* possible object is * {@link String } * */ public String getEanParty() { return eanParty; } /** * Sets the value of the eanParty property. * * @param value * allowed object is * {@link String } * */ public void setEan...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\InsuranceAddressType.java
1
请完成以下Java代码
public static int getPtypeMenu() { return PTYPE_MENU; } public static void setPtypeMenu(int ptypeMenu) { PTYPE_MENU = ptypeMenu; } public static int getPtypeButton() { return PTYPE_BUTTON; } public static void setPtypeButton(int ptypeButton) { PTYPE_BUTTON = pt...
public void setPval(String pval) { this.pval = pval; } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { ...
repos\spring-boot-quick-master\quick-spring-shiro\src\main\java\com\shiro\entity\Perm.java
1