instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
protected boolean supports(Class<?> clazz) { return OAuth2AccessTokenResponse.class.isAssignableFrom(clazz); } @Override @SuppressWarnings("unchecked") protected OAuth2AccessTokenResponse readInternal(Class<? extends OAuth2AccessTokenResponse> clazz, HttpInputMessage inputMessage) throws HttpMessageNotReadabl...
/** * Sets the {@link Converter} used for converting the OAuth 2.0 Access Token Response * parameters to an {@link OAuth2AccessTokenResponse}. * @param accessTokenResponseConverter the {@link Converter} used for converting to an * {@link OAuth2AccessTokenResponse} * @since 5.6 */ public final void setAcces...
repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\http\converter\OAuth2AccessTokenResponseHttpMessageConverter.java
1
请完成以下Java代码
public void setPortMapper(PortMapper portMapper) { Assert.notNull(portMapper, "portMapper cannot be null"); this.portMapper = portMapper; } /** * Use this {@link ServerWebExchangeMatcher} to narrow which requests are redirected * to HTTPS. * * The filter already first checks for HTTPS in the uri scheme, ...
private boolean isInsecure(ServerWebExchange exchange) { return !"https".equals(exchange.getRequest().getURI().getScheme()); } private URI createRedirectUri(ServerWebExchange exchange) { int port = exchange.getRequest().getURI().getPort(); UriComponentsBuilder builder = UriComponentsBuilder.fromUri(exchange.ge...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\transport\HttpsRedirectWebFilter.java
1
请完成以下Java代码
private TULoaderInstance newTULoaderInstance(@NonNull final TULoaderInstanceKey key) { return TULoaderInstance.builder() .huContext(huContext) .tuPI(tuPI) .capacity(capacity) .bpartnerId(key.getBpartnerId()) .bpartnerLocationRepoId(key.getBpartnerLocationRepoId()) .locatorId(key.getLocatorId(...
int bpartnerLocationRepoId; @Nullable LocatorId locatorId; @Nullable String huStatus; @Nullable ClearanceStatusInfo clearanceStatusInfo; @Builder private TULoaderInstanceKey( @Nullable final BPartnerId bpartnerId, final int bpartnerLocationRepoId, @Nullable final LocatorId locatorId, @Nullabl...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\TULoader.java
1
请在Spring Boot框架中完成以下Java代码
public class OrdersDataSourceConfig { @Autowired private Environment env; @Bean @ConfigurationProperties(prefix="datasource.orders") public DataSourceProperties ordersDataSourceProperties() { return new DataSourceProperties(); } @Bean public DataSource ordersDataSource() { ...
Properties jpaProperties = new Properties(); jpaProperties.put("hibernate.hbm2ddl.auto", env.getProperty("spring.jpa.hibernate.ddl-auto")); jpaProperties.put("hibernate.show-sql", env.getProperty("spring.jpa.show-sql")); factory.setJpaProperties(jpaProperties); return factory; ...
repos\Spring-Boot-Advanced-Projects-main\springboot-multiple-datasources\src\main\java\net\alanbinu\springboot\springbootmultipledatasources\config\OrdersDataSourceConfig.java
2
请完成以下Java代码
public GatewayFilter apply(Config config) { // token 和 userId 的映射 Map<String, Integer> tokenMap = new HashMap<>(); tokenMap.put("yunai", 1); // 创建 GatewayFilter 对象 return new GatewayFilter() { @Override public Mono<Void> filter(ServerWebExchange exchange...
private static final String DEFAULT_TOKEN_HEADER_NAME = "token"; private static final String DEFAULT_HEADER_NAME = "user-id"; private String tokenHeaderName = DEFAULT_TOKEN_HEADER_NAME; private String userIdHeaderName = DEFAULT_HEADER_NAME; public String getTokenHeaderName() { ...
repos\SpringBoot-Labs-master\labx-08-spring-cloud-gateway\labx-08-sc-gateway-demo05-custom-gateway-filter\src\main\java\cn\iocoder\springcloud\labx08\gatewaydemo\filter\AuthGatewayFilterFactory.java
1
请完成以下Java代码
public ExpressionNode getRoot() { return root; } public boolean isDeferred() { return deferred; } @Override public String toString() { return getRoot().getStructuralId(null); } /** * Create a bindings. * @param fnMapper the function mapper to use * @...
FunctionNode node = functions.get(i); String image = node.getName(); Method method = null; int colon = image.indexOf(':'); if (colon < 0) { method = fnMapper.resolveFunction("", image); } else { metho...
repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\tree\Tree.java
1
请完成以下Java代码
public boolean isSameDeployment() { return sameDeployment; } public void setSameDeployment(boolean sameDeployment) { this.sameDeployment = sameDeployment; } public String getFormKey() { return formKey; } public void setFormKey(String formKey) { this.formKey = f...
@Override public StartEvent clone() { StartEvent clone = new StartEvent(); clone.setValues(this); return clone; } public void setValues(StartEvent otherEvent) { super.setValues(otherEvent); setInitiator(otherEvent.getInitiator()); setFormKey(otherEvent.getFor...
repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\StartEvent.java
1
请完成以下Java代码
public String getMimeType() { return mimeType; } public void setMimeType(String mimeType) { this.mimeType = mimeType; } public void setValue(byte[] bytes) { this.value = bytes; } @Override public InputStream getValue() { if (value == null) { return null; } return new ByteA...
return encoding; } /** * Get the byte array directly without wrapping it inside a stream to evade * not needed wrapping. This method is intended for the internal API, which * needs the byte array anyways. */ public byte[] getByteArray() { return value; } @Override public String toString() ...
repos\camunda-bpm-platform-master\commons\typed-values\src\main\java\org\camunda\bpm\engine\variable\impl\value\FileValueImpl.java
1
请完成以下Java代码
public TaxRecordPeriod1Code getTp() { return tp; } /** * Sets the value of the tp property. * * @param value * allowed object is * {@link TaxRecordPeriod1Code } * */ public void setTp(TaxRecordPeriod1Code value) { this.tp = value; } ...
return frToDt; } /** * Sets the value of the frToDt property. * * @param value * allowed object is * {@link DatePeriodDetails } * */ public void setFrToDt(DatePeriodDetails value) { this.frToDt = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\TaxPeriod1.java
1
请完成以下Java代码
public String getName() { return name; } public String getNameLike() { return nameLike; } public static long getSerialversionuid() { return serialVersionUID; } public String getDeploymentId() { return deploymentId; } public List<String> getDeploymentId...
} public String getTenantId() { return tenantId; } public String getTenantIdLike() { return tenantIdLike; } public boolean isWithoutTenantId() { return withoutTenantId; } public String getNameLikeIgnoreCase() { return nameLikeIgnoreCase; } public ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\HistoricProcessInstanceQueryImpl.java
1
请完成以下Java代码
public class PartySEPA2 { @XmlElement(name = "PrvtId", required = true) protected PersonIdentificationSEPA2 prvtId; /** * Gets the value of the prvtId property. * * @return * possible object is * {@link PersonIdentificationSEPA2 } * */ public PersonIden...
} /** * Sets the value of the prvtId property. * * @param value * allowed object is * {@link PersonIdentificationSEPA2 } * */ public void setPrvtId(PersonIdentificationSEPA2 value) { this.prvtId = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_008_003_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_008_003_02\PartySEPA2.java
1
请完成以下Java代码
public void setDataEntry_Section_ID (final int DataEntry_Section_ID) { if (DataEntry_Section_ID < 1) set_ValueNoCheck (COLUMNNAME_DataEntry_Section_ID, null); else set_ValueNoCheck (COLUMNNAME_DataEntry_Section_ID, DataEntry_Section_ID); } @Override public int getDataEntry_Section_ID() { return get...
} @Override public boolean isInitiallyClosed() { return get_ValueAsBoolean(COLUMNNAME_IsInitiallyClosed); } @Override public void setName (final java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_ValueAsString(COLUMNNAME_Name); }...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\dataentry\model\X_DataEntry_Section.java
1
请在Spring Boot框架中完成以下Java代码
public void setCategory(String category) { this.category = category; } @ApiModelProperty(example = "oneEvent.event") public String getResourceName() { return resourceName; } public void setResourceName(String resourceName) { this.resourceName = resourceName; } publ...
@ApiModelProperty(example = "http://localhost:8182/event-registry-repository/deployments/2/resources/oneEvent.event", value = "Contains the actual deployed event definition JSON.") public String getResource() { return resource; } @ApiModelProperty(example = "This is an event definition for testing ...
repos\flowable-engine-main\modules\flowable-event-registry-rest\src\main\java\org\flowable\eventregistry\rest\service\api\repository\EventDefinitionResponse.java
2
请完成以下Java代码
public int getParameterCount() { return 2; } @Override public String getLabel(int index) { if (index == 0) return Msg.translate(Env.getCtx(), "NearCity"); else if (index == 1) return Msg.translate(Env.getCtx(), "RadiusKM"); else return null; } @Override public Object getParameterToComponent(i...
{ return null; } @Override public Object getParameterValue(int index, boolean returnValueTo) { return null; } public IInfoSimple getParent() { return parent; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\compiere\apps\search\InfoQueryCriteriaBPRadiusAbstract.java
1
请在Spring Boot框架中完成以下Java代码
public class BookController { @Autowired private BookRepository repository; // Find @GetMapping("/books") List<Book> findAll() { return repository.findAll(); } // Save @PostMapping("/books") //return 201 instead of 200 @ResponseStatus(HttpStatus.CREATED) Book newBo...
return repository.findById(id) .map(x -> { String author = update.get("author"); if (!StringUtils.isEmpty(author)) { x.setAuthor(author); // better create a custom method to update a value = :newValue where id = :i...
repos\spring-boot-master\spring-rest-hello-world\src\main\java\com\mkyong\BookController.java
2
请在Spring Boot框架中完成以下Java代码
public class SpringAsyncExecutor extends DefaultAsyncJobExecutor { protected SpringRejectedJobsHandler rejectedJobsHandler; public SpringAsyncExecutor() { super(); } public SpringAsyncExecutor(AsyncJobExecutorConfiguration configuration) { super(configuration); } public Sprin...
try { taskExecutor.execute(createRunnableForJob(job)); return true; } catch (RejectedExecutionException e) { sendRejectedEvent(job); if (rejectedJobsHandler == null) { unacquireJobAfterRejection(job); } else { rejectedJo...
repos\flowable-engine-main\modules\flowable-job-spring-service\src\main\java\org\flowable\spring\job\service\SpringAsyncExecutor.java
2
请完成以下Java代码
private static Charset getCharset(final @NonNull ContentCachingResponseWrapper responseWrapper) { final String charset = StringUtils.trimBlankToNull(responseWrapper.getCharacterEncoding()); return charset != null ? Charset.forName(charset) : StandardCharsets.UTF_8; } @Nullable private Object getBody(@NonNull f...
if (bodyCandidate == null) { return null; } final MediaType contentType = getContentType(httpHeaders); if (contentType == null) { return null; } else if (contentType.includes(MediaType.TEXT_PLAIN)) { return bodyCandidate; } else if (contentType.includes(MediaType.APPLICATION_JSON)) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\util\web\audit\dto\ApiResponseMapper.java
1
请完成以下Java代码
public void setAD_Language (String AD_Language) { set_Value (COLUMNNAME_AD_Language, AD_Language); } /** Get Language. @return Language for this entity */ public String getAD_Language () { return (String)get_Value(COLUMNNAME_AD_Language); } /** Set Validation code. @param Code Validation Code ...
} /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Re...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Error.java
1
请完成以下Java代码
public List<OLCandValidationResult> clearOLCandidates( @NonNull final List<I_C_OLCand> olCandList, @Nullable final AsyncBatchId asyncBatchId) { final List<OLCandValidationResult> olCandValidationResults = validateOLCandRecords(olCandList); final boolean allFine = olCandValidationResults.stream().allMatch(OL...
validate(olCandRecord); InterfaceWrapperHelper.save(olCandRecord); // will only access the DB is there are changes in cand validatedOlCands.add(olCandFactory.toOLCand(olCandRecord)); } return validatedOlCands.build(); } finally { setValidationProcessInProgress(false); } } @NonNull private...
repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\api\OLCandValidatorService.java
1
请完成以下Java代码
public class VerfuegbarkeitsanfrageBulkAntwort { @XmlElement(name = "Pzn", type = Long.class) protected List<Long> pzn; @XmlAttribute(name = "Id", required = true) protected String id; /** * Gets the value of the pzn property. * * <p> * This accessor method returns a reference...
/** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@...
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.schema.v1\src\main\java-xjc\de\metas\vertical\pharma\vendor\gateway\msv3\schema\v1\VerfuegbarkeitsanfrageBulkAntwort.java
1
请完成以下Java代码
public class ReferenceList { @XmlElementRefs({ @XmlElementRef(name = "DataReference", namespace = "http://www.w3.org/2001/04/xmlenc#", type = JAXBElement.class, required = false), @XmlElementRef(name = "KeyReference", namespace = "http://www.w3.org/2001/04/xmlenc#", type = JAXBElement.class, requir...
* * <p> * Objects of the following type(s) are allowed in the list * {@link JAXBElement }{@code <}{@link ReferenceType }{@code >} * {@link JAXBElement }{@code <}{@link ReferenceType }{@code >} * * */ public List<JAXBElement<ReferenceType>> getDataReferenceOrKeyReference() { ...
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\ReferenceList.java
1
请完成以下Java代码
public static boolean isCompensationThrowing(PvmExecutionImpl execution) { ActivityImpl currentActivity = execution.getActivity(); if (currentActivity != null) { Boolean isCompensationThrowing = (Boolean) currentActivity.getProperty(BpmnParse.PROPERTYNAME_THROWS_COMPENSATION); if (isCompensationThro...
if (currentActivity != null) { return scopeExecution.isScope() && currentActivity.isScope() && !scopeExecution.getNonEventScopeExecutions().isEmpty() && !isCompensationThrowing(scopeExecution); } else { return false; } } public static String getParentActivityIn...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\pvm\runtime\CompensationBehavior.java
1
请完成以下Java代码
public class SchemaOperationsEngineDropDbCmd implements Command<Void> { protected final String engineScopeType; public SchemaOperationsEngineDropDbCmd(String engineScopeType) { this.engineScopeType = engineScopeType; } @Override public Void execute(CommandContext commandContext) { ...
} // The drop is executed in the reverse order ListIterator<SchemaManager> listIterator = schemaManagers.listIterator(schemaManagers.size()); while (listIterator.hasPrevious()) { SchemaManager schemaManager = listIterator.previous(); try { schemaManager.s...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\db\SchemaOperationsEngineDropDbCmd.java
1
请完成以下Java代码
public void addInput(HistoricDecisionInputInstance decisionInputInstance) { if(inputs == null) { inputs = new ArrayList<HistoricDecisionInputInstance>(); } inputs.add(decisionInputInstance); } public void addOutput(HistoricDecisionOutputInstance decisionOutputInstance) { if(outputs == null) {...
public void setRootDecisionInstanceId(String rootDecisionInstanceId) { this.rootDecisionInstanceId = rootDecisionInstanceId; } public String getDecisionRequirementsDefinitionId() { return decisionRequirementsDefinitionId; } public void setDecisionRequirementsDefinitionId(String decisionRequirementsDef...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoricDecisionInstanceEntity.java
1
请在Spring Boot框架中完成以下Java代码
private void briefOverviewOfPersistentContextContent() { org.hibernate.engine.spi.PersistenceContext persistenceContext = getPersistenceContext(); int managedEntities = persistenceContext.getNumberOfManagedEntities(); System.out.println("\n-----------------------------------"); System....
+ " | Status: " + ee.getStatus() + " | State: " + Arrays.toString(ee.getLoadedState())); }; System.out.println("\n-----------------------------------\n"); } private org.hibernate.engine.spi.PersistenceContext getPersistenceContext() { SharedSessionContractImplement...
repos\Hibernate-SpringBoot-master\HibernateSpringBootJoinDtoAllFields\src\main\java\com\bookstore\service\BookstoreService.java
2
请完成以下Java代码
public boolean hasChildElements() { return false; } @Override protected CmmnElement convert(XMLStreamReader xtr, ConversionHelper conversionHelper) { CmmnModel model = conversionHelper.getCmmnModel(); model.setId(xtr.getAttributeValue(null, CmmnXmlConstants.ATTRIBUTE_ID)); ...
for (int i = 0; i < xtr.getAttributeCount(); i++) { ExtensionAttribute extensionAttribute = new ExtensionAttribute(); extensionAttribute.setName(xtr.getAttributeLocalName(i)); extensionAttribute.setValue(xtr.getAttributeValue(i)); String namespace = xtr.getAttributeNamesp...
repos\flowable-engine-main\modules\flowable-cmmn-converter\src\main\java\org\flowable\cmmn\converter\DefinitionsXmlConverter.java
1
请在Spring Boot框架中完成以下Java代码
public T save(T entity) { if (entity.getId() == null) { entity.setId(nextId()); } T processedEntity = preProcess(entity); if (processedEntity != null) { allRules.put(processedEntity.getId(), processedEntity); machineRules.computeIfAbsent(MachineInfo.of...
} @Override public T findById(Long id) { return allRules.get(id); } @Override public List<T> findAllByMachine(MachineInfo machineInfo) { Map<Long, T> entities = machineRules.get(machineInfo); if (entities == null) { return new ArrayList<>(); } re...
repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\repository\rule\InMemoryRuleRepositoryAdapter.java
2
请完成以下Java代码
public static boolean isProcessApplication(DeploymentUnit deploymentUnit) { return deploymentUnit.hasAttachment(MARKER); } /** * Returns the {@link ComponentDescription} for the {@link AbstractProcessApplication} component */ public static ComponentDescription getProcessApplicationComponent(Deploymen...
} /** * @return the description of the PostDeploy method */ public static AnnotationInstance getPostDeployDescription(DeploymentUnit deploymentUnit) { return deploymentUnit.getAttachment(POST_DEPLOY_METHOD); } /** * @return the description of the PreUndeploy method */ public static Annot...
repos\camunda-bpm-platform-master\distro\wildfly\subsystem\src\main\java\org\camunda\bpm\container\impl\jboss\deployment\marker\ProcessApplicationAttachments.java
1
请完成以下Java代码
public Stream<WebuiDocumentReference> evaluateAndStream(@NonNull final RelatedDocumentsEvaluationContext context) { return relatedDocumentsCandidateGroup.evaluateAndStream(context) .map(relatedDocuments -> toDocumentReference(relatedDocuments, filterCaption)); } public static WebuiDocumentReference toDocument...
.documentsCount(relatedDocuments.getRecordCount()) .filter(MQueryDocumentFilterHelper.createDocumentFilterFromMQuery(relatedDocuments.getQuery(), filterCaption)) .loadDuration(relatedDocuments.getRecordCountDuration()) .build(); } private static WebuiDocumentReferenceTargetWindow toDocumentReferenceTarge...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\references\WebuiDocumentReferenceCandidate.java
1
请在Spring Boot框架中完成以下Java代码
private static class ContributorConfigDataLocationResolverContext implements ConfigDataLocationResolverContext { private final ConfigDataEnvironmentContributors contributors; private final ConfigDataEnvironmentContributor contributor; private final @Nullable ConfigDataActivationContext activationContext; pr...
private final @Nullable ConfigDataActivationContext activationContext; InactiveSourceChecker(@Nullable ConfigDataActivationContext activationContext) { this.activationContext = activationContext; } @Override public Object onSuccess(ConfigurationPropertyName name, Bindable<?> target, BindContext context, ...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\ConfigDataEnvironmentContributors.java
2
请完成以下Java代码
public Iterable<Tag> repositoryTags(RepositoryMethodInvocation invocation) { Tags tags = Tags.empty(); tags = and(tags, invocation.getRepositoryInterface(), "repository", this::getSimpleClassName); tags = and(tags, invocation.getMethod(), "method", Method::getName); RepositoryMethodInvocationResult result = inv...
return tags.and(key, value.apply(instance)); } return (fallback != null) ? tags.and(fallback) : tags; } private String getExceptionName(Throwable error) { return getSimpleClassName(error.getClass()); } private String getSimpleClassName(Class<?> type) { String simpleName = type.getSimpleName(); return (!...
repos\spring-boot-4.0.1\module\spring-boot-data-commons\src\main\java\org\springframework\boot\data\metrics\DefaultRepositoryTagsProvider.java
1
请在Spring Boot框架中完成以下Java代码
public Response say(Message message) throws Exception { Thread.sleep(1000); return new Response("Welcome, " + message.getName() + "!"); } //http://localhost:8080/Welcome1 @RequestMapping("/Welcome1") @ResponseBody public String say2()throws Exception { ws.sendMessage(); ...
*/ if (principal.getName().equals("admin")) { //通过convertAndSendToUser 向用户发送信息, // 第一个参数是接收消息的用户,第二个参数是浏览器订阅的地址,第三个参数是消息本身 messagingTemplate.convertAndSendToUser("abel", "/queue/notifications", principal.getName() + "-send:" + ...
repos\springBoot-master\springWebSocket\src\main\java\com\us\example\controller\WebSocketController.java
2
请完成以下Java代码
private String createIssue(String projectKey, Long issueType, String issueSummary) { IssueRestClient issueClient = restClient.getIssueClient(); IssueInput newIssue = new IssueInputBuilder(projectKey, issueType, issueSummary).build(); return issueClient.createIssue(newIssue).claim().getKey(); ...
private List<Comment> getAllComments(String issueKey) { return StreamSupport.stream(getIssue(issueKey).getComments().spliterator(), false) .collect(Collectors.toList()); } private void updateIssueDescription(String issueKey, String newDescription) { IssueInput input = new IssueInputBu...
repos\tutorials-master\saas-modules\jira-rest-integration\src\main\java\com\baeldung\saas\jira\MyJiraClient.java
1
请在Spring Boot框架中完成以下Java代码
public List<I_C_BPartner> retrieveVendors(@NonNull final QueryLimit limit) { return queryBL.createQueryBuilder(I_C_BPartner.class) .addInArrayFilter(I_C_BPartner.COLUMNNAME_IsVendor, true) .addOnlyActiveRecordsFilter() .orderBy(I_C_BPartner.COLUMNNAME_Name) .orderBy(I_C_BPartner.COLUMNNAME_C_BPartner...
@Override @NonNull public List<String> getOtherLocationNamesOfBPartner(@NonNull final BPartnerId bPartnerId, @Nullable final BPartnerLocationId bPartnerLocationId) { return queryBL .createQueryBuilder(I_C_BPartner_Location.class) .addEqualsFilter(I_C_BPartner_Location.COLUMNNAME_C_BPartner_ID, bPartnerId) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\bpartner\service\impl\BPartnerDAO.java
2
请完成以下Java代码
public void onCreate(@Nullable Connection connection) { this.delegates.forEach(delegate -> delegate.onCreate(connection)); } @Override public void onClose(Connection connection) { this.delegates.forEach(delegate -> delegate.onClose(connection)); } @Override public void onShutDown(ShutdownSignalException sig...
public void setDelegates(List<? extends ConnectionListener> delegates) { this.delegates = new ArrayList<>(delegates); } public void addDelegate(ConnectionListener delegate) { this.delegates.add(delegate); } public boolean removeDelegate(ConnectionListener delegate) { return this.delegates.remove(delegate); ...
repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\connection\CompositeConnectionListener.java
1
请完成以下Java代码
private void initTotalRetries(CommandContext commandContext) { totalRetries = commandContext.getProcessEngineConfiguration().getFailedJobListenerMaxRetries(); } protected void fireHistoricJobFailedEvt(JobEntity job) { CommandContext commandContext = Context.getCommandContext(); // the given job failed...
} protected class FailedJobListenerCmd implements Command<Void> { protected String jobId; protected Command<Object> cmd; public FailedJobListenerCmd(String jobId, Command<Object> cmd) { this.jobId = jobId; this.cmd = cmd; } @Override public Void execute(CommandContext commandCo...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\FailedJobListener.java
1
请完成以下Java代码
private WarehouseId getOnly_Warehouse_ID() { try { final String only_Warehouse = Env.getContext(Env.getCtx(), m_WindowNo, "M_Warehouse_ID", true); if (only_Warehouse != null && only_Warehouse.length() > 0) { return WarehouseId.ofRepoIdOrNull(Integer.parseInt(only_Warehouse)); } else { ret...
* Set the default locator if this field is mandatory * and we have a warehouse restriction. * * @since 3.1.4 */ private void setDefault_Locator_ID() { // teo_sarca, FR [ 1661546 ] Mandatory locator fields should use defaults if (!isMandatory() || m_mLocator == null) { return; } final WarehouseI...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VLocator.java
1
请完成以下Java代码
public final class ErrorMessage { public static ErrorMessage of(final String message) { final Throwable exception = null; return new ErrorMessage(message, exception); } public static ErrorMessage of(final Throwable exception) { String message = AdempiereException.extractMessage(exception); return new Erro...
this.exception = exception; } @Override @Deprecated public String toString() { return message == null ? "" : message; } public String getMessage() { return message; } public AdempiereException toException() { return exception != null ? AdempiereException.wrapIfNeeded(exception) : new Adempie...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\parser\ErrorMessage.java
1
请完成以下Java代码
public FetchAndLockBuilderImpl orderByCreateTime() { orderingProperties.add(new QueryOrderingProperty(CREATE_TIME, null)); return this; } public FetchAndLockBuilderImpl asc() throws NotValidException { configureLastOrderingPropertyDirection(ASCENDING); return this; } public FetchAndLockBuilder...
protected void configureLastOrderingPropertyDirection(Direction direction) { QueryOrderingProperty lastProperty = !orderingProperties.isEmpty() ? getLastElement(orderingProperties) : null; ensureNotNull(NotValidException.class, "You should call any of the orderBy methods first before specifying a direction", "...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\externaltask\FetchAndLockBuilderImpl.java
1
请完成以下Java代码
public IHUTransactionCandidate getCounterpart() { return counterpartTrx; } private void setCounterpart(@NonNull final IHUTransactionCandidate counterpartTrx) { Check.assume(this != counterpartTrx, "counterpartTrx != this"); if (this.counterpartTrx == null) { this.counterpartTrx = counterpartTrx; } ...
{ Check.errorUnless(counterpartTrx instanceof HUTransactionCandidate, "Param counterPartTrx needs to be a HUTransaction counterPartTrx={}", counterpartTrx); this.setCounterpart(counterpartTrx); // by casting to HUTransaction (which currently is the only implementation of IHUTransaction), we don't have t...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\hutransaction\impl\HUTransactionCandidate.java
1
请在Spring Boot框架中完成以下Java代码
public void addPricingAttributes(final Collection<IPricingAttribute> pricingAttributesToAdd) { if (pricingAttributesToAdd == null || pricingAttributesToAdd.isEmpty()) { return; } pricingAttributes.addAll(pricingAttributesToAdd); } /** * Supposed to be called by the pricing engine. * <p> * task htt...
return priceToRound; } return precision.round(priceToRound); } @Override public boolean isCampaignPrice() { return campaignPrice; } @Override public IPricingResult setLoggableMessages(@NonNull final ImmutableList<String> loggableMessages) { this.loggableMessages = loggableMessages; return this; } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\service\impl\PricingResult.java
2
请在Spring Boot框架中完成以下Java代码
public void setBeanClassLoader(ClassLoader beanClassLoader) { this.beanClassLoader = beanClassLoader; } @Override public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException { return isConfiguration(metadataReader) && isAutoConfiguration(metadataReader)...
return annotatedWithAutoConfiguration || getAutoConfigurations().contains(metadataReader.getClassMetadata().getClassName()); } protected List<String> getAutoConfigurations() { List<String> autoConfigurations = this.autoConfigurations; if (autoConfigurations == null) { ImportCandidates importCandidates = I...
repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\AutoConfigurationExcludeFilter.java
2
请完成以下Java代码
public Operation getOperation() { return operationRefChild.getReferenceTargetElement(this); } public void setOperation(Operation operation) { operationRefChild.setReferenceTargetElement(this, operation); } /** camunda extensions */ public String getCamundaClass() { return camundaClassAttribute....
public String getCamundaTopic() { return camundaTopicAttribute.getValue(this); } public void setCamundaTopic(String camundaTopic) { camundaTopicAttribute.setValue(this, camundaTopic); } public String getCamundaType() { return camundaTypeAttribute.getValue(this); } public void setCamundaType(S...
repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\MessageEventDefinitionImpl.java
1
请在Spring Boot框架中完成以下Java代码
public class HUReservation { @Getter(AccessLevel.PRIVATE) @NonNull ImmutableMap<HuId, HUReservationEntry> entriesByVHUId; @NonNull HUReservationDocRef documentRef; @Nullable BPartnerId customerId; @NonNull Quantity reservedQtySum; private HUReservation(@NonNull final Collection<HUReservationEntry> entries) { ...
{ final ImmutableSet<BPartnerId> customerIds = entries .stream() .map(HUReservationEntry::getCustomerId) .filter(Objects::nonNull) .collect(ImmutableSet.toImmutableSet()); return customerIds.size() == 1 ? customerIds.iterator().next() : null; } private static Quantity computeReservedQtySum(final ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\reservation\HUReservation.java
2
请完成以下Spring Boot application配置
grpc: client: hello: address: localhost:9090 negotiation-type: plaintext logging: pattern: console: "[%d{yyyy-MM-dd HH:mm:ss.SSS}] %-5level [%t] [%logger - %line]: %m%n"
level: com.baeldung.helloworld.consumer: info include-application-name: false
repos\tutorials-master\spring-boot-modules\spring-boot-3-grpc\helloworld-grpc-consumer\src\main\resources\application.yml
2
请完成以下Java代码
public I_I_Request retrieveImportRecord(final Properties ctx, final ResultSet rs) throws SQLException { final PO po = TableModelLoader.instance.getPO(ctx, I_I_Request.Table_Name, rs, ITrx.TRXNAME_ThreadInherited); return InterfaceWrapperHelper.create(po, I_I_Request.class); } /* * @param isInsertOnly ignored....
{ int statusId = importRecord.getR_Status_ID(); if (statusId <= 0) { throw new AdempiereException("Status not found"); } request.setR_Status_ID(statusId); } // // set data from the other fields request.setDateTrx(importRecord.getDateTrx()); request.setDateNextAction(importRecord.getDateNext...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\request\impexp\RequestImportProcess.java
1
请完成以下Java代码
public Set<OrderId> retrieveAllContractOrderList(@NonNull final OrderId orderId) { final Set<OrderId> orderIds = new HashSet<>(); final OrderId ancestorId = retrieveOriginalContractOrder(orderId); orderIds.add(ancestorId); buildAllContractOrderList(ancestorId, orderIds); return orderIds; } /** * <ul> ...
} @Nullable public OrderId getContractOrderId(@NonNull final I_C_Flatrate_Term term) { if (term.getC_OrderLine_Term_ID() <= 0) { return null; } final IOrderDAO orderRepo = Services.get(IOrderDAO.class); final de.metas.interfaces.I_C_OrderLine ol = orderRepo.getOrderLineById(term.getC_OrderLine_Term_ID...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\order\ContractOrderService.java
1
请完成以下Java代码
protected String processBusinessKey(MethodInvocation invocation) throws Throwable { Map<BusinessKey, String> businessKeyAnnotations = this.mapOfAnnotationValues( BusinessKey.class ,invocation); if (businessKeyAnnotations.size() == 1) { BusinessKey processId = businessKeyAnnotations.keySet().iterator().next(); ...
return vars; } /** * if there any arguments with the {@link org.camunda.bpm.engine.annotations.ProcessVariable} annotation, * then we feed those parameters into the business process * * @param invocation the invocation of the method as passed to the {@link org.aopalliance.intercept.MethodInterceptor#invoke(...
repos\camunda-bpm-platform-master\engine-spring\core\src\main\java\org\camunda\bpm\engine\spring\components\aop\ProcessStartingMethodInterceptor.java
1
请在Spring Boot框架中完成以下Java代码
public void setNextImportStartingTimestamp(@NonNull final DateAndImportStatus dateAndImportStatus) { if (this.nextImportStartingTimestamp == null) { this.nextImportStartingTimestamp = dateAndImportStatus; return; } if (this.nextImportStartingTimestamp.isOkToImport()) { if (dateAndImportStatus.isOkT...
{ this.nextImportStartingTimestamp = dateAndImportStatus; return; } } if (!this.nextImportStartingTimestamp.isOkToImport() && !dateAndImportStatus.isOkToImport() && dateAndImportStatus.getTimestamp().isBefore(this.nextImportStartingTimestamp.getTimestamp())) { this.nextImportStartingTimesta...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\de-metas-camel-ebay-camelroutes\src\main\java\de\metas\camel\externalsystems\ebay\EbayImportOrdersRouteContext.java
2
请完成以下Java代码
public Optional<BPartnerId> getBpartnerId() { return rowsData.getBpartnerId(); } public SOTrx getSoTrx() { return rowsData.getSoTrx(); } public CurrencyId getCurrencyId() { return rowsData.getCurrencyId(); } public Set<ProductId> getProductIds() { return rowsData.getProductIds(); } public Opt...
} public void addOrUpdateRows(@NonNull final List<ProductsProposalRowAddRequest> requests) { rowsData.addOrUpdateRows(requests); invalidateAll(); } public void patchViewRow(@NonNull final DocumentId rowId, @NonNull final ProductsProposalRowChangeRequest request) { rowsData.patchRow(rowId, request); } pu...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\products_proposal\view\ProductsProposalView.java
1
请完成以下Java代码
public void setTaxAmt (BigDecimal TaxAmt) { set_Value (COLUMNNAME_TaxAmt, TaxAmt); } /** Get Tax Amount. @return Tax Amount for a document */ public BigDecimal getTaxAmt () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TaxAmt); if (bd == null) return Env.ZERO; return bd; } /** Set Tax In...
{ return (String)get_Value(COLUMNNAME_TaxIndicator); } /** Set UPC/EAN. @param UPC Bar Code (Universal Product Code or its superset European Article Number) */ public void setUPC (String UPC) { set_Value (COLUMNNAME_UPC, UPC); } /** Get UPC/EAN. @return Bar Code (Universal Product Code or its supe...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_Invoice.java
1
请完成以下Java代码
void init() { Configuration cacheConfig = new ConfigurationBuilder() .clustering().cacheMode(CacheMode.LOCAL) .memory().maxCount(10) .expiration().lifespan(600, TimeUnit.MILLISECONDS) .persistence().passivation(true).build(); demoCache = cacheManager.administration().withFlags(CacheContainerAdmin.A...
public int size() { return demoCache.size(); } public void clear() { demoCache.clear(); } public boolean isPassivationEnabled() { return cacheManager.getCacheConfiguration(CACHE_NAME).persistence().passivation(); } public void stop() { cacheManager.stop(); } }
repos\tutorials-master\quarkus-modules\quarkus-infinispan-embedded\src\main\java\com\baeldung\quarkus\infinispan\InfinispanCacheService.java
1
请完成以下Java代码
public static String convertFromDecimalToBaseX(int num, int newBase) throws IllegalArgumentException { if ((newBase < 2 || newBase > 10) && newBase != 16) { throw new IllegalArgumentException("New base must be from 2 - 10 or 16"); } String result = ""; int remainder; ...
} return new StringBuffer(result).reverse().toString(); } public static int convertFromAnyBaseToDecimal(String num, int base) { if (base < 2 || (base > 10 && base != 16)) { return -1; } int val = 0; int power = 1; for (int i = num.length() - 1; i >= 0...
repos\tutorials-master\core-java-modules\core-java-lang-5\src\main\java\com\baeldung\convertnumberbases\ConvertNumberBases.java
1
请完成以下Java代码
public String getComputerIp() { return computerIp; } public void setComputerIp(String computerIp) { this.computerIp = computerIp; } public String getUserDir() { return userDir; } public void setUserDir(String userDir) { this.userDir = userDir; } public...
return osName; } public void setOsName(String osName) { this.osName = osName; } public String getOsArch() { return osArch; } public void setOsArch(String osArch) { this.osArch = osArch; } }
repos\spring-boot-demo-master\demo-websocket\src\main\java\com\xkcoding\websocket\model\server\Sys.java
1
请完成以下Java代码
public class DateRangeOverlapChecker { public static boolean isOverlapUsingCalendarAndDuration(Calendar start1, Calendar end1, Calendar start2, Calendar end2) { long overlap = Math.min(end1.getTimeInMillis(), end2.getTimeInMillis()) - Math.max(start1.getTimeInMillis(), start2.getTimeInMillis()); re...
public static boolean isOverlapUsingLocalDateAndCondition(LocalDate start1, LocalDate end1, LocalDate start2, LocalDate end2) { return !(end1.isBefore(start2) || start1.isAfter(end2)); } public static boolean isOverlapUsingCalendarAndFindMin(Calendar start1, Calendar end1, Calendar start2, Calendar end...
repos\tutorials-master\core-java-modules\core-java-8-datetime-3\src\main\java\com\baeldung\daterangeoverlap\DateRangeOverlapChecker.java
1
请在Spring Boot框架中完成以下Java代码
public String getSuspendedJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response) { Job job = getSuspendedJobById(jobId); String stackTrace = managementService.getSuspendedJobExceptionStacktrace(job.getId()); if (stackTrace == null) { throw...
}) @GetMapping("/cmmn-management/deadletter-jobs/{jobId}/exception-stacktrace") public String getDeadLetterJobStacktrace(@ApiParam(name = "jobId") @PathVariable String jobId, HttpServletResponse response) { Job job = getDeadLetterJobById(jobId); String stackTrace = managementService.getDeadLett...
repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\management\JobExceptionStacktraceResource.java
2
请在Spring Boot框架中完成以下Java代码
public class SettBiz { private static final Log LOG = LogFactory.getLog(SettBiz.class); @Autowired private DailySettCollectBiz dailySettCollectBiz; @Autowired private RpUserPayConfigService rpUserPayConfigService; @Autowired private RpSettHandleService rpSettHandleService; /** * 发起每日待结算数据统计汇总.<br/> * ...
* 发起定期自动结算.<br/> * * @param userEnterpriseList * 结算商户.<br/> */ public void launchAutoSett(List<RpAccount> accountList) { if (accountList == null || accountList.isEmpty()) { return; } // 单商户发起结算 for (RpAccount rpAccount : accountList) { try { RpUserPayConfig rpUserPayConfig = rpUse...
repos\roncoo-pay-master\roncoo-pay-app-settlement\src\main\java\com\roncoo\pay\app\settlement\biz\SettBiz.java
2
请完成以下Java代码
private void initFeatureMatrix(String[] termArray, FeatureMap featureMap) { featureMatrix = new int[termArray.length][]; for (int i = 0; i < featureMatrix.length; i++) { featureMatrix[i] = extractFeature(termArray, featureMap, i); } } public static POSInstance cr...
{ return null; } List<Word> wordList = sentence.toSimpleWordList(); String[] termArray = new String[wordList.size()]; String[] posArray = new String[wordList.size()]; int i = 0; for (Word word : wordList) { termArray[i] = word.getValue(); ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\perceptron\instance\POSInstance.java
1
请在Spring Boot框架中完成以下Java代码
public class DestinationsConfig { private Map<String,DestinationInfo> queues = new HashMap<>(); private Map<String,DestinationInfo> topics = new HashMap<>(); public Map<String, DestinationInfo> getQueues() { return queues; } public void setQueues(Map<String, Destin...
} public void setExchange(String exchange) { this.exchange = exchange; } public String getRoutingKey() { return routingKey; } public void setRoutingKey(String routingKey) { this.routingKey = routingKey; } ...
repos\tutorials-master\spring-reactive-modules\spring-webflux-amqp\src\main\java\com\baeldung\spring\amqp\DestinationsConfig.java
2
请完成以下Java代码
public boolean invokeHandlers(final String tableName, final Object[] ids, final IContextAware ctx) { boolean atLeastOneHandlerFixedIt = false; for (final INoDataFoundHandler currentHandler : noDataFoundHandlers) { final boolean currentHandlerFixedIt = invokeCurrentHandler(currentHandler, tableName, ids, ctx);...
.computeIfAbsent(handler, h -> new HashSet<>()); if (!currentlyInvokedOnRecords.add(key)) { logger.debug( "The current handler was already invoked with tableName={} and ids={} earlier in this same stack. Returning to avoid a stack overflowError; key={}; handler={}", tableName, ids, key, handler); r...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\persistence\po\NoDataFoundHandlers.java
1
请完成以下Java代码
protected boolean isValidEvent(ActivitiEvent event) { boolean valid = false; if (event instanceof ActivitiEntityEvent) { if (entityClass == null) { valid = true; } else { valid = entityClass.isAssignableFrom(((ActivitiEntityEvent) event).getEntity(...
/** * Called when an entity update event is received. */ protected void onUpdate(ActivitiEvent event) { // Default implementation is a NO-OP } /** * Called when an event is received, which is not a create, an update or delete. */ protected void onEntityEvent(ActivitiEvent ev...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\delegate\event\BaseEntityEventListener.java
1
请完成以下Java代码
private static Validation extractValidation(@NonNull final I_AD_BusinessRule record) { return Validation.adValRule(AdValRuleId.ofRepoId(record.getValidation_Rule_ID())); } private static BusinessRulePrecondition fromRecord(@NonNull final I_AD_BusinessRule_Precondition record) { return BusinessRulePrecondition....
} if (record.isOnDelete()) { timings.add(TriggerTiming.DELETE); } return timings.build(); } @Nullable private static Validation extractCondition(final I_AD_BusinessRule_Trigger record) { return StringUtils.trimBlankToOptional(record.getConditionSQL()) .map(Validation::sql) .orElse(null); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\business_rule\descriptor\BusinessRuleLoader.java
1
请在Spring Boot框架中完成以下Java代码
public List<SysTenant> getTenantListByUserId(String userId) { return tenantMapper.getTenantListByUserId(userId); } @Override public void deleteUser(SysUser sysUser, Integer tenantId) { //被删除人的用户id String userId = sysUser.getId(); //被删除人的密码 String password = sysUser.g...
* @param tenantId 租户id */ public void addPackUser(String userId, String tenantId) { //根据租户id和产品包的code获取租户套餐id List<String> packIds = sysTenantPackMapper.getPackIdByPackCodeAndTenantId(oConvertUtils.getInt(tenantId)); if (CollectionUtil.isNotEmpty(packIds)) { for (String pack...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\service\impl\SysTenantServiceImpl.java
2
请在Spring Boot框架中完成以下Java代码
public static DDOrderQuery toActiveNotAssignedDDOrderQuery(final @NonNull DDOrderReferenceQuery query) { final DistributionFacetIdsCollection activeFacetIds = query.getActiveFacetIds(); final InSetPredicate<WarehouseId> warehouseToIds = extractWarehouseToIds(query); return newDDOrdersQuery() .orderBys(quer...
final Set<WarehouseId> facetWarehouseToIds = query.getActiveFacetIds().getWarehouseToIds(); final WarehouseId onlyWarehouseToId = query.getWarehouseToId(); if (onlyWarehouseToId != null) { if (facetWarehouseToIds.isEmpty() || facetWarehouseToIds.contains(onlyWarehouseToId)) { return InSetPredicate.only...
repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\service\DistributionJobQueries.java
2
请完成以下Java代码
public void executeHandler(DeleteProcessInstanceBatchConfiguration batchConfiguration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { commandContext.executeWithOperationLogPrevented( new Del...
int invocationsPerBatchJob) { // handle legacy batch entities (no up-front deployment mapping has been done) if (deploymentId == null && (configuration.getIdMappings() == null || configuration.getIdMappings().isEmpty())) { // create deployment mappings for the ids to process BatchElementConfiguratio...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\deletion\DeleteProcessInstancesJobHandler.java
1
请完成以下Java代码
public class RemoveTaskVariablesCmd extends NeedsActiveTaskCmd<Void> { private static final long serialVersionUID = 1L; private final Collection<String> variableNames; private final boolean isLocal; public RemoveTaskVariablesCmd(String taskId, Collection<String> variableNames, boolean isLocal) { ...
if (isLocal) { task.removeVariablesLocal(variableNames); } else { task.removeVariables(variableNames); } return null; } @Override protected String getSuspendedTaskExceptionPrefix() { return "Cannot remove variables from"; } }
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\RemoveTaskVariablesCmd.java
1
请完成以下Java代码
public MapFormat setArguments(final Map<String, ?> map) { if (map == null) { this._argumentsMap = ImmutableMap.of(); } else { this._argumentsMap = new HashMap<>(map); } return this; } public MapFormat setArguments(final List<Object> list) { setArguments(toArgumentsMap(list)); return this; ...
if (++offnum >= BUFSIZE) { throw new IllegalArgumentException("TooManyArguments"); } if (rightDelimiterIdx < 0) { if (exactMatch) { throw new IllegalArgumentException("UnmatchedBraces"); } else { break; } } outpat.append(patternStr.substring(idx, ...
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java-legacy\org\adempiere\util\text\MapFormat.java
1
请完成以下Java代码
public String getImportType() { return importTypeAttribute.getValue(this); } public void setImportType(String importType) { importTypeAttribute.setValue(this, importType); } public static void registerType(ModelBuilder modelBuilder) { ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(I...
namespaceAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAMESPACE) .build(); locationAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_LOCATION) .required() .build(); importTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPORT_TYPE) .required() .build(); ...
repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\ImportImpl.java
1
请完成以下Java代码
public class ByteArrayRef implements Serializable { private static final long serialVersionUID = 1L; private String id; private String name; private ByteArrayEntity entity; protected boolean deleted; public ByteArrayRef() {} // Only intended to be used by ByteArrayRefTypeHandler publ...
} } else { ensureInitialized(); entity.setBytes(bytes); } } public ByteArrayEntity getEntity() { ensureInitialized(); return entity; } public void delete() { if (!deleted && id != null) { if (entity != null) { ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ByteArrayRef.java
1
请完成以下Java代码
public void setX (final @Nullable java.lang.String X) { set_Value (COLUMNNAME_X, X); } @Override public java.lang.String getX() { return get_ValueAsString(COLUMNNAME_X); } @Override public void setX1 (final @Nullable java.lang.String X1) { set_Value (COLUMNNAME_X1, X1); } @Override public java.lan...
{ return get_ValueAsString(COLUMNNAME_Y); } @Override public void setZ (final @Nullable java.lang.String Z) { set_Value (COLUMNNAME_Z, Z); } @Override public java.lang.String getZ() { return get_ValueAsString(COLUMNNAME_Z); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_Inventory.java
1
请完成以下Java代码
public static Builder withId(@NonNull String registeredClientId, @NonNull String principalName) { Assert.hasText(registeredClientId, "registeredClientId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); return new Builder(registeredClientId, principalName); } /** * A builder ...
return this; } /** * Adds a {@link GrantedAuthority} to the collection of {@code authorities} in the * resulting {@link OAuth2AuthorizationConsent}. * @param authority the {@link GrantedAuthority} * @return the {@code Builder} for further configuration */ public Builder authority(GrantedAuthority ...
repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\OAuth2AuthorizationConsent.java
1
请完成以下Java代码
public class RootUriBuilderFactory extends RootUriTemplateHandler implements UriBuilderFactory { /** * Create an instance with the root URI to use. * @param rootUri the root URI * @param delegate the {@link UriTemplateHandler} to delegate to */ public RootUriBuilderFactory(String rootUri, UriTemplateHandler ...
@Override public UriBuilder builder() { return UriComponentsBuilder.newInstance(); } /** * Apply a {@link RootUriBuilderFactory} instance to the given {@link RestTemplate}. * @param restTemplate the {@link RestTemplate} to add the builder factory to * @param rootUri the root URI */ static void applyTo(Re...
repos\spring-boot-4.0.1\module\spring-boot-restclient\src\main\java\org\springframework\boot\restclient\RootUriBuilderFactory.java
1
请完成以下Java代码
public String getRemote_Addr () { return (String)get_Value(COLUMNNAME_Remote_Addr); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getRemote_Addr()); } /** Set Remote Host. @param Remote...
{ if (W_ClickCount_ID < 1) set_ValueNoCheck (COLUMNNAME_W_ClickCount_ID, null); else set_ValueNoCheck (COLUMNNAME_W_ClickCount_ID, Integer.valueOf(W_ClickCount_ID)); } /** Get Click Count. @return Web Click Management */ public int getW_ClickCount_ID () { Integer ii = (Integer)get_Value(COLUMNN...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Click.java
1
请完成以下Java代码
public IHUDisplayNameBuilder setShowHUPINameNextLine(final boolean showHUPINameNextLine) { this.showHUPINameNextLine = showHUPINameNextLine; return this; } protected String getHUValue() { final I_M_HU hu = getM_HU(); String huValue = hu.getValue(); if (Check.isEmpty(huValue, true)) { huValue = Stri...
new HUException("Aggregate HU's parent item has M_HU_PI_Item without an Included_HU_PI; parent-item=" + parentItem).throwIfDeveloperModeOrLogWarningElse(logger); return "?"; } final I_M_HU_PI included_HU_PI = handlingUnitsBL.getPI(includedPIId); return included_HU_PI.getName(); } // NOTE: this method can ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HUDisplayNameBuilder.java
1
请完成以下Java代码
public class GrpcServerShutdownEvent extends GrpcServerLifecycleEvent { private static final long serialVersionUID = 1L; /** * Creates a new GrpcServerShutdownEvent. * * @param lifecyle The lifecycle that caused this event. * @param clock The clock used to determine the timestamp. * @...
super(lifecyle, clock, server); } /** * Creates a new GrpcServerShutdownEvent. * * @param lifecyle The lifecycle that caused this event. * @param server The server related to this event. */ public GrpcServerShutdownEvent( final GrpcServerLifecycle lifecyle, ...
repos\grpc-spring-master\grpc-server-spring-boot-starter\src\main\java\net\devh\boot\grpc\server\event\GrpcServerShutdownEvent.java
1
请完成以下Java代码
public boolean isDropShip() { return BPartnerLocationId.ofRepoIdOrNull(getDropShip_BPartner_ID(), getDropShip_Location_ID()) != null; } @Override public int getM_Warehouse_ID() { return delegate.getM_Warehouse_ID(); } @Override public int getDropShip_BPartner_ID() { return delegate.getDropShip_BPartner...
} @Override public int getDropShip_User_ID() { return delegate.getDropShip_User_ID(); } @Override public void setDropShip_User_ID(final int DropShip_User_ID) { delegate.setDropShip_User_ID(DropShip_User_ID); } @Override public void setRenderedAddressAndCapturedLocation(final @NonNull RenderedAddressAnd...
repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\location\adapter\DropShipLocationAdapter.java
1
请完成以下Java代码
public class SEPA_Main_Validator implements ModelValidator { private int m_AD_Client_ID = -1; @Override public void initialize(final ModelValidationEngine engine, final MClient client) { if (client != null) { m_AD_Client_ID = client.getAD_Client_ID(); } engine.addModelValidator(new SEPA_Export_Line(),...
} @Override public String modelChange(final PO po, final int type) throws Exception { return null; // nothing to do } @Override public String docValidate(final PO po, final int timing) { return null; // nothing to do } }
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\base\src\main\java\de\metas\payment\sepa\model\validator\SEPA_Main_Validator.java
1
请完成以下Java代码
public void setProcessed (final boolean Processed) { set_Value (COLUMNNAME_Processed, Processed); } @Override public boolean isProcessed() { return get_ValueAsBoolean(COLUMNNAME_Processed); } @Override public void setProcessing (final boolean Processing) { set_Value (COLUMNNAME_Processing, Processing)...
@Override public void setS_TimeExpenseLine(final org.compiere.model.I_S_TimeExpenseLine S_TimeExpenseLine) { set_ValueFromPO(COLUMNNAME_S_TimeExpenseLine_ID, org.compiere.model.I_S_TimeExpenseLine.class, S_TimeExpenseLine); } @Override public void setS_TimeExpenseLine_ID (final int S_TimeExpenseLine_ID) { if...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ProjectIssue.java
1
请完成以下Java代码
private IHUQueryBuilder createHUQuery( @NonNull final WarehouseId warehouseId, @NonNull final ProductId productId, @NonNull final BPartnerId bpartnerId, @Nullable final AttributeSetInstanceId asiId, @Nullable final HUReservationDocRef reservedToDocumentOrNotReservedAtAll) { final Set<WarehouseId> pick...
} // FIXME: move it to AttributeDAO @Deprecated public boolean isAllowSqlWhenFilteringHUAttributes() { return sysConfigBL.getBooleanValue(SYSCONFIG_AllowSqlWhenFilteringHUAttributes, true); } public void transferReservation( @NonNull final HUReservationDocRef from, @NonNull final HUReservationDocRef to,...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\reservation\HUReservationService.java
1
请完成以下Java代码
public void addCacheResetListener(@NonNull final BusinessRulesChangedListener listener) { final ICacheResetListener cacheResetListener = (request) -> { listener.onRulesChanged(); return 1L; }; final CacheMgt cacheMgt = CacheMgt.get(); cacheMgt.addCacheResetListener(I_AD_BusinessRule.Table_Name, cacheRes...
private BusinessRuleLoader newLoader() { return BusinessRuleLoader.builder() .queryBL(queryBL) .build(); } public void validate(final I_AD_BusinessRule record) {newLoader().validate(record);} public void validate(final I_AD_BusinessRule_Precondition record) {newLoader().validate(record);} public void ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\business_rule\descriptor\BusinessRuleRepository.java
1
请完成以下Java代码
public boolean isPostOnlyForSomeOrgs() { return !postOnlyForOrgIds.isEmpty(); } public boolean isAllowPostingForOrg(@NonNull final OrgId orgId) { if (postOnlyForOrgIds.isEmpty()) { return true; } else { return postOnlyForOrgIds.contains(orgId); } } public boolean isDisallowPostingForOrg(@Non...
return getSchemaElements().isElementEnabled(elementType); } public AcctSchemaElement getSchemaElementByType(@NonNull final AcctSchemaElementType elementType) { return getSchemaElements().getByElementType(elementType); } public ImmutableSet<AcctSchemaElementType> getSchemaElementTypes() { return getSchemaEle...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\acct\api\AcctSchema.java
1
请完成以下Java代码
public List<ImmutablePair<String, String>> executeDeploymentIdMappingsList(CommandContext commandContext) { checkQueryOk(); return commandContext .getExternalTaskManager() .findDeploymentIdMappingsByQueryCriteria(this); } public String getExternalTaskId() { return externalTaskId; } ...
public String getProcessDefinitionId() { return processDefinitionId; } public String getProcessDefinitionName() { return processDefinitionName; } public String getProcessDefinitionNameLike() { return processDefinitionNameLike; } public String getActivityId() { return activityId; } pu...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\ExternalTaskQueryImpl.java
1
请完成以下Java代码
public class SAP_GLJournal_ReverseDocument extends JavaProcess implements IProcessPrecondition { private final static AdMessageKey DOCUMENT_MUST_BE_COMPLETED_MSG = AdMessageKey.of("gljournal_sap.Document_has_to_be_Completed"); private final SAPGLJournalService glJournalService = SpringContextHolder.instance.getBean(...
@Override protected String doIt() { final SAPGLJournal createdJournal = glJournalService.reverse(SAPGLJournalReverseRequest.builder() .sourceJournalId(SAPGLJournalId.ofRepoId(getRecord_ID())) .dateDoc(dateDoc) .build()); getResult().setRecordToOpen(T...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\gljournal_sap\process\SAP_GLJournal_ReverseDocument.java
1
请完成以下Spring Boot application配置
spring.application.name=spring-security-app server.servlet.context-path=/app server.port=8085 api.auth.header.name=x-auth-secret-key logging.level.org.springframework.security=DEBUG spring.profiles.active=inmemory spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.username=sa spring.datasource.password=passwo...
asource.driver-class-name=org.h2.Driver spring.sql.init.schema-locations=classpath:org/springframework/security/core/userdetails/jdbc/users.ddl
repos\tutorials-master\spring-security-modules\spring-security-web-boot-5\src\main\resources\application.properties
2
请完成以下Java代码
public String getInternalName() { if (internalName == null) { return Integer.toString(getNode_ID()); // fallback to avoid NPE. } return internalName; } public void setInternalName(final String internalName) { this.internalName = internalName; } private int AD_Window_ID = -1; private int AD_Process...
this.webuiNameBrowse = webuiNameBrowse; } public String getWEBUI_NameBrowse() { return webuiNameBrowse; } public void setWEBUI_NameNew(final String webuiNameNew) { this.webuiNameNew = webuiNameNew; } public String getWEBUI_NameNew() { return webuiNameNew; } public void setWEBUI_NameNewBreadcrumb(fi...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MTreeNode.java
1
请完成以下Java代码
public final I_AD_PrinterHW retrieveAttachToPrintPackagePrinter(final Properties ctx, final String hostkey, final String trxName) { final IQuery<I_AD_Printer_Config> queryConfig = queryBL.createQueryBuilder(I_AD_Printer_Config.class) .addEqualsFilter(I_AD_Printer_Config.COLUMN_ConfigHostKey, hostkey) .create...
.addOnlyActiveRecordsFilter() .orderBy(I_AD_PrinterHW.COLUMNNAME_AD_PrinterHW_ID) .create() .stream(); } @Override public List<I_AD_PrinterHW_MediaTray> retrieveMediaTrays(@NonNull final HardwarePrinterId hardwarePrinterId) { return queryBL.createQueryBuilder(I_AD_PrinterHW_MediaTray.class) .addO...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\api\impl\AbstractPrintingDAO.java
1
请完成以下Java代码
public void foundTomcatDeploymentDescriptor(String bpmPlatformFileLocation, String fileLocation) { logInfo( "046", "Found Camunda Platform configuration in CATALINA_BASE/CATALINA_HOME conf directory [{}] at '{}'", bpmPlatformFileLocation, fileLocation); } public ProcessEngineException invalidD...
} public void paDeployed(String name) { logInfo( "050", "Process application {} successfully deployed", name); } public void paUndeployed(String name) { logInfo( "051", "Process application {} undeployed", name); } }
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\ContainerIntegrationLogger.java
1
请完成以下Java代码
public Class<? extends DeploymentEntity> getManagedEntityClass() { return DeploymentEntityImpl.class; } @Override public DeploymentEntity create() { return new DeploymentEntityImpl(); } @Override public DeploymentEntity findLatestDeploymentByName(String deploymentName) { ...
} @Override @SuppressWarnings("unchecked") public List<Deployment> findDeploymentsByNativeQuery( Map<String, Object> parameterMap, int firstResult, int maxResults ) { return getDbSqlSession().selectListWithRawParameter( "selectDeploymentByNativeQuery", ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\data\impl\MybatisDeploymentDataManager.java
1
请完成以下Java代码
public int getM_InventoryLineMA_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_InventoryLineMA_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Bewegungs-Menge. @param MovementQty Quantity of a product moved. */ @Override public void setMovementQty (java.math.BigDecimal Move...
set_Value (COLUMNNAME_MovementQty, MovementQty); } /** Get Bewegungs-Menge. @return Quantity of a product moved. */ @Override public java.math.BigDecimal getMovementQty () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MovementQty); if (bd == null) return BigDecimal.ZERO; return bd; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_InventoryLineMA.java
1
请完成以下Java代码
public void init(){ // 实例化连接工厂 connectionFactory=new ActiveMQConnectionFactory(JMSProducerThread.USERNAME, JMSProducerThread.PASSWORD, JMSProducerThread.BROKEURL); try { connection=connectionFactory.createConnection(); // 通过连接工厂获取连接 connection.start(); } catch (JM...
/** * 发送消息 * @param session * @param messageProducer * @throws Exception */ public static void sendMessage(Session session,MessageProducer messageProducer)throws Exception{ for(int i=0;i<JMSProducerThread.SENDNUM;i++){ TextMessage message=session.createTextMessage("Activ...
repos\spring-boot-quick-master\quick-activemq\src\main\java\com\mq\client\JMSProducerThread.java
1
请完成以下Java代码
public boolean isManual () { Object oo = get_Value(COLUMNNAME_IsManual); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setNam...
/** Set SLA Criteria. @param PA_SLA_Criteria_ID Service Level Agreement Criteria */ public void setPA_SLA_Criteria_ID (int PA_SLA_Criteria_ID) { if (PA_SLA_Criteria_ID < 1) set_ValueNoCheck (COLUMNNAME_PA_SLA_Criteria_ID, null); else set_ValueNoCheck (COLUMNNAME_PA_SLA_Criteria_ID, Integer.valueOf...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_SLA_Criteria.java
1
请完成以下Java代码
private void makeElementColumnMandatory(final I_AD_Column elementIdColumn) { elementIdColumn.setIsMandatory(true); save(elementIdColumn); final TableDDLSyncService syncService = SpringContextHolder.instance.getBean(TableDDLSyncService.class); syncService.syncToDatabase(AdColumnId.ofRepoId(elementIdColumn.getA...
@Override public AdElementId createNewElement(@NonNull final CreateADElementRequest request) { final I_AD_Element record = newInstance(I_AD_Element.class); record.setName(request.getName()); record.setPrintName(request.getPrintName()); record.setDescription(request.getDescription()); record.setHelp(request....
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\element\api\impl\ADElementDAO.java
1
请在Spring Boot框架中完成以下Java代码
public String getComment() { return comment; } /** * Sets the value of the comment property. * * @param value * allowed object is * {@link String } * */ public void setComment(String value) { this.comment = value; } /** * Used t...
this.noPayment = value; } /** * Indicates that a direct debit will take place as a result of this invoice. * * @return * possible object is * {@link DirectDebitType } * */ public DirectDebitType getDirectDebit() { return directDebit; } /** ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\PaymentMethodType.java
2
请完成以下Java代码
public class KeycloakReactiveTokenInstrospector implements ReactiveOpaqueTokenIntrospector { private final ReactiveOpaqueTokenIntrospector delegate; public KeycloakReactiveTokenInstrospector(ReactiveOpaqueTokenIntrospector delegate) { this.delegate = delegate; } @Override public Mo...
// Map<String,List<String>> realm_access = principal.getAttribute("realm_access"); List<String> roles = realm_access.getOrDefault("roles", Collections.emptyList()); List<GrantedAuthority> rolesAuthorities = roles.stream() .map(SimpleGrantedAuthority::new) .collect...
repos\tutorials-master\spring-cloud-modules\spring-cloud-gateway\src\main\java\com\baeldung\springcloudgateway\oauth\shared\KeycloakReactiveTokenInstrospector.java
1
请完成以下Java代码
public boolean isValid() { return m_valid; } // isValid /** * Layout and Calculate Size * Set p_width & p_height * @return true if calculated */ protected boolean calculateSize () { p_width = 0; p_height = 0; if (m_barcode == null) return true; p_width = m_barcode.getWidth(); p_height ...
*/ public void paint (Graphics2D g2D, int pageNo, Point2D pageStart, Properties ctx, boolean isView) { if (!m_valid || m_barcode == null) return; // Position Point2D.Double location = getAbsoluteLocation(pageStart); int x = (int)location.x; if (MPrintFormatItem.FIELDALIGNMENTTYPE_TrailingRight.equal...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\layout\BarcodeElement.java
1
请完成以下Java代码
public PointOfInteractionCapabilities1 getCpblties() { return cpblties; } /** * Sets the value of the cpblties property. * * @param value * allowed object is * {@link PointOfInteractionCapabilities1 } * */ public void setCpblties(PointOfInteractionCa...
* <p> * For example, to add a new item, do as follows: * <pre> * getCmpnt().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link PointOfInteractionComponent1 } * * */ public List<PointOfInteractionComp...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\PointOfInteraction1.java
1
请在Spring Boot框架中完成以下Java代码
protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity .authorizeRequests() .antMatchers("/","/home","/about").permitAll() .antMatchers("/admin/**").hasAnyRole("ADMIN") .antMatchers("/user/**").hasAnyRole("USER") ...
} @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("user").password("user123").roles("USER") .and() .withUser("admin").password("admin123").roles("ADMIN"); } @Be...
repos\Spring-Boot-Advanced-Projects-main\Springboot-Security-Project\src\main\java\spring\security\config\SpringSecurityConfig.java
2
请在Spring Boot框架中完成以下Java代码
public class ParcelShippingService implements ShippingService { public static final String EVENT_ORDER_READY_FOR_SHIPMENT = "OrderReadyForShipmentEvent"; private ShippingOrderRepository orderRepository; private EventBus eventBus; private Map<Integer, Parcel> shippedParcels = new HashMap<>(); @Overr...
} }); } @Override public Optional<Parcel> getParcelByOrderId(int orderId) { return Optional.ofNullable(this.shippedParcels.get(orderId)); } public void setOrderRepository(ShippingOrderRepository orderRepository) { this.orderRepository = orderRepository; } @Override...
repos\tutorials-master\patterns-modules\ddd-contexts\ddd-contexts-shippingcontext\src\main\java\com\baeldung\dddcontexts\shippingcontext\service\ParcelShippingService.java
2
请完成以下Java代码
public TopicPartition getTopicPartition() { return this.topicPartition; } /** * The id of the listener (if {@code @KafkaListener}) or the container bean name. * @return the id. */ public String getListenerId() { return this.listenerId; } /** * Retrieve the consumer. Only populated if the listener is ...
* @return paused. * @since 2.1.5 */ public boolean isPaused() { return this.paused; } @Override public String toString() { return "ListenerContainerPartitionIdleEvent [idleTime=" + ((float) this.idleTime / 1000) + "s, listenerId=" + this.listenerId // NOSONAR magic # + ", container=" + getSource() ...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\event\ListenerContainerPartitionIdleEvent.java
1
请完成以下Java代码
protected final List<Consumer<T>> getCustomizers() { return this.customizers; } protected final List<Consumer<T>> mergedCustomizers(Consumer<T> customizer) { Assert.notNull(this.customizers, "'customizer' must not be null"); return merge(this.customizers, List.of(customizer)); } protected final List<Consume...
merged.addAll(additional); return List.copyOf(merged); } @Override @SuppressWarnings("unchecked") public final T build(@Nullable HttpClientSettings settings) { T factory = createClientHttpRequestFactory((settings != null) ? settings : HttpClientSettings.defaults()); LambdaSafe.callbacks(Consumer.class, this....
repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\AbstractClientHttpRequestFactoryBuilder.java
1