instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public UserEMailConfig getEmailConfigById(@NonNull final UserId userId) { final I_AD_User userRecord = userDAO.getById(userId); return toUserEMailConfig(userRecord); } @Override public ExplainedOptional<EMailAddress> getEMailAddressById(@NonNull final UserId userId) { final I_AD_User adUser = getById(userId...
valuePreferenceDAO.deleteUserPreferenceByUserId(userId); getUserAuthTokenRepository().deleteUserAuthTokenByUserId(userId); userRolePermissionsDAO.deleteUserOrgAccessByUserId(userId); userRolePermissionsDAO.deleteUserOrgAssignmentByUserId(userId); roleDAO.deleteUserRolesByUserId(userId); getUserSubstituteR...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\user\api\impl\UserBL.java
1
请完成以下Java代码
public int getM_PriceList_Version_ID() { return get_ValueAsInt(COLUMNNAME_M_PriceList_Version_ID); } @Override public void setM_Product_ID (final int M_Product_ID) { if (M_Product_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Product_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Product_ID, M_Product_ID)...
@Override public void setValidFrom (final java.sql.Timestamp ValidFrom) { set_ValueNoCheck (COLUMNNAME_ValidFrom, ValidFrom); } @Override public java.sql.Timestamp getValidFrom() { return get_ValueAsTimestamp(COLUMNNAME_ValidFrom); } @Override public void setValidTo (final java.sql.Timestamp ValidTo) {...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_purchase_prices_in_stock_uom_plv_v.java
1
请完成以下Java代码
public void initHUStorages(final I_M_HU hu) { final SaveDecoupledHUStorageDAO delegate = getDelegate(hu); delegate.initHUStorages(hu); } @Override public void initHUItemStorages(final I_M_HU_Item item) { final SaveDecoupledHUStorageDAO delegate = getDelegate(item); delegate.initHUItemStorages(item); } ...
return delegate.retrieveItemStorages(item); } @Override public I_M_HU_Item_Storage retrieveItemStorage(final I_M_HU_Item item, @NonNull final ProductId productId) { final SaveDecoupledHUStorageDAO delegate = getDelegate(item); return delegate.retrieveItemStorage(item, productId); } @Override public void sa...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\storage\impl\SaveOnCommitHUStorageDAO.java
1
请完成以下Java代码
protected String[] getDeploymentDescriptors(DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException { final ComponentDescription processApplicationComponent = ProcessApplicationAttachments.getProcessApplicationComponent(deploymentUnit); final String paClassName = processApplicationComponent.get...
} } protected boolean isEmptyFile(URL url) { InputStream inputStream = null; try { inputStream = url.openStream(); return inputStream.available() == 0; } catch (IOException e) { throw new ProcessEngineException("Could not open stream for " + url, e); } finally { IoUtil.c...
repos\camunda-bpm-platform-master\distro\wildfly\subsystem\src\main\java\org\camunda\bpm\container\impl\jboss\deployment\processor\ProcessesXmlProcessor.java
1
请完成以下Java代码
public CaseDefinitionEntity findCaseDefinitionByKeyAndVersionAndTenantId(String caseDefinitionKey, Integer caseDefinitionVersion, String tenantId) { Map<String, Object> params = new HashMap<>(); params.put("caseDefinitionKey", caseDefinitionKey); params.put("caseDefinitionVersion", caseDefinitio...
return getDbSqlSession().selectList("selectCaseDefinitionsByQueryCriteria", caseDefinitionQuery); } @Override public long findCaseDefinitionCountByQueryCriteria(CaseDefinitionQueryImpl caseDefinitionQuery) { setSafeInValueLists(caseDefinitionQuery); return (Long) getDbSqlSession().selectOne...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\persistence\entity\data\impl\MybatisCaseDefinitionDataManager.java
1
请完成以下Java代码
public class CatchEventJsonConverter extends BaseBpmnJsonConverter { public static void fillTypes( Map<String, Class<? extends BaseBpmnJsonConverter>> convertersToBpmnMap, Map<Class<? extends BaseElement>, Class<? extends BaseBpmnJsonConverter>> convertersToJsonMap ) { fillJsonTypes(con...
} protected FlowElement convertJsonToElement( JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap ) { IntermediateCatchEvent catchEvent = new IntermediateCatchEvent(); String stencilId = BpmnJsonConverterUtil.getStencilId(elementNode); if (ST...
repos\Activiti-develop\activiti-core\activiti-json-converter\src\main\java\org\activiti\editor\language\json\converter\CatchEventJsonConverter.java
1
请完成以下Spring Boot application配置
spring.application.name=config-server server.port=7001 # git spring.cloud.config.server.git.uri=http://git.oschina.net/didispace/SpringBoot-Learning/ spring.cloud.config.server.git.searchPaths=Chapter9-1-4/config-repo spring.cloud.config.serve
r.git.username=username spring.cloud.config.server.git.password=password # spring.profiles.active=native
repos\SpringBoot-Learning-master\1.x\Chapter9-1-4\config-server\src\main\resources\application.properties
2
请完成以下Java代码
public void setRejectReason (final @Nullable java.lang.String RejectReason) { set_Value (COLUMNNAME_RejectReason, RejectReason); } @Override public java.lang.String getRejectReason() { return get_ValueAsString(COLUMNNAME_RejectReason); } @Override public void setSinglePackage (final boolean SinglePackage...
@Override public boolean isSinglePackage() { return get_ValueAsBoolean(COLUMNNAME_SinglePackage); } @Override public void setWorkplaceIndicator_ID (final int WorkplaceIndicator_ID) { throw new IllegalArgumentException ("WorkplaceIndicator_ID is virtual column"); } @Override public int getWorkplaceIndicat...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_Picking_Job_Step.java
1
请完成以下Java代码
public Collection<Class<? extends PPOrderCandidateUpdatedEvent>> getHandledEventType() {return ImmutableList.of(PPOrderCandidateUpdatedEvent.class);} @Override public void handleEvent(final PPOrderCandidateUpdatedEvent event) { final PPOrderCandidateId ppOrderCandidateId = event.getPpOrderCandidateId(); f...
}); } private Set<DDOrderCandidateId> updateDistributionCandidatesByPPOrderCandidateId(@NonNull final PPOrderCandidateId ppOrderCandidateId, @Nullable final PPOrderId newPPOrderId) { final HashSet<DDOrderCandidateId> ddOrderCandidateIds = new HashSet<>(); ddOrderCandidateRepository.updateByQuery( DDOr...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\de\metas\distribution\ddordercandidate\material_dispo\PPOrderCandidateListeners.java
1
请在Spring Boot框架中完成以下Java代码
public Flyway firstFlyway(@Qualifier("configFlywayBooksDb") FlywayBookProperties properties, @Qualifier("dataSourceBooksDb") HikariDataSource dataSource) { return Flyway.configure() .dataSource(dataSource) .locations(properties.getLocation()) ...
public HikariDataSource secondDataSource(@Qualifier("configAuthorsDb") DataSourceProperties properties) { return properties.initializeDataSourceBuilder().type(HikariDataSource.class) .build(); } @FlywayDataSource @Bean(initMethod = "migrate") public Flyway secondFlyway(@Qualifie...
repos\Hibernate-SpringBoot-master\HibernateSpringBootFlywayMySQLTwoDatabases\src\main\java\com\bookstore\config\ConfigureDataSources.java
2
请完成以下Java代码
public void updateNotifyRord(String id, int notifyTimes, String status) { RpNotifyRecord notifyRecord = rpNotifyService.getNotifyRecordById(id); notifyRecord.setNotifyTimes(notifyTimes); notifyRecord.setStatus(status); notifyRecord.setLastNotifyTime(new Date()); rpNotifyService....
* @param httpStatus * 通知状态(HTTP状态).<br/> * @return 创建结果 */ public long saveNotifyRecordLogs(String notifyId, String merchantNo, String merchantOrderNo, String request, String response, int httpStatus) { RpNotifyRecordLog notifyRecordLog =...
repos\roncoo-pay-master\roncoo-pay-app-notify\src\main\java\com\roncoo\pay\app\notify\core\NotifyPersist.java
1
请完成以下Java代码
public Optional<ShippableOrder> findShippableOrder(int orderId) { if (!this.ordersDb.containsKey(orderId)) return Optional.empty(); PersistenceOrder orderRecord = this.ordersDb.get(orderId); return Optional.of( new ShippableOrder(orderRecord.orderId, orderRecord.orderItems ...
this.orderId = orderId; this.paymentMethod = paymentMethod; this.address = address; this.orderItems = orderItems; } public static class OrderItem { public int productId; public float unitPrice; public float itemWeight; ...
repos\tutorials-master\patterns-modules\ddd-contexts\ddd-contexts-infrastructure\src\main\java\com\baeldung\dddcontexts\infrastructure\db\InMemoryOrderStore.java
1
请完成以下Java代码
public static boolean isEmpty(Object obj) { if (obj == null) { return true; } if (obj instanceof String && obj.toString().trim().length() == 0) { return true; } if (obj.getClass().isArray() && Array.getLength(obj) == 0) { return true; } if (obj instanceof Collection && ((Collection) obj).isEmpty(...
int parity = 0; for (int i = 0; i < values.length; i++) { final String val = Character.toString(values[i]); parity += wi[i] * Integer.parseInt(map.get(val).toString()); } String cheak = (11 - parity % 11) == 10 ? "X" : Integer.toString((11 - parity % 11)); return cheak.equals(all[1]); } /** * 参数长度校验...
repos\roncoo-pay-master\roncoo-pay-web-boss\src\main\java\com\roncoo\pay\permission\utils\ValidateUtils.java
1
请完成以下Java代码
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 KeyNam...
/** Set Search Key. @param Value Search key for the record in the format required - must be unique */ public void setValue (String Value) { set_Value (COLUMNNAME_Value, Value); } /** Get Search Key. @return Search key for the record in the format required - must be unique */ public String getValue ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ReplicationStrategy.java
1
请完成以下Java代码
public void destroy() { cache.clear(); } protected void ensureCapacityLimit() { if (size() > getCapacity()) { List<HalResourceCacheEntry> resources = new ArrayList<HalResourceCacheEntry>(cache.values()); NavigableSet<HalResourceCacheEntry> remainingResources = new TreeSet<HalResourceCacheEntry>...
} // if still exceed capacity remove oldest while (remainingResources.size() > capacity) { HalResourceCacheEntry resourceToRemove = remainingResources.pollFirst(); if (resourceToRemove != null) { remove(resourceToRemove.getId()); } else { break; }...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\hal\cache\DefaultHalResourceCache.java
1
请完成以下Java代码
public void infoJobExecutorDoesNotHandleBatchJobs(ProcessEngineConfigurationImpl config) { logInfo("030", "JobExecutor is configured for priority range {}-{}. Batch jobs will not be handled, because they are outside the priority range ({}).", config.getJobExecutorPriorityRangeMin(), config.g...
logDebug("037", "Jobs currently in execution for the process engine '{}' : {}", processEngine, numExecutions); } public void numJobsInQueue(String processEngine, int numJobsInQueue, int maxQueueSize) { logDebug("038", "Jobs currently in queue to be executed for the process engine '{}' : {} (out of the ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\JobExecutorLogger.java
1
请完成以下Java代码
public I_M_HU_Trx_Line retrieveCounterpartTrxLine(final I_M_HU_Trx_Line trxLine) { final I_M_HU_Trx_Line trxLineCounterpart = trxLine.getParent_HU_Trx_Line(); if (trxLineCounterpart == null) { throw new AdempiereException("Counterpart transaction was not found for " + trxLine); } if (HUConstants.DEBUG_0...
huTrxQuery.setM_HU_ID(huId.getRepoId()); return retrieveTrxLines(Env.getCtx(), huTrxQuery, ITrx.TRXNAME_ThreadInherited); } @Override @Deprecated public List<I_M_HU_Trx_Line> retrieveReferencingTrxLinesForHU(final I_M_HU hu) { final Properties ctx = InterfaceWrapperHelper.getCtx(hu); final String trxName ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\hutransaction\impl\HUTrxDAO.java
1
请完成以下Java代码
public class StartPlanItemInstanceCmd extends AbstractNeedsPlanItemInstanceCmd { protected Map<String, Object> childTaskVariables; protected Map<String, Object> childTaskFormVariables; protected String childTaskFormOutcome; protected FormInfo childTaskFormInfo; public StartPlanItemInstanceCmd(Stri...
this.childTaskVariables = childTaskVariables; this.childTaskFormVariables = childTaskFormVariables; this.childTaskFormOutcome = childTaskFormOutcome; this.childTaskFormInfo = childTaskFormInfo; } @Override protected void internalExecute(CommandContext commandContext, PlanItemInstanc...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\StartPlanItemInstanceCmd.java
1
请完成以下Java代码
public void setQtyOrdered (java.math.BigDecimal QtyOrdered) { set_Value (COLUMNNAME_QtyOrdered, QtyOrdered); } /** Get Bestellte Menge. @return Bestellte Menge */ @Override public java.math.BigDecimal getQtyOrdered () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyOrdered); if (bd == null) ...
{ set_Value (COLUMNNAME_QtyPromised, QtyPromised); } /** Get Zusagbar. @return Zusagbar */ @Override public java.math.BigDecimal getQtyPromised () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyPromised); if (bd == null) return Env.ZERO; return bd; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_PurchaseCandidate_Weekly.java
1
请完成以下Java代码
public LookupValue retrieveLookupValueById(final @NonNull LookupDataSourceContext evalCtx) { final int id = evalCtx.getIdToFilterAsInt(-1); if (id <= 0) { throw new IllegalStateException("No ID provided in " + evalCtx); } final LookupValue region = regionsByCountryId.values() .stream() .map(regio...
matchAll = false; filterUC = filter.trim().toUpperCase(); limit = evalCtx.getLimit(100); } // // Get, filter, return return getRegionLookupValues(countryId) .getValues() .stream() .filter(region -> matchAll || matchesFilter(region, filterUC)) .collect(LookupValuesList.collect()) .page...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\address\AddressRegionLookupDescriptor.java
1
请完成以下Java代码
public void setIsAllowSeparateInvoicing (final boolean IsAllowSeparateInvoicing) { set_Value (COLUMNNAME_IsAllowSeparateInvoicing, IsAllowSeparateInvoicing); } @Override public boolean isAllowSeparateInvoicing() { return get_ValueAsBoolean(COLUMNNAME_IsAllowSeparateInvoicing); } @Override public void set...
} @Override public BigDecimal getQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setSeqNo (final int SeqNo) { set_Value (COLUMNNAME_SeqNo, SeqNo); } @Override public int getSeqNo() { return get_ValueAsInt(COLU...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\order\model\X_C_CompensationGroup_Schema_TemplateLine.java
1
请在Spring Boot框架中完成以下Java代码
JMSConfiguration artemisJmsConfiguration(ObjectProvider<JMSQueueConfiguration> queuesConfiguration, ObjectProvider<TopicConfiguration> topicsConfiguration) { JMSConfiguration configuration = new JMSConfigurationImpl(); configuration.getQueueConfigurations().addAll(queuesConfiguration.orderedStream().toList()); ...
jmsQueueConfiguration.setBindings("/queue/" + queue); configuration.getQueueConfigurations().add(jmsQueueConfiguration); } } private void addTopics(JMSConfiguration configuration, String[] topics) { for (String topic : topics) { TopicConfigurationImpl topicConfiguration = new TopicConfigurationImpl(); t...
repos\spring-boot-4.0.1\module\spring-boot-artemis\src\main\java\org\springframework\boot\artemis\autoconfigure\ArtemisEmbeddedServerConfiguration.java
2
请完成以下Java代码
public String getStartUserId() { return historicProcessInstance.getStartUserId(); } @Override public String getStartActivityId() { return historicProcessInstance.getStartActivityId(); } @Override public String getDeleteReason() { return historicProcessInstance.getDelete...
@Override public List<HistoricData> getHistoricData() { return historicData; } public void addHistoricData(HistoricData historicEvent) { historicData.add(historicEvent); } public void addHistoricData(Collection<? extends HistoricData> historicEvents) { historicData.addAll(h...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\ProcessInstanceHistoryLogImpl.java
1
请完成以下Java代码
public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() {
return age; } public void setAge(Integer age) { this.age = age; } public Collection<Location> getLocations() { return locations; } public void setLocations(Collection<Location> locations) { this.locations = locations; } }
repos\spring-boot-student-master\spring-boot-student-data-mongo\src\main\java\com\xiaolyuh\entity\Person.java
1
请完成以下Java代码
public List<ImageContent> buildImageContents(List<String> images) { List<ImageContent> imageContents = new ArrayList<>(); for (String imageUrl : images) { Matcher matcher = LLMConsts.WEB_PATTERN.matcher(imageUrl); if (matcher.matches()) { // 来源于网络 ...
// 获取文件的 MIME 类型 String mimeType = Files.probeContentType(path); // 构建 ImageContent 对象 imageContents.add(ImageContent.from(base64Data, mimeType)); } catch (IOException e) { log.error("读取文件失败: " + filePath, e); ...
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-boot-module-airag\src\main\java\org\jeecg\modules\airag\llm\handler\AIChatHandler.java
1
请完成以下Java代码
public void setM_Shipper_ID (int M_Shipper_ID) { if (M_Shipper_ID < 1) set_Value (COLUMNNAME_M_Shipper_ID, null); else set_Value (COLUMNNAME_M_Shipper_ID, Integer.valueOf(M_Shipper_ID)); } /** Get Lieferweg. @return Methode oder Art der Warenlieferung */ @Override public int getM_Shipper_ID () ...
@param ShipmentServiceApiUrl URL Api Shipment Service */ @Override public void setShipmentServiceApiUrl (java.lang.String ShipmentServiceApiUrl) { set_Value (COLUMNNAME_ShipmentServiceApiUrl, ShipmentServiceApiUrl); } /** Get URL Api Shipment Service. @return URL Api Shipment Service */ @Override public...
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dpd\src\main\java-gen\de\metas\shipper\gateway\dpd\model\X_DPD_Shipper_Config.java
1
请完成以下Java代码
public RequiredFactor getRequiredFactor() { return this.requiredFactor; } /** * True if not {@link #isMissing()} but was older than the * {@link RequiredFactor#getValidDuration()}. * @return true if expired, else false */ public boolean isExpired() { return this.reason == Reason.EXPIRED; } /** * Tr...
/** * The reason that the error occurred. * * @author Rob Winch * @since 7.0 */ private enum Reason { /** * The authority was missing. * @see #isMissing() */ MISSING, /** * The authority was considered expired. * @see #isExpired() */ EXPIRED } }
repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\RequiredFactorError.java
1
请在Spring Boot框架中完成以下Java代码
public void add(User user) { userDaoImpl.create(user); } @Override public void remove(User user) { } @Override public void update(User user) { } @Override
public List<Tweet> fetchTweets(User user) { return tweetDaoImpl.fetchTweets(user.getEmail()); } @Override public User findByUserName(String userName) { return null; } @Override public User findByEmail(String email) { return null; } }
repos\tutorials-master\patterns-modules\design-patterns-architectural\src\main\java\com\baeldung\repositoryvsdaopattern\UserRepositoryImpl.java
2
请完成以下Spring Boot application配置
spring: application: name: admin-client boot: admin: client: url: http://localhost:8769 server: port: 8768 management: endpoints: web: exp
osure: include: '*' endpoint: health: show-details: ALWAYS
repos\SpringBootLearning-master (1)\springboot-admin\admin-client\src\main\resources\application.yml
2
请完成以下Java代码
public File downReconciliationFile(String interfaceCode, Date billDate) { // 支付渠道编码 if (StringUtil.isEmpty(interfaceCode)) { LOG.info("支付渠道编码为空"); return null; } // 对账单下载 return this.downFile(interfaceCode, billDate); } /** * 下载文件 * * @param interfaceCode * 接口编码 * @param trade...
File file = null; int downloadTrytimes = 0; // 默认尝试三次 while (file == null && downloadTrytimes < DOWNLOAD_TRY_TIMES) { try { downloadTrytimes++; // 使用工厂模式 file = reconciliationFactory.fileDown(interfaceCode, billDate); } catch (Exception e) { LOG.error("下载账单文件失败", e); Thread.sle...
repos\roncoo-pay-master\roncoo-pay-app-reconciliation\src\main\java\com\roncoo\pay\app\reconciliation\biz\ReconciliationFileDownBiz.java
1
请完成以下Java代码
protected void removeConsumer() { flowableConsumer = null; } @Override public boolean isSingleton() { return true; } public void setIdentityService(IdentityService identityService) { this.identityService = identityService; } public void setRuntimeService(RuntimeSer...
public String getCopyVariablesFromHeader() { return copyVariablesFromHeader; } public void setCopyVariablesFromHeader(String copyVariablesFromHeader) { this.copyVariablesFromHeader = copyVariablesFromHeader; } public boolean isCopyCamelBodyToBodyAsString() { return copyCamelBod...
repos\flowable-engine-main\modules\flowable-camel\src\main\java\org\flowable\camel\FlowableEndpoint.java
1
请完成以下Java代码
public boolean update(final I_C_Invoice_Candidate ic) { ic.setApprovalForInvoicing(true); return MODEL_UPDATED; } }); // // Refresh rows, because they were updated if (countUpdated > 0) { gridTab.dataRefreshAll(); } // // Inform the user
clientUI.info(windowNo, "Updated", // AD_Message/title "#" + countUpdated // message ); } private final IQueryBuilder<I_C_Invoice_Candidate> retrieveInvoiceCandidatesToApproveQuery() { return gridTab.createQueryBuilder(I_C_Invoice_Candidate.class) .addOnlyActiveRecordsFilter() .addNotEqualsFilte...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\callout\IC_ApproveForInvoicing_Action.java
1
请在Spring Boot框架中完成以下Java代码
public class NettyClientHandlerInitializer extends ChannelInitializer<Channel> { /** * 心跳超时时间 */ private static final Integer READ_TIMEOUT_SECONDS = 60; @Autowired private MessageDispatcher messageDispatcher; @Autowired private NettyClientHandler nettyClientHandler; @Override ...
ch.pipeline() // 空闲检测 .addLast(new IdleStateHandler(READ_TIMEOUT_SECONDS, 0, 0)) .addLast(new ReadTimeoutHandler(3 * READ_TIMEOUT_SECONDS)) // 编码器 .addLast(new InvocationEncoder()) // 解码器 .addLast(new Invocat...
repos\SpringBoot-Labs-master\lab-67\lab-67-netty-demo\lab-67-netty-demo-client\src\main\java\cn\iocoder\springboot\lab67\nettyclientdemo\client\handler\NettyClientHandlerInitializer.java
2
请完成以下Java代码
public ResponseEntity<Object> updateUserPass(@RequestBody UserPassVo passVo) throws Exception { String oldPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getOldPass()); String newPass = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,passVo.getNewPass()); UserDto user =...
@Log("修改邮箱") @ApiOperation("修改邮箱") @PostMapping(value = "/updateEmail/{code}") public ResponseEntity<Object> updateUserEmail(@PathVariable String code,@RequestBody User user) throws Exception { String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey,user.getPassword()); UserD...
repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\system\rest\UserController.java
1
请完成以下Java代码
public String toDisplayableQRCode() { return id.getDisplayableSuffix(); } public PrintableQRCode toPrintableQRCode() { return PrintableQRCode.builder() .topText(extractPrintableTopText(this)) .bottomText(extractPrintableBottomText(this)) .qrCode(HUQRCodeJsonConverter.toGlobalQRCode(this).getAsStrin...
public Optional<LocalDate> getProductionDate() { return getAttribute(AttributeConstants.ProductionDate).map(HUQRCodeAttribute::getValueAsLocalDate); } @Override public Optional<String> getLotNumber() { return getAttribute(AttributeConstants.ATTR_LotNumber).map(HUQRCodeAttribute::getValue); } private Option...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\qrcodes\model\HUQRCode.java
1
请完成以下Java代码
public static class WebuiViewToOpen { @JsonProperty("viewId") String viewId; @JsonProperty("profileId") String profileId; @JsonProperty("target") ViewOpenTarget target; @lombok.Builder @JsonCreator private WebuiViewToOpen( @JsonProperty("viewId") @NonNull final String viewId, @JsonProperty("...
} @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE) @lombok.Value @lombok.Builder public static class WebuiNewRecord { /** * If this string is used as field value * then the frontend will try to o...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\process\ProcessExecutionResult.java
1
请完成以下Java代码
public class SendTaskParseHandler extends AbstractActivityBpmnParseHandler<SendTask> { private static final Logger logger = LoggerFactory.getLogger(SendTaskParseHandler.class); public Class<? extends BaseElement> getHandledType() { return SendTask.class; } protected void executeParse(BpmnPars...
sendTask.setBehavior(bpmnParse.getActivityBehaviorFactory().createCamelActivityBehavior(sendTask)); } } else if ( ImplementationType.IMPLEMENTATION_TYPE_WEBSERVICE.equalsIgnoreCase(sendTask.getImplementationType()) && StringUtils.isNotEmpty(sendTask.getOperationRef()) ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\handler\SendTaskParseHandler.java
1
请完成以下Java代码
public boolean isGraphicalNotationDefined() { return hasGraphicalNotation(); } @Override public void setHasGraphicalNotation(boolean hasGraphicalNotation) { this.isGraphicalNotationDefined = hasGraphicalNotation; } @Override public String getDiagramResourceName() { retu...
} @Override public void setCategory(String category) { this.category = category; } @Override public String getDecisionType() { return decisionType; } @Override public void setDecisionType(String decisionType) { this.decisionType = decisionType; } @Over...
repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\persistence\entity\DecisionEntityImpl.java
1
请在Spring Boot框架中完成以下Java代码
public Article getArticleById(int articleId) { return entityManager.find(Article.class, articleId); } @SuppressWarnings("unchecked") @Override public List<Article> getAllArticles() { String hql = "FROM Article as atcl ORDER BY atcl.articleId"; return (List<Article>) entityManage...
entityManager.flush(); } @Override public void deleteArticle(int articleId) { entityManager.remove(getArticleById(articleId)); } @Override public boolean articleExists(String title, String category) { String hql = "FROM Article as atcl WHERE atcl.title = ? and atcl.category = ?...
repos\SpringBootBucket-master\springboot-hibernate\src\main\java\com\xncoding\pos\dao\repository\impl\ArticleDAO.java
2
请完成以下Java代码
public void setTitle (final @Nullable java.lang.String Title) { set_Value (COLUMNNAME_Title, Title); } @Override public java.lang.String getTitle() { return get_ValueAsString(COLUMNNAME_Title); } @Override public void setURL (final @Nullable java.lang.String URL) { set_Value (COLUMNNAME_URL, URL); } ...
set_Value (COLUMNNAME_URL3, URL3); } @Override public java.lang.String getURL3() { return get_ValueAsString(COLUMNNAME_URL3); } @Override public void setVendorCategory (final @Nullable java.lang.String VendorCategory) { set_Value (COLUMNNAME_VendorCategory, VendorCategory); } @Override public java.la...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_BPartner.java
1
请在Spring Boot框架中完成以下Java代码
public String getIsAutoSett() { return isAutoSett; } public void setIsAutoSett(String isAutoSett) { this.isAutoSett = isAutoSett == null ? null : isAutoSett.trim(); } public String getPayKey() { return payKey; } public void setPayKey(String payKey) { this.payKey = payKey; }...
public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName == null ? null : userName.trim(); } public Integer getRiskDay() { return riskDay; } public void setRiskDay(Integer riskDay) { this.riskDay = ris...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\user\entity\RpUserPayConfig.java
2
请完成以下Java代码
public boolean save (String whereClause, String trxName) { m_whereClause = whereClause; return save(trxName); } // save /** * Save LOB. * see also org.compiere.session.ServerBean#updateLOB * @param trxName trx name * @return true if saved */ public boolean save(String trxName) { final boolean[]...
} PreparedStatement pstmt = null; boolean success = true; try { pstmt = DB.prepareStatement(sql, trxName); DB.setParameters(pstmt, sqlParams); final int no = pstmt.executeUpdate(); if (no != 1) { log.warn("[" + trxName + "] - Not updated #" + no + " - " + sql); success = false; } } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\PO_LOB.java
1
请完成以下Java代码
public <T, ET extends T> TypedSqlQuery<ET> createUUIDSelectionQuery( @NonNull final IContextAware ctx, @NonNull final Class<ET> clazz, @NonNull final String querySelectionUUID) { final String tableName = InterfaceWrapperHelper.getTableName(clazz); final POInfo poInfo = POInfo.getPOInfo(tableName); final...
+ " FROM " + I_T_Query_Selection.Table_Name + ") s " + "\n LEFT OUTER JOIN " + tableName + " ON (" + keyColumnNameFQ + "=s.ZZ_Record_ID)"; final String selectionWhereClause = "s.ZZ_UUID=?"; final String selectionOrderBy = "s." + SELECTION_LINE_ALIAS; return new TypedSqlQuery<>( ctx.getCtx(), cla...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\dao\selection\QuerySelectionHelper.java
1
请完成以下Spring Boot application配置
elasticjob.reg-center.server-lists=localhost:2181 elasticjob.reg-center.namespace=didispace elasticjob.jobs.my-simple-job.elastic-job-class=com.didispace.chapter72.MySimpleJob elasticjob.jobs.m
y-simple-job.cron=0/5 * * * * ? elasticjob.jobs.my-simple-job.sharding-total-count=1
repos\SpringBoot-Learning-master\2.x\chapter7-2\src\main\resources\application.properties
2
请完成以下Java代码
public Integer generateRandomWithThreadLocalRandom() { int randomWithThreadLocalRandom = ThreadLocalRandom.current() .nextInt(); return randomWithThreadLocalRandom; } public Integer generateRandomWithThreadLocalRandomInARange(int min, int max) { int randomWithThreadLocalRand...
public Integer generateRandomWithSecureRandomWithinARange(int min, int max) { SecureRandom secureRandom = new SecureRandom(); int randomWithSecureRandomWithinARange = secureRandom.nextInt(max - min) + min; return randomWithSecureRandomWithinARange; } public Integer generateRandomWithRan...
repos\tutorials-master\core-java-modules\core-java-numbers-3\src\main\java\com\baeldung\randomnumbers\RandomNumbersGenerator.java
1
请完成以下Java代码
public static final <T> boolean addVEditorButtonUsingBorderLayout(final Class<T> editorClass, final Container editorContainer, final JButton editorButton) { final VEditorDialogButtonAlign buttonAlign = getFromUIManager(editorClass); boolean added = false; if (buttonAlign == VEditorDialogButtonAlign.Hide || butto...
// // Editor property { final String alignUIKey = createUIKey(editorClass); final VEditorDialogButtonAlign align = (VEditorDialogButtonAlign)UIManager.get(alignUIKey); if (align != null) { return align; } } // // Default property { final VEditorDialogButtonAlign align = (VEditorDialog...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\plaf\VEditorDialogButtonAlign.java
1
请完成以下Java代码
public class C_ValidCombination_UpdateDescriptionForAll extends JavaProcess { private final transient IAccountBL accountBL = Services.get(IAccountBL.class); @Override protected void prepare() { // nothing } @Override protected String doIt() throws Exception { final Iterator<I_C_ValidCombination> accounts ...
* * @param account * @return true if updated; false if got errors (which will be logged) */ private boolean updateValueDescription(I_C_ValidCombination account) { DB.saveConstraints(); try { DB.getConstraints().addAllowedTrxNamePrefix(ITrx.TRXNAME_PREFIX_LOCAL); accountBL.setValueDescription(ac...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\process\C_ValidCombination_UpdateDescriptionForAll.java
1
请完成以下Java代码
public String getCode() { return code; } /** * Sets the value of the code property. * * @param value * allowed object is * {@link String } * */ public void setCode(String value) { this.code = value; } /** * Gets the value of the...
* */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } }
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\BfsDataType.java
1
请完成以下Java代码
public KeyValues getLowCardinalityKeyValues(DataLoaderObservationContext context) { return KeyValues.of(errorType(context), loaderType(context), outcome(context)); } @Override public KeyValues getHighCardinalityKeyValues(DataLoaderObservationContext context) { return KeyValues.of(loaderSize(context)); } prot...
} return LOADER_TYPE_UNKNOWN; } protected KeyValue outcome(DataLoaderObservationContext context) { if (context.getError() != null) { return OUTCOME_ERROR; } return OUTCOME_SUCCESS; } protected KeyValue loaderSize(DataLoaderObservationContext context) { return KeyValue.of(DataLoaderHighCardinalityKeyN...
repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\observation\DefaultDataLoaderObservationConvention.java
1
请完成以下Java代码
protected HistoryCleanupJobHandlerConfiguration resolveJobHandlerConfiguration(HistoryCleanupContext context) { HistoryCleanupJobHandlerConfiguration config = new HistoryCleanupJobHandlerConfiguration(); config.setImmediatelyDue(context.isImmediatelyDue()); config.setMinuteFrom(context.getMinuteFrom()); ...
if (currentOrNextBatchWindow != null) { return currentOrNextBatchWindow.getStart(); } else { return null; } } } public ParameterValueProvider getJobPriorityProvider() { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); long historyCleanu...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\historycleanup\HistoryCleanupJobDeclaration.java
1
请完成以下Java代码
public String getFieldName() { return fieldName; } @Override public DocumentFieldWidgetType getWidgetType() { return widgetType; } @Override public boolean isValueSet() { return valueSet; }
@Override public Object getValue() { return value; } public MutableDocumentFieldChangedEvent setValue(final Object value) { this.value = value; valueSet = true; return this; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\MutableDocumentFieldChangedEvent.java
1
请完成以下Java代码
private DefaultMutableTreeNode assertNoCycles(final ProductId productId) { final DefaultMutableTreeNode productNode = new DefaultMutableTreeNode(productId); final IProductBOMDAO productBOMDAO = Services.get(IProductBOMDAO.class); final List<I_PP_Product_BOMLine> productBOMLines = productBOMDAO.retrieveBOMLinesB...
if (productId.equals(parentProductId)) { throw new BOMCycleException(bom, productId); } // Check BOM Loop Error if (!markProductAsSeen(parentProductId)) { throw new BOMCycleException(bom, parentProductId); } return assertNoCycles(parentProductId); } private void clearSeenProducts() { seenPro...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\eevolution\api\impl\ProductBOMCycleDetection.java
1
请完成以下Java代码
public void onMsg(TbContext ctx, TbMsg msg) { try { String relationType = config.isCheckAllKeys() ? allKeysData(msg) && allKeysMetadata(msg) ? TbNodeConnectionType.TRUE : TbNodeConnectionType.FALSE : atLeastOneData(msg) || atLeastOneMetadata(msg) ? TbNodeConne...
private boolean atLeastOneMetadata(TbMsg msg) { if (!metadataNamesList.isEmpty()) { Map<String, String> metadataMap = metadataToMap(msg); return processAtLeastOne(metadataNamesList, metadataMap); } return false; } private boolean processAllKeys(List<String> data,...
repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\filter\TbCheckMessageNode.java
1
请完成以下Java代码
public String getErrorPath(){ return errPath; } // public static void main(String[] args) throws IOException { // File file = ResourceUtils.getFile("classpath:spider.jpg"); // File temfile = new File("C:\\Users\\bd2\\Desktop\\sb.png"); // img2txt(file); // } public File save...
int r = Integer.valueOf(Integer.toBinaryString(rgb).substring(0, 8), 2); int g = (rgb & 0xff00) >> 8; int b = rgb & 0xff; int gray = (int) (0.2126 * r + 0.7152 * g + 0.0722 * b); // 把int gray转换成char int len = toChar.length(); ...
repos\spring-boot-quick-master\quick-img2txt\src\main\java\com\quick\img2txt\Img2TxtService.java
1
请完成以下Java代码
public static String sendPostWithOkHttp(String targetUrl) throws IOException { OkHttpClient client = new OkHttpClient(); MediaType JSON = MediaType.get("application/json; charset=utf-8"); String jsonInput = "{\"key1\":\"value1\", \"key2\":\"value2\"}"; RequestBody body = RequestBody.cre...
public static String sendPostWithSpringWebClient(String targetUrl) { WebClient webClient = WebClient.builder() .baseUrl(targetUrl) .defaultHeader(HttpHeaders.CONTENT_TYPE, org.springframework.http.MediaType.APPLICATION_JSON_VALUE) .build(); String jsonInput = "{\"key...
repos\tutorials-master\core-java-modules\core-java-networking-6\src\main\java\com\baeldung\curltohttprequest\CurlToHttpRequest.java
1
请完成以下Java代码
public static byte[] encodeInteger(BigInteger bigInt) { if (bigInt == null) { throw new NullPointerException("encodeInteger called with null parameter"); } return encodeBase64(toIntegerBytes(bigInt), false); } /** * Returns a byte-array representation of a <code>BigInte...
int len = bigBytes.length; // if bigInt is exactly byte-aligned, just skip signbit in copy if ((bigInt.bitLength() % 8) == 0) { startSrc = 1; len--; } int startDst = bitlen / 8 - len; // to pad w/ nulls as per spec byte[] resizedBytes = new byte[bitlen / ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\digest\_apacheCommonsCodec\Base64.java
1
请完成以下Java代码
public void notifyExternalSystemsAboutPrintJob(@NonNull final PrintingClientRequest request) { externalSystemMessageSender.send(toPrintingClientExternalSystemRequest(request)); } @NonNull private JsonExternalSystemRequest toPrintingClientExternalSystemRequest(@NonNull final PrintingClientRequest request) { fi...
parameters.put(ExternalSystemConstants.PARAM_PRINTING_QUEUE_ID, String.valueOf(request.getPrintingQueueId())); return JsonExternalSystemRequest.builder() .externalSystemConfigId(JsonMetasfreshId.of(childConfigRecord.getExternalSystem_Config_ID())) .externalSystemName(JsonExternalSystemName.of(ExternalSystemT...
repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\printingclient\PrintingClientExternalSystemService.java
1
请完成以下Java代码
private int getWindowNo() { if (_windowNo == null) { final Document parentDocument = getParentDocument(); if (parentDocument == null) { _windowNo = _nextWindowNo.incrementAndGet(); } else { _windowNo = parentDocument.getWindowNo(); } } return _windowNo; } private...
private ReentrantReadWriteLock createLock() { // don't create locks for any other entity which is not window final DocumentEntityDescriptor entityDescriptor = getEntityDescriptor(); if (entityDescriptor.getDocumentType() != DocumentType.Window) { return null; } // final Document parentDocume...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\Document.java
1
请在Spring Boot框架中完成以下Java代码
public class OtlpTracingProperties { /** * URL to the OTel collector's HTTP API. */ private @Nullable String endpoint; /** * Call timeout for the OTel Collector to process an exported batch of data. This * timeout spans the entire call: resolving DNS, connecting, writing the request body, * server proces...
public Duration getConnectTimeout() { return this.connectTimeout; } public void setConnectTimeout(Duration connectTimeout) { this.connectTimeout = connectTimeout; } public Transport getTransport() { return this.transport; } public void setTransport(Transport transport) { this.transport = transport; } ...
repos\spring-boot-4.0.1\module\spring-boot-micrometer-tracing-opentelemetry\src\main\java\org\springframework\boot\micrometer\tracing\opentelemetry\autoconfigure\otlp\OtlpTracingProperties.java
2
请完成以下Java代码
private Flux<?> filterMultiValue(Publisher<?> publisher, EvaluationContext ctx, ExpressionAttribute attribute) { return Flux.from(publisher) .doOnNext((result) -> setFilterObject(ctx, result)) .flatMap((result) -> postFilter(ctx, result, attribute)); } private void setFilterObject(EvaluationContext ctx, Obje...
@Override public Advice getAdvice() { return this; } @Override public boolean isPerInstance() { return true; } @Override public int getOrder() { return this.order; } public void setOrder(int order) { this.order = order; } }
repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\method\PostFilterAuthorizationReactiveMethodInterceptor.java
1
请完成以下Java代码
class CredProtectAuthenticationExtensionsClientInputSerializer extends StdSerializer<CredProtectAuthenticationExtensionsClientInput> { protected CredProtectAuthenticationExtensionsClientInputSerializer() { super(CredProtectAuthenticationExtensionsClientInput.class); } @Override public void serialize(CredProte...
private static String toString(CredProtectAuthenticationExtensionsClientInput.CredProtect.ProtectionPolicy policy) { switch (policy) { case USER_VERIFICATION_OPTIONAL: return "userVerificationOptional"; case USER_VERIFICATION_OPTIONAL_WITH_CREDENTIAL_ID_LIST: return "userVerificationOptionalWithCredenti...
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\jackson\CredProtectAuthenticationExtensionsClientInputSerializer.java
1
请在Spring Boot框架中完成以下Java代码
private Filter createCSRFHeaderFilter() { return new OncePerRequestFilter() { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { CsrfToken csrf = (CsrfToken) request.getAttribute(CsrfTo...
} /** * Angular sends the CSRF token in a custom header named "X-XSRF-TOKEN" * rather than the default "X-CSRF-TOKEN" that Spring security expects. * Hence we are now telling Spring security to expect the token in the * "X-XSRF-TOKEN" header.<br><br> * * This customization is added to the <code>csrf()</c...
repos\spring-boot-microservices-master\api-gateway\src\main\java\com\rohitghatol\microservice\gateway\config\OAuthConfiguration.java
2
请完成以下Java代码
Mono<Void> remove(String sessionId) { return this.sessionRedisOperations.opsForZSet().remove(getExpirationsKey(), sessionId).then(); } /** * Retrieve the session ids that have the expiration time less than the value passed * in {@code expiredBefore}. * @param expiredBefore the expiration time * @return a {...
} private String getExpirationsKey() { return this.namespace + "sessions:expirations"; } /** * Set the namespace for the keys used by this class. * @param namespace the namespace */ void setNamespace(String namespace) { Assert.hasText(namespace, "namespace cannot be null or empty"); this.namespace = n...
repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\SortedSetReactiveRedisSessionExpirationStore.java
1
请在Spring Boot框架中完成以下Java代码
public String home(Locale locale, Model model) { return "redirect:/cars"; } static { carList.add(new Car("Honda", "Civic")); carList.add(new Car("Toyota", "Camry")); carList.add(new Car("Nissan", "Altima")); } @RequestMapping(value = "/cars", method = RequestMethod.GET)...
@RequestMapping(value = "/add", method = RequestMethod.POST) public String addCar(@ModelAttribute("car") Car car) { if (null != car && null != car.getMake() && null != car.getModel() && !car.getMake().isEmpty() && !car.getModel().isEmpty()) { carList.add(car); } return "redirect:...
repos\tutorials-master\spring-web-modules\spring-freemarker\src\main\java\com\baeldung\freemarker\controller\SpringController.java
2
请完成以下Java代码
public void updateSuspensionState(ProcessDefinitionSuspensionStateDto dto) { if (dto.getProcessDefinitionId() != null) { String message = "Only processDefinitionKey can be set to update the suspension state."; throw new InvalidRequestException(Status.BAD_REQUEST, message); } try { dto.upd...
DeleteProcessDefinitionsBuilder builder = repositoryService.deleteProcessDefinitions() .byKey(processDefinitionKey) .withTenantId(tenantId); deleteProcessDefinitions(builder, cascade, skipCustomListeners, skipIoMappings); } protected void deleteProcessDefinitions(DeleteProcessDefinitionsBuilde...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\ProcessDefinitionRestServiceImpl.java
1
请在Spring Boot框架中完成以下Java代码
public String getDOCUMENTID() { return documentid; } /** * Sets the value of the documentid property. * * @param value * allowed object is * {@link String } * */ public void setDOCUMENTID(String value) { this.documentid = value; } /*...
return datefrom; } /** * Sets the value of the datefrom property. * * @param value * allowed object is * {@link String } * */ public void setDATEFROM(String value) { this.datefrom = value; } /** * Gets the value of the dateto property. ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\DDATE1.java
2
请完成以下Java代码
protected void createHUDocumentsFromTypedModel(final HUDocumentsCollector documentsCollector, final I_M_InOut inout) { // 05089: HU Editor shall be displayed only for Receipts if (inout.isSOTrx()) { throw new AdempiereException("@M_InOut_ID@ @IsSOTrx@=@Y@"); } final String docStatus = inout.getDocStatus(...
{ // // Create HU Document Line final List<I_M_Transaction> mtrxs = Services.get(IMTransactionDAO.class).retrieveReferenced(ioLine); for (final I_M_Transaction mtrx : mtrxs) { final MInOutLineHUDocumentLine sourceLine = new MInOutLineHUDocumentLine(ioLine, mtrx); sourceLines.add(sourceLine); }...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\impl\MInOutHUDocumentFactory.java
1
请在Spring Boot框架中完成以下Java代码
public class WebSecurityConfig { @Autowired private CsrfTokenRepository jwtCsrfTokenRepository; @Autowired private SecretService secretService; // ordered so we can use binary search below private final String[] ignoreCsrfAntMatchers = { "/dynamic-builder-compress", "/dynamic-builder-general"...
// ignore if the request path is in our list Arrays.binarySearch(ignoreCsrfAntMatchers, request.getServletPath()) < 0 && // make sure we have a token token != null) { // CsrfFilter already made sure the token matched. Here, we'll make sure it's not expired...
repos\tutorials-master\security-modules\jjwt\src\main\java\io\jsonwebtoken\jjwtfun\config\WebSecurityConfig.java
2
请完成以下Java代码
public Builder code(String code) { this.code = code; return this; } /** * Sets the error code. * @param errorCode the error code * @return the {@link Builder} */ public Builder errorCode(String errorCode) { this.errorCode = errorCode; return this; } /** * Sets the error descriptio...
*/ public Builder errorUri(String errorUri) { this.errorUri = errorUri; return this; } /** * Builds a new {@link OAuth2AuthorizationResponse}. * @return a {@link OAuth2AuthorizationResponse} */ public OAuth2AuthorizationResponse build() { if (StringUtils.hasText(this.code) && StringUtils.hasT...
repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\endpoint\OAuth2AuthorizationResponse.java
1
请完成以下Java代码
private static DESKeySpec getDesKeySpec(String source) throws Exception { if (source == null || source.isEmpty()) { return null; } String strKey = "Passw0rd"; return new DESKeySpec(strKey.getBytes(StandardCharsets.UTF_8)); } /** * 对称加密 */ public static ...
} private static String byte2hex(byte[] inStr) { String stmp; StringBuilder out = new StringBuilder(inStr.length * 2); for (byte b : inStr) { stmp = Integer.toHexString(b & 0xFF); if (stmp.length() == 1) { out.append("0").append(stmp); } e...
repos\eladmin-master\eladmin-common\src\main\java\me\zhengjie\utils\EncryptUtils.java
1
请在Spring Boot框架中完成以下Java代码
public FormLoginConfigurer<H> failureForwardUrl(String forwardUrl) { failureHandler(new ForwardAuthenticationFailureHandler(forwardUrl)); return this; } /** * Forward Authentication Success Handler * @param forwardUrl the target URL in case of success * @return the {@link FormLoginConfigurer} for additiona...
} /** * Gets the HTTP parameter that is used to submit the password. * @return the HTTP parameter that is used to submit the password */ private String getPasswordParameter() { return getAuthenticationFilter().getPasswordParameter(); } /** * If available, initializes the {@link DefaultLoginPageGeneratin...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\FormLoginConfigurer.java
2
请在Spring Boot框架中完成以下Java代码
public void customize(ServerBuilder builder) { builder.withJsonConverter( new org.springframework.http.converter.json.MappingJackson2HttpMessageConverter(this.objectMapper)); } } static class Jackson2XmlMessageConvertersCustomizer implements ClientHttpMessageConvertersCustomizer, ServerHttpMessageConve...
this.objectMapper)); } } private static class PreferJackson2OrJacksonUnavailableCondition extends AnyNestedCondition { PreferJackson2OrJacksonUnavailableCondition() { super(ConfigurationPhase.REGISTER_BEAN); } @ConditionalOnProperty(name = HttpMessageConvertersAutoConfiguration.PREFERRED_MAPPER_PROPERT...
repos\spring-boot-4.0.1\module\spring-boot-http-converter\src\main\java\org\springframework\boot\http\converter\autoconfigure\Jackson2HttpMessageConvertersConfiguration.java
2
请完成以下Java代码
final class Digester { private final String algorithm; private int iterations; /** * Create a new Digester. * @param algorithm the digest algorithm; for example, "SHA-1" or "SHA-256". * @param iterations the number of times to apply the digest algorithm to the input */ Digester(String algorithm, int iter...
} void setIterations(int iterations) { if (iterations <= 0) { throw new IllegalArgumentException("Iterations value must be greater than zero"); } this.iterations = iterations; } private static MessageDigest createDigest(String algorithm) { try { return MessageDigest.getInstance(algorithm); } catc...
repos\spring-security-main\crypto\src\main\java\org\springframework\security\crypto\password\Digester.java
1
请完成以下Java代码
private ProductsToPickRow toRow_IssueComponentsToPickingOrder(final PickingPlanLine planLine) { final SourceDocumentInfo sourceDocumentInfo = planLine.getSourceDocumentInfo(); final ProductInfo productInfo = productInfos.getByProductId(planLine.getProductId()); final IssueToBOMLine issueToBOMLine = Objects.requi...
.shipmentScheduleId(sourceDocumentInfo.getScheduleId().getShipmentScheduleId()) .build(); return ProductsToPickRow.builder() .rowId(rowId) .rowType(ProductsToPickRowType.UNALLOCABLE) .shipperId(sourceDocumentInfo.getShipperId()) // .productInfo(productInfo) .qty(planLine.getQty()) // ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\productsToPick\rows\factory\ProductsToPickRowsDataFactory.java
1
请在Spring Boot框架中完成以下Java代码
private ExplainedOptional<HUInfo> resolvePickFromHUQRCode(@NonNull final PickingJobLine line) { return resolvedHUInfos.computeIfAbsent( line.getId(), k -> huService.resolvePickFromHUQRCode( getHUQRCode(), line.getProductId(), getCustomerId(line), getWarehouseId(line) )); } @Non...
{ final ShipmentScheduleId shipmentScheduleId = line.getScheduleId().getShipmentScheduleId(); return shipmentSchedules.getById(shipmentScheduleId).getWarehouseId(); } private void log(@NonNull String message) { log(null, message); } private void log(@Nullable final PickingJobLine line, @NonNull String mess...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\get_next_eligible_line\GetNextEligibleLineToPackCommand.java
2
请完成以下Java代码
private void addCustomValidationExample() { var nameField = new TextField("Name"); var emailField = new TextField("Email"); var phoneField = new TextField("Phone"); var saveButton = new Button("Save"); var binder = new Binder<>(Contact.class); binder.forField(nameField...
var contact = new Contact("John Doe", "john@doe.com", "123-456-7890"); binder.setBean(contact); saveButton.addClickListener(e -> { if (binder.validate().isOk()) { Notification.show("Saved " + contact); } }); add(new VerticalLayout( ...
repos\tutorials-master\vaadin\src\main\java\com\baeldung\introduction\FormView.java
1
请完成以下Java代码
static class OrderLineComparator implements Comparator<Integer> { Map<Integer, MOrderLine> index; OrderLineComparator(Map<Integer, MOrderLine> olIndex) { index = olIndex; } @Override public int compare(Integer ol1, Integer ol2) { return index.get(ol1).getPriceActual().compareTo(index.get(ol2).getPriceA...
// nol.setQtyReserved(Env.ZERO); nol.setQtyDelivered(Env.ZERO); nol.setQtyInvoiced(Env.ZERO); nol.setQtyLostSales(Env.ZERO); nol.setQty(candidate.qty); nol.setPrice(Env.ZERO); nol.setDiscount(Env.ONEHUNDRED); setPromotion(nol, candidate.promotionReward.getM_Promotion()); setNextLineNo(no...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\adempiere\model\PromotionRule.java
1
请完成以下Java代码
public void setIdIn(String[] groupIds) { this.ids = groupIds; } @CamundaQueryParam("name") public void setName(String groupName) { this.name = groupName; } @CamundaQueryParam("nameLike") public void setNameLike(String groupNameLike) { this.nameLike = groupNameLike; } @CamundaQueryParam("t...
if (ids != null) { query.groupIdIn(ids); } if (name != null) { query.groupName(name); } if (nameLike != null) { query.groupNameLike(nameLike); } if (type != null) { query.groupType(type); } if (member != null) { query.groupMember(member); } if (tenan...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\identity\GroupQueryDto.java
1
请完成以下Java代码
public int getAmount() { return amount; } public double getPrice() { return price; } public Market getMarket() { return market; } public Currency getCurrency() { return currency; }
public String getSymbol() { return symbol; } @Override public String toString() { return new StringJoiner(", ", MarketData.class.getSimpleName() + "[", "]").add("amount=" + amount) .add("price=" + price) .add("market=" + market) .add("currency=" + currency) ...
repos\tutorials-master\libraries-3\src\main\java\com\baeldung\sbe\MarketData.java
1
请完成以下Java代码
public boolean isAutoStoreVariables() { return autoStoreVariables; } public void setAutoStoreVariables(boolean autoStoreVariables) { this.autoStoreVariables = autoStoreVariables; } public boolean isDoNotIncludeVariables() { return doNotIncludeVariables; } public void s...
@Override public ScriptTask clone() { ScriptTask clone = new ScriptTask(); clone.setValues(this); return clone; } public void setValues(ScriptTask otherElement) { super.setValues(otherElement); setScriptFormat(otherElement.getScriptFormat()); setScript(otherE...
repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\ScriptTask.java
1
请完成以下Java代码
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + age; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(final Object obj) { if (this == obj) { ...
return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } return true; } @Override public String toString() { final StringBuilder bu...
repos\tutorials-master\core-java-modules\core-java-lambdas\src\main\java\com\baeldung\java8\entity\Human.java
1
请完成以下Java代码
public void setI_BPartner_GlobalID_ID (int I_BPartner_GlobalID_ID) { if (I_BPartner_GlobalID_ID < 1) set_ValueNoCheck (COLUMNNAME_I_BPartner_GlobalID_ID, null); else set_ValueNoCheck (COLUMNNAME_I_BPartner_GlobalID_ID, Integer.valueOf(I_BPartner_GlobalID_ID)); } /** Get Import BPartnerr Global ID. @re...
@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; } /** Set Proc...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_BPartner_GlobalID.java
1
请完成以下Java代码
public ResponseEntity<InputStreamResource> downloadFile1() throws IOException { File file = new File(FILE_PATH); InputStreamResource resource = new InputStreamResource(new FileInputStream(file)); return ResponseEntity.ok() .header(HttpHeaders.CONTENT_DISPOSITION, ...
@GetMapping("/download3") public void downloadFile3(HttpServletResponse response) throws IOException{ File file = new File(FILE_PATH); response.setContentType("application/pdf"); response.setHeader("Content-Disposition", "attachment; filename=" + file.getName()); BufferedInputStream...
repos\SpringBoot-Projects-FullStack-master\Part-1 Spring Boot Basic Fund Projects\SpringBootSourceCode\SpringDownloadFiles\src\main\java\spring\basic\FileDownloadController.java
1
请在Spring Boot框架中完成以下Java代码
public class InvoiceDueDateProviderService { private final List<InvoiceDueDateProvider> invoiceDueDateProviders; private final PaymentTermBasedDueDateProvider defaultInvoicedueDateProvider; public InvoiceDueDateProviderService( @NonNull final Optional<List<InvoiceDueDateProvider>> invoiceDueDateProviders, @No...
} public LocalDate provideDueDateFor(@NonNull final InvoiceId invoiceId) { for (final InvoiceDueDateProvider provider : invoiceDueDateProviders) { final LocalDate dueDate = provider.provideDueDateOrNull(invoiceId); if (dueDate != null) { return dueDate; } } return defaultInvoicedueDateProvid...
repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\invoice\InvoiceDueDateProviderService.java
2
请完成以下Java代码
protected String formatTableRecordReference(@NonNull final ITableRecordReference recordRef) { // Retrieve the record final Object record; try { final IContextAware context = PlainContextAware.createUsingOutOfTransaction(); record = recordRef.getModel(context); } catch (final Exception e) { logge...
if (record == null) { logger.info("Failed retrieving record for " + recordRef); return "<" + recordRef.getRecord_ID() + ">"; } final String documentNo = Services.get(IDocumentBL.class).getDocumentNo(record); return documentNo; } @Override protected String formatText(final String text) { return tex...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\notification\UserNotificationDetailMessageFormat.java
1
请完成以下Java代码
public Response token(MultivaluedMap<String, String> params, @HeaderParam(HttpHeaders.AUTHORIZATION) String authHeader) throws JOSEException { //Check grant_type params String grantType = params.getFirst("grant_type"); if (grantType == null || grantType.isEmpty()) ...
return responseError("Invalid_request", "Can't get token", Response.Status.INTERNAL_SERVER_ERROR); } return Response.ok(tokenResponse) .header("Cache-Control", "no-store") .header("Pragma", "no-cache") .build(); } private String[] extract(String ...
repos\tutorials-master\security-modules\oauth2-framework-impl\oauth2-authorization-server\src\main\java\com\baeldung\oauth2\authorization\server\api\TokenEndpoint.java
1
请在Spring Boot框架中完成以下Java代码
public class Modification implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String description; private String modification; @ManyToOne(fetch = FetchType.LAZY) private ...
return description; } public void setDescription(String description) { this.description = description; } public String getModification() { return modification; } public void setModification(String modification) { this.modification = modification; } pub...
repos\Hibernate-SpringBoot-master\HibernateSpringBootOptimisticForceIncrement\src\main\java\com\bookstore\entity\Modification.java
2
请完成以下Java代码
public String getConnectionBackendId(final Connection connection, final boolean throwDBException) { Check.assumeNotNull(connection, "connection not null"); final int pgBackendPID; final String sql = "{ ? = call pg_backend_pid() }"; CallableStatement stmt = null; try { if (connection.isClosed() && !thr...
else { return "<caught " + e + " with message " + e.getMessage() + " when trying to get backend PID>"; } } finally { DB.close(stmt); stmt = null; } return String.valueOf(pgBackendPID); } private static List<String> getAquiredConnectionInfos(final ComboPooledDataSource dataSource) throws Ex...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\db\DB_PostgreSQL.java
1
请完成以下Java代码
private void init() { elements = new Object[size]; } public Object nextElement() throws java.util.NoSuchElementException { if ( elements[place] != null && place != current) { place++; return elements[place - 1]; } else { ...
{ } } public void add(int location,Object o) { try { elements[location] = o; } catch(java.lang.ArrayStoreException ase) { } } public void remove(int location) { elements[location] = null; } public int location...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\storage\Array.java
1
请在Spring Boot框架中完成以下Java代码
class CommentService { private final ArticleRepository articleRepository; private final UserRepository userRepository; public Mono<CommentView> addComment(String slug, CreateCommentRequest request, User currentUser) { return articleRepository.findBySlugOrFail(slug) .flatMap(article...
} private Mono<CommentView> addComment(CreateCommentRequest request, User currentUser, Article article) { var comment = request.toComment(UUID.randomUUID().toString(), currentUser.getId()); article.addComment(comment); var profileView = CommentView.toCommentView(comment, ProfileView.toOwnPr...
repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\article\CommentService.java
2
请在Spring Boot框架中完成以下Java代码
public class PickFrom { public static PickFrom ofHuId(@NonNull final HuId huId) { return builder().huId(huId).build(); } public static PickFrom ofHUInfo(@NonNull final HUInfo huInfo) { return ofHuId(huInfo.getId()); } public static PickFrom ofPickingOrderId(@NonNull final PPOrderId pickingOrderId) { ret...
{ this.pickingOrderId = pickingOrderId; this.huId = huId; } public boolean isPickFromHU() { return getHuId() != null; } public boolean isPickFromPickingOrder() { return getPickingOrderId() != null; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\PickFrom.java
2
请完成以下Java代码
public Void execute(CommandContext commandContext) { ExecutionEntity sourceInstanceExecution = determineSourceInstanceExecution(commandContext); // Outline: // 1. find topmost scope execution beginning at scopeExecution that has exactly // one child (this is the topmost scope we can cancel) // 2...
} return null; } protected abstract ExecutionEntity determineSourceInstanceExecution(CommandContext commandContext); protected ExecutionEntity findSuperExecution(ExecutionEntity parentScopeExecution, ExecutionEntity topmostCancellableExecution){ ExecutionEntity superExecution = null; if(parentScope...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\AbstractInstanceCancellationCmd.java
1
请完成以下Java代码
protected boolean isEligibleForMaterialTracking(final I_C_Invoice document) { // Reversals are not eligible, because their original-invoice counterpart is also unlinked. if (Services.get(IInvoiceBL.class).isReversal(document)) { return false; } // Sales Invoices are not eligible if (document.isSOTrx()) ...
final List<I_C_InvoiceLine> documentLines = Services.get(IInvoiceDAO.class).retrieveLines(document); return documentLines; } /** * Gets order line's ASI (where the material tracking is set) */ @Override protected AttributeSetInstanceId getM_AttributeSetInstance(final I_C_InvoiceLine documentLine) { if (do...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\model\validator\C_Invoice.java
1
请完成以下Java代码
public Optional<QuantityTU> calculateQtyTU( @NonNull final BigDecimal qty, @NonNull final I_C_UOM targetUom, @NonNull final QuantityUOMConverter uomConverter) { // Infinite capacity => one pack would be sufficient if (infiniteCapacity) { return Optional.of(QuantityTU.ONE); } // Qty is zero => ze...
@Override public String toString() { return "Capacity [" + "infiniteCapacity=" + infiniteCapacity + ", capacity(qty)=" + capacity + ", product=" + productId + ", uom=" + (uom == null ? "null" : uom.getUOMSymbol()) + ", allowNegativeCapacity=" + allowNegativeCapacity + "]"; } public Quanti...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\quantity\Capacity.java
1
请在Spring Boot框架中完成以下Java代码
public static @Nullable BeanDefinition createExpressionDefinitionFromValueOrExpression(String valueElementName, String expressionElementName, ParserContext parserContext, Element element, boolean oneRequired) { Assert.hasText(valueElementName, "'valueElementName' must not be empty"); Assert.hasText(expressionEl...
expressionDef.getConstructorArgumentValues().addGenericArgumentValue(valueElementValue); } else { expressionDef = createExpressionDefIfAttributeDefined(expressionElementName, element); } return expressionDef; } public static @Nullable BeanDefinition createExpressionDefIfAttributeDefined( String express...
repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\config\NamespaceUtils.java
2
请在Spring Boot框架中完成以下Java代码
static byte[] getContent(String samlObject, String relayState, final Map<String, String> queryParams) { if (Objects.nonNull(relayState)) { return String .format("%s=%s&%s=%s&%s=%s", samlObject, queryParams.get(samlObject), Saml2ParameterNames.RELAY_STATE, queryParams.get(Saml2ParameterNames.RELAY...
byte[] getSignature() { return this.signature; } boolean hasSignature() { return this.signature != null; } } } interface DecryptionConfigurer { void decrypt(XMLObject object); } }
repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\internal\OpenSamlOperations.java
2
请完成以下Java代码
public class WebServer { private final InetSocketAddress address = new InetSocketAddress(8080); private final Path path = Path.of("/"); public static void main(String[] args) { WebServer webServer = new WebServer(); HttpServer server = webServer.createWithHandler401Response(); serv...
HttpHandler handler = HttpHandlers.handleOrElse(findAllowedPath, allowedResponse, deniedResponse); HttpServer server = SimpleFileServer.createFileServer(address, path, SimpleFileServer.OutputLevel.VERBOSE); server.createContext("/test", handler); return server; } private HttpServer cre...
repos\tutorials-master\core-java-modules\core-java-18\src\main\java\com\baeldung\simplewebserver\WebServer.java
1
请完成以下Java代码
public MessageEventPayload getMessagePayload() { return messagePayload; } public void setMessagePayload(MessageEventPayload messagePayload) { this.messagePayload = messagePayload; } @Override public boolean equals(Object o) { if (this == o) { return true; ...
return result; } @Override public String toString() { return ( "BPMNMessageImpl{" + ", elementId='" + getElementId() + '\'' + ", messagePayload='" + (messagePayload != null ? messagePayload.toString() : null) + '\''...
repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-model-impl\src\main\java\org\activiti\api\runtime\model\impl\BPMNMessageImpl.java
1
请在Spring Boot框架中完成以下Java代码
public class PriceLimitRuleResult { public static PriceLimitRuleResult notApplicable(@NonNull final String reason) { return notApplicable(TranslatableStrings.anyLanguage(reason)); } public static PriceLimitRuleResult notApplicable(@NonNull final ITranslatableString reason) { return PriceLimitRuleResult._build...
this.priceLimit = priceLimit; this.priceLimitExplanation = priceLimitExplanation; this.notApplicableReason = null; } else { Check.assumeNotNull(notApplicableReason, "Parameter notApplicableReason is not null"); this.applicable = false; this.notApplicableReason = notApplicableReason; this.pric...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\limit\PriceLimitRuleResult.java
2
请完成以下Java代码
private static Optional<InstantAndOrgId> calculateEarliestPreparationTime(final PackageableList packageables) { return packageables.stream() .map(Packageable::getPreparationDate) .filter(Objects::nonNull) .min(InstantAndOrgId::compareTo); } @Override public DocumentId getId() { return rowId.getDoc...
@Override public ImmutableSet<String> getFieldNames() { return values.getFieldNames(); } @Override public ViewRowFieldNameAndJsonValues getFieldNameAndJsonValues() { return values.get(this); } public boolean isLocked() { return lockedByUser != null; } public boolean isNotLocked() { return !isLock...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\packageable\PackageableRow.java
1