instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public class ConsumerApplication {
public static void main(String[] args) {
// 启动 Spring Boot 应用
ConfigurableApplicationContext context = SpringApplication.run(ConsumerApplication.class, args);
}
@Component
public class UserRpcServiceTest implements CommandLineRunner {
private... | // 发起调用
userRpcService.add(addDTO);
logger.info("[run][发起一次 Dubbo RPC 请求,添加用户为({})]", addDTO);
} catch (Exception e) {
logger.error("[run][添加用户发生异常,信息为:[{}]", e.getMessage());
}
}
}
@Component
public class UserRpcServiceTest03... | repos\SpringBoot-Labs-master\lab-30\lab-30-dubbo-xml-demo\user-rpc-service-consumer\src\main\java\cn\iocoder\springboot\lab30\rpc\ConsumerApplication.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class RateLimitInterceptor implements HandlerInterceptor {
private static final String HEADER_API_KEY = "X-api-key";
private static final String HEADER_LIMIT_REMAINING = "X-Rate-Limit-Remaining";
private static final String HEADER_RETRY_AFTER = "X-Rate-Limit-Retry-After-Seconds";
@Autowired
... | ConsumptionProbe probe = tokenBucket.tryConsumeAndReturnRemaining(1);
if (probe.isConsumed()) {
response.addHeader(HEADER_LIMIT_REMAINING, String.valueOf(probe.getRemainingTokens()));
return true;
} else {
long waitForRefill = probe.getNanosToWaitForRefill() / 1_0... | repos\tutorials-master\spring-boot-modules\spring-boot-libraries\src\main\java\com\baeldung\ratelimiting\bucket4japp\interceptor\RateLimitInterceptor.java | 2 |
请完成以下Java代码 | public BpmnEdge newInstance(ModelTypeInstanceContext instanceContext) {
return new BpmnEdgeImpl(instanceContext);
}
});
bpmnElementAttribute = typeBuilder.stringAttribute(BPMNDI_ATTRIBUTE_BPMN_ELEMENT)
.qNameAttributeReference(BaseElement.class)
.build();
sourceElementAttri... | return sourceElementAttribute.getReferenceTargetElement(this);
}
public void setSourceElement(DiagramElement sourceElement) {
sourceElementAttribute.setReferenceTargetElement(this, sourceElement);
}
public DiagramElement getTargetElement() {
return targetElementAttribute.getReferenceTargetElement(this... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\bpmndi\BpmnEdgeImpl.java | 1 |
请完成以下Java代码 | class ActiveMQClassicDockerComposeConnectionDetailsFactory
extends DockerComposeConnectionDetailsFactory<ActiveMQConnectionDetails> {
private static final int ACTIVEMQ_PORT = 61616;
protected ActiveMQClassicDockerComposeConnectionDetailsFactory() {
super("apache/activemq-classic");
}
@Override
protected Act... | }
@Override
public String getBrokerUrl() {
return this.brokerUrl;
}
@Override
public @Nullable String getUser() {
return this.environment.getUser();
}
@Override
public @Nullable String getPassword() {
return this.environment.getPassword();
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-activemq\src\main\java\org\springframework\boot\activemq\docker\compose\ActiveMQClassicDockerComposeConnectionDetailsFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UserDetailsService userDetailsServiceApp2() {
UserDetails user = User.withUsername("user")
.password(encoder().encode("user"))
.roles("USER")
.build();
return new InMemoryUserDetailsManager(user);
}
@Bean
public Secu... | .loginProcessingUrl("/user_login")
.failureUrl("/loginUser?error=loginError")
.defaultSuccessUrl("/userPage"))
// logout
.logout(httpSecurityLogoutConfigurer ->
httpSecurityLogoutConfigurer.logoutUrl(... | repos\tutorials-master\spring-security-modules\spring-security-web-boot-2\src\main\java\com\baeldung\multiplelogin\MultipleLoginSecurityConfig.java | 2 |
请完成以下Java代码 | private static AttributesIncludedTabFieldDescriptor toAttributesIncludedTabField(
@NonNull final AttributeId attributeId,
@NonNull final ImmutableMap<AttributeId, I_M_Attribute> attributesById)
{
final I_M_Attribute attribute = attributesById.get(attributeId);
if (attribute == null)
{
throw new Adempier... | //
private static class AttributesIncludedTabMap
{
private static final AttributesIncludedTabMap EMPTY = new AttributesIncludedTabMap(ImmutableList.of());
private final ImmutableListMultimap<AdTableId, AttributesIncludedTabDescriptor> byTableId;
private AttributesIncludedTabMap(final List<AttributesIncludedT... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\attributes_included_tab\descriptor\AttributesIncludedTabDescriptorService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OrderedArticleLineDuration orderedArticleLineDuration = (OrderedArticleLineDuration) o;
return Objects.equals(this.amount, orderedArticleLineDuration.amoun... | sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-orders-api\src\main\java\io\swagger\client\model\OrderedArticleLineDuration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class XmlBalance
{
/** expecting default = CHF */
@NonNull
String currency;
@NonNull
BigDecimal amount;
/** expecting default = 0 */
@NonNull
BigDecimal amountReminder;
/** expecting default = 0 */
@Nullable
BigDecimal amountPrepaid;
@NonNull
BigDecimal amountDue;
/** expecting default = 0 */
... | if (balanceMod.getAmount() != null)
{
builder.amount(balanceMod.getAmount());
}
if (balanceMod.getAmountDue() != null)
{
builder.amountDue(balanceMod.getAmountDue());
}
return builder
.vat(vat.withMod(balanceMod.getVatMod()))
.build();
}
@Value
@Builder
public static class BalanceMod
{
... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_xversion\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_xversion\request\model\payload\body\XmlBalance.java | 2 |
请完成以下Java代码 | public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getDepartName() {
return d... | return orgCategory;
}
public void setOrgCategory(String orgCategory) {
this.orgCategory = orgCategory;
}
public String getOrgType() {
return orgType;
}
public void setOrgType(String orgType) {
this.orgType = orgType;
}
public String getOrgCode() {
retu... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\system\vo\SysDepartModel.java | 1 |
请完成以下Java代码 | public String getState() {
return null;
}
@Override
public Date getInProgressStartTime() {
return null;
}
@Override
public String getInProgressStartedBy() {
return null;
}
@Override
public Date getClaimTime() {
return null;
}
@Override
... | return null;
}
@Override
public String getSuspendedBy() {
return null;
}
@Override
public Date getInProgressStartDueDate() {
return null;
}
@Override
public void setInProgressStartDueDate(Date inProgressStartDueDate) {
// nothing
}
} | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\TaskEntity.java | 1 |
请完成以下Java代码 | public void setQtyUsageVariance (final BigDecimal QtyUsageVariance)
{
set_Value (COLUMNNAME_QtyUsageVariance, QtyUsageVariance);
}
@Override
public BigDecimal getQtyUsageVariance()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyUsageVariance);
return bd != null ? bd : BigDecimal.ZERO;
}
@Ov... | return get_ValueAsTimestamp(COLUMNNAME_ValidTo);
}
/**
* VariantGroup AD_Reference_ID=540490
* Reference name: VariantGroup
*/
public static final int VARIANTGROUP_AD_Reference_ID=540490;
/** 01 = 01 */
public static final String VARIANTGROUP_01 = "01";
/** 02 = 02 */
public static final String VARIANTGR... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_BOMLine.java | 1 |
请完成以下Java代码 | protected String getShortClassName(final Class<?> cls)
{
if (cls != null && cls.isArray() && getDepth() > 0)
{
return "";
}
return super.getShortClassName(cls);
}
static class MutableInteger
{
private int value;
MutableInteger(final int value)
{
this.value = value;
} | public final int get()
{
return value;
}
public final void increment()
{
++value;
}
public final void decrement()
{
--value;
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\text\RecursiveIndentedMultilineToStringStyle.java | 1 |
请完成以下Java代码 | public FetchAndLockBuilderImpl asc() throws NotValidException {
configureLastOrderingPropertyDirection(ASCENDING);
return this;
}
public FetchAndLockBuilderImpl desc() throws NotValidException {
configureLastOrderingPropertyDirection(DESCENDING);
return this;
}
@Override
public ExternalTaskQ... | ensureNotNull(NotValidException.class, "You should call any of the orderBy methods first before specifying a direction", "currentOrderingProperty", lastProperty);
if (lastProperty.getDirection() != null) {
ensureNull(NotValidException.class, "Invalid query: can specify only one direction desc() or asc() for ... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\externaltask\FetchAndLockBuilderImpl.java | 1 |
请完成以下Java代码 | protected List<DelegateListener<? extends BaseDelegateExecution>> getListeners(CoreModelElement scope, T execution) {
if(execution.isSkipCustomListeners()) {
return getBuiltinListeners(scope);
} else {
return scope.getListeners(getEventName());
}
}
protected List<DelegateListener<? extends ... | return execution;
}
protected abstract CoreModelElement getScope(T execution);
protected abstract String getEventName();
protected abstract void eventNotificationsCompleted(T execution);
protected void eventNotificationsFailed(T execution, Exception exception) {
if (exception instanceof RuntimeException... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\operation\AbstractEventAtomicOperation.java | 1 |
请完成以下Java代码 | public class DevToolsSettings {
/**
* The location to look for settings properties. Can be present in multiple JAR files.
*/
public static final String SETTINGS_RESOURCE_LOCATION = "META-INF/spring-devtools.properties";
private static final Log logger = DevToolsLogFactory.getLog(DevToolsSettings.class);
priv... | public Map<String, Object> getPropertyDefaults() {
return Collections.unmodifiableMap(this.propertyDefaults);
}
private boolean isMatch(String url, List<Pattern> patterns) {
for (Pattern pattern : patterns) {
if (pattern.matcher(url).find()) {
return true;
}
}
return false;
}
public static DevTo... | repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\settings\DevToolsSettings.java | 1 |
请完成以下Java代码 | public void actionPerformed(final ActionEvent e) {
letterHtml = "";
letterPdfFile = null;
updateComponentsStatus();
}
};
public VLetterAttachment(final Dialog parentDialog) {
super();
this.parentDialog = parentDialog;
init();
}
private void init() {
fPreview.setText("");
fPreview.setPreferred... | this.add(bEdit);
this.add(bCancel);
}
private void updateComponentsStatus() {
fPreview.setText(letterHtml == null ? "" : letterHtml);
bCancel.setEnabled(!Check.isEmpty(letterHtml, false));
}
public void setVariables(final BoilerPlateContext variables) {
this.variables = variables;
}
public String getLe... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\ed\VLetterAttachment.java | 1 |
请完成以下Java代码 | public void updatePaymentImportTable(@NonNull final ImportRecordsSelection selection)
{
dbUpdateBPartners(selection);
dbUpdateInvoices(selection);
dbUpdateIsReceipt(selection);
dbUpdateErrorMessages(selection);
}
private void dbUpdateBPartners(@NonNull final ImportRecordsSelection selection)
{
StringBuil... | {
StringBuilder sql;
int no;
sql = new StringBuilder("UPDATE I_Datev_Payment ")
.append("SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No BPartner, ' ")
.append("WHERE C_BPartner_ID IS NULL ")
.append("AND I_IsImported<>'Y' ")
.append(selection.toSqlWhereClause());
no = DB.executeUpdateAndS... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\impexp\CPaymentImportTableSqlUpdater.java | 1 |
请完成以下Java代码 | public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
@Override
public String toString() { | return "Customer{" + "firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", age=" + age + '}';
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Customer cust... | repos\tutorials-master\apache-libraries-2\src\main\java\com\baeldung\apache\geode\Customer.java | 1 |
请完成以下Java代码 | public Map<String, Object> getProcessVariables() {
Map<String, Object> variables = new HashMap<>();
if (queryVariables != null) {
for (VariableInstanceEntity variableInstance : queryVariables) {
if (variableInstance.getId() != null && variableInstance.getTaskId() == null) {
... | getIdentityLinks().removeAll(identityLinks);
}
// NOT IN V5
@Override
public boolean isMultiInstanceRoot() {
return false;
}
@Override
public void setMultiInstanceRoot(boolean isMultiInstanceRoot) {
}
@Override
public String getPropagatedStageInstanceId() {
r... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ExecutionEntity.java | 1 |
请完成以下Java代码 | public void setQtyDelivered_LU (java.math.BigDecimal QtyDelivered_LU)
{
set_Value (COLUMNNAME_QtyDelivered_LU, QtyDelivered_LU);
}
/** Get Gelieferte Menge (LU).
@return Gelieferte Menge (LU)
*/
@Override
public java.math.BigDecimal getQtyDelivered_LU ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNA... | return bd;
}
/** Set Ausliefermenge (LU).
@param QtyToDeliver_LU Ausliefermenge (LU) */
@Override
public void setQtyToDeliver_LU (java.math.BigDecimal QtyToDeliver_LU)
{
set_Value (COLUMNNAME_QtyToDeliver_LU, QtyToDeliver_LU);
}
/** Get Ausliefermenge (LU).
@return Ausliefermenge (LU) */
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\tourplanning\model\X_M_Tour_Instance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static String validateString(final String field, final String errorMsg)
{
if (isEmpty(field))
{
throw new RuntimeCamelException(errorMsg);
}
return field;
}
/**
* Validate {@link Number}, and throw {@link RuntimeCamelException} if the field is null or 0.
*
* @param field
* @param errorMsg
... | {
if (field == null || field.intValue() == 0)
{
throw new RuntimeCamelException(errorMsg);
}
return field;
}
public static List<?> validateList(final List<?> field, final String errorMsg)
{
if (field == null || field.isEmpty())
{
throw new RuntimeCamelException(errorMsg);
}
return field;
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\commons\ValidationHelper.java | 2 |
请在Spring Boot框架中完成以下Java代码 | static DelegatingMethodSecurityMetadataSource methodMetadataSource(
MethodSecurityExpressionHandler methodSecurityExpressionHandler) {
ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory(
methodSecurityExpressionHandler);
PrePostAnnotationSecurityMetadat... | handler.setDefaultRolePrefix(configuration.grantedAuthorityDefaults.getRolePrefix());
}
return handler;
}
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.advisorOrder = (int) importMetadata.getAnnotationAttributes(EnableReactiveMethodSecurity.class.getName())
.get("order")... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\method\configuration\ReactiveMethodSecurityConfiguration.java | 2 |
请完成以下Java代码 | private @NonNull SumUpTransactionExternalId findTransactionToRefundByPOSRef(final @NonNull SumUpPOSRef posRef)
{
if (posRef.getPosPaymentId() <= 0)
{
throw new AdempiereException("posPaymentId not provided");
}
final List<SumUpTransaction> trxs = trxRepository.stream(SumUpTransactionQuery.builder()
.... | }
else
{
return trxs.get(0).getExternalId();
}
}
public SumUpTransaction refundTransaction(@NonNull final SumUpTransactionExternalId id)
{
return trxRepository.updateById(id, trx -> {
final SumUpConfig config = configRepository.getById(trx.getConfigId());
final SumUpClient client = clientFactory.ne... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sumup\src\main\java\de\metas\payment\sumup\SumUpService.java | 1 |
请完成以下Java代码 | public VariableInstanceQuery excludeVariableInitialization() {
wrappedVariableInstanceQuery.excludeVariableInitialization();
return this;
}
@Override
public VariableInstanceQuery variableValueEquals(String variableName, Object variableValue) {
wrappedVariableInstanceQuery.variableVa... | return this;
}
@Override
public long count() {
return wrappedVariableInstanceQuery.count();
}
@Override
public VariableInstance singleResult() {
return wrappedVariableInstanceQuery.singleResult();
}
@Override
public List<VariableInstance> list() {
return wr... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\runtime\CmmnVariableInstanceQueryImpl.java | 1 |
请完成以下Java代码 | public void onChatEvent(SocketIOClient client, AckRequest request, SingleMessageRequest data) {
Optional<UUID> toUser = dbTemplate.findByUserId(data.getToUid());
if (toUser.isPresent()) {
log.info("用户 {} 刚刚私信了用户 {}:{}", data.getFromUid(), data.getToUid(), data.getMessage());
send... | public void sendToSingle(UUID sessionId, SingleMessageRequest message) {
server.getClient(sessionId).sendEvent(Event.CHAT, message);
}
/**
* 广播
*/
public void sendToBroadcast(BroadcastMessageRequest message) {
log.info("系统紧急广播一条通知:{}", message.getMessage());
for (UUID clie... | repos\spring-boot-demo-master\demo-websocket-socketio\src\main\java\com\xkcoding\websocket\socketio\handler\MessageEventHandler.java | 1 |
请完成以下Java代码 | protected void runPreExportHook(final TableRecordReference recordReferenceToExport)
{
}
private void exportIfAlreadyExportedOnce(@NonNull final I_M_HU_Trace huTrace)
{
final ExportHUCandidate exportHUCandidate = ExportHUCandidate.builder()
.huId(HuId.ofRepoId(huTrace.getM_HU_ID()))
.linkedSourceVHuId(HuI... | private boolean shouldExportDirectly(@NonNull final I_M_HU_Trace huTrace)
{
final HUTraceType huTraceType = HUTraceType.ofCode(huTrace.getHUTraceType());
final boolean purchasedOrProduced = huTraceType.equals(MATERIAL_RECEIPT) || huTraceType.equals(PRODUCTION_RECEIPT);
final boolean docCompleted = DocStatus.of... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\grssignum\ExportHUToGRSService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getRequest() {
return request;
}
/** 请求信息 **/
public void setRequest(String request) {
this.request = request == null ? null : request.trim();
}
/** 返回信息 **/
public String getResponse() {
return response;
}
/** 返回信息 **/
public void setResponse... | public String getMerchantOrderNo() {
return merchantOrderNo;
}
/** 商户订单号 **/
public void setMerchantOrderNo(String merchantOrderNo) {
this.merchantOrderNo = merchantOrderNo == null ? null : merchantOrderNo.trim();
}
/** HTTP状态 **/
public Integer getHttpStatus() {
return... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\notify\entity\RpNotifyRecordLog.java | 2 |
请完成以下Java代码 | public PO getPO(final int Record_ID, final String trxName)
{
final Properties ctx = getCtx();
final String tableName = getTableName();
return TableModelLoader.instance.getPO(ctx, tableName, Record_ID, trxName);
}
/**
*
* @return tableName's model class
* @deprecated Please use {@link TableModelClassLoad... | // which could be OK on our local development database,
// but when the migration script will be executed on target customer database, their sequences will be wrongly changed (08607)
if (success && newRecord)
{
final ISequenceDAO sequenceDAO = Services.get(ISequenceDAO.class);
sequenceDAO.createTableSequenc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MTable.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonWorkflowLauncher
{
@NonNull String applicationId;
@NonNull String caption;
@Nullable String startedWFProcessId;
@NonNull Map<String, Object> wfParameters;
@Nullable WorkflowLauncherIndicator indicator;
boolean showWarningSign;
@Nullable JsonTestId testId;
public static JsonWorkflowLauncher of(... | final String applicationId = workflowLauncher.getApplicationId().getAsString();
Params wfParameters = workflowLauncher.getWfParameters();
if (startedWFProcessId == null)
{
wfParameters = wfParameters.withParameter(JsonWFProcessStartRequest.PARAM_ApplicationId, applicationId);
}
return builder()
.appl... | repos\metasfresh-new_dawn_uat\backend\de.metas.workflow.rest-api\src\main\java\de\metas\workflow\rest_api\controller\v2\json\JsonWorkflowLauncher.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class MainApplication {
@Autowired
private BookstoreService bookstoreService;
public static void main(String[] args) {
SpringApplication.run(MainApplication.class, args);
}
@Bean
public ApplicationRunner init() {
return args -> {
System.out.println("\nCall A... | System.out.println("\nCall AuthorRepository#findAll(Specification):");
bookstoreService.displayAuthorsWithBooksAndPublishersWithSpec();
System.out.println("\nCall PublisherRepository#findAll():");
bookstoreService.displayPublishersWithBooksAndAuthors();
System.out.print... | repos\Hibernate-SpringBoot-master\HibernateSpringBootNamedSubgraph\src\main\java\com\bookstore\MainApplication.java | 2 |
请完成以下Java代码 | public long executeCount(CommandContext commandContext) {
checkQueryOk();
return
commandContext
.getStatisticsManager()
.getStatisticsCountGroupedByProcessDefinitionVersion(this);
}
@Override
public List<ProcessDefinitionStatistics> executeList(CommandContext commandContext,
P... | public boolean isFailedJobsToInclude() {
return includeFailedJobs;
}
public boolean isIncidentsToInclude() {
return includeIncidents || includeRootIncidents || includeIncidentsForType != null;
}
protected void checkQueryOk() {
super.checkQueryOk();
if (includeIncidents && includeIncidentsForTy... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\ProcessDefinitionStatisticsQueryImpl.java | 1 |
请完成以下Java代码 | class ReflectionEnvironmentPostProcessorsFactory implements EnvironmentPostProcessorsFactory {
private final @Nullable List<Class<?>> classes;
private @Nullable ClassLoader classLoader;
private @Nullable final List<String> classNames;
ReflectionEnvironmentPostProcessorsFactory(Class<?>... classes) {
this.clas... | (parameters) -> {
parameters.add(DeferredLogFactory.class, logFactory);
parameters.add(Log.class, logFactory::getLog);
parameters.add(ConfigurableBootstrapContext.class, bootstrapContext);
parameters.add(BootstrapContext.class, bootstrapContext);
parameters.add(BootstrapRegistry.class, bootstra... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\support\ReflectionEnvironmentPostProcessorsFactory.java | 1 |
请完成以下Java代码 | public void setIsExclude (boolean IsExclude)
{
set_Value (COLUMNNAME_IsExclude, Boolean.valueOf(IsExclude));
}
/** Get Ausschluß.
@return Exclude access to the data - if not selected Include access to the data
*/
@Override
public boolean isExclude ()
{
Object oo = get_Value(COLUMNNAME_IsExclude);
if ... | @return Field is read only
*/
@Override
public boolean isReadOnly ()
{
Object oo = get_Value(COLUMNNAME_IsReadOnly);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Column_Access.java | 1 |
请完成以下Java代码 | default int size()
{
return getDocumentId2TopLevelRows().size();
}
/* private */default Map<DocumentId, T> getDocumentId2AllRows()
{
return RowsDataTool.extractAllRows(getDocumentId2TopLevelRows().values());
}
/** @return all rows (top level and included ones) */
default Collection<T> getAllRows()
{
ret... | if (row == null)
{
throw new EntityNotFoundException("Row not found")
.appendParametersToMessage()
.setParameter("rowId", rowId);
}
return row;
}
@Nullable
default T getByIdOrNull(final DocumentId rowId)
{
return getDocumentId2AllRows().get(rowId);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\template\IRowsData.java | 1 |
请完成以下Java代码 | public Object clone()
{
return getDelegate().clone();
}
@Override
public String toString()
{
return getDelegate().toString();
}
@Override
public Set<Object> keySet()
{
return getDelegate().keySet();
}
@Override
public Set<java.util.Map.Entry<Object, Object>> entrySet()
{
return getDelegate().ent... | public String getProperty(String key)
{
return getDelegate().getProperty(key);
}
@Override
public String getProperty(String key, String defaultValue)
{
return getDelegate().getProperty(key, defaultValue);
}
@Override
public Enumeration<?> propertyNames()
{
return getDelegate().propertyNames();
}
@Ov... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\AbstractPropertiesProxy.java | 1 |
请完成以下Java代码 | public void close(final ViewCloseAction action)
{
if (action.isDone())
{
closePickingCandidatesFromRackSystemPickingSlots();
}
}
private void closePickingCandidatesFromRackSystemPickingSlots()
{
final Set<ShipmentScheduleId> shipmentScheduleIds = getRows()
.stream()
.map(PackageableRow::getShipm... | }
public void removePickingSlotView(@NonNull final DocumentId rowId, @NonNull final ViewCloseAction viewCloseAction)
{
final PickingSlotView view = pickingSlotsViewByRowId.remove(rowId);
if (view != null)
{
view.close(viewCloseAction);
}
}
public PickingSlotView getPickingSlotViewOrNull(@NonNull final ... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\packageable\PackageableView.java | 1 |
请完成以下Java代码 | public java.lang.String getGTIN_PackingMaterial()
{
return get_ValueAsString(COLUMNNAME_GTIN_PackingMaterial);
}
@Override
public void setIPA_SSCC18 (final java.lang.String IPA_SSCC18)
{
set_Value (COLUMNNAME_IPA_SSCC18, IPA_SSCC18);
}
@Override
public java.lang.String getIPA_SSCC18()
{
return get_Va... | public void setM_HU_PackagingCode_Text (final @Nullable java.lang.String M_HU_PackagingCode_Text)
{
throw new IllegalArgumentException ("M_HU_PackagingCode_Text is virtual column"); }
@Override
public java.lang.String getM_HU_PackagingCode_Text()
{
return get_ValueAsString(COLUMNNAME_M_HU_PackagingCode_Text);... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_Desadv_Pack.java | 1 |
请完成以下Java代码 | public int getPickFrom_Locator_ID()
{
return get_ValueAsInt(COLUMNNAME_PickFrom_Locator_ID);
}
@Override
public void setPickFrom_Warehouse_ID (final int PickFrom_Warehouse_ID)
{
if (PickFrom_Warehouse_ID < 1)
set_Value (COLUMNNAME_PickFrom_Warehouse_ID, null);
else
set_Value (COLUMNNAME_PickFrom_Wa... | }
@Override
public java.lang.String getRejectReason()
{
return get_ValueAsString(COLUMNNAME_RejectReason);
}
/**
* Status AD_Reference_ID=541435
* Reference name: DD_OrderLine_Schedule_Status
*/
public static final int STATUS_AD_Reference_ID=541435;
/** NotStarted = NS */
public static final String ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_DD_Order_MoveSchedule.java | 1 |
请完成以下Java代码 | protected JobHandlerConfiguration getJobHandlerConfiguration() {
if (processDefinitionId != null) {
return ProcessDefinitionSuspensionStateConfiguration.byProcessDefinitionId(processDefinitionId, isIncludeSubResources());
} else if (isTenantIdSet) {
return ProcessDefinitionSuspensionStateConfigura... | protected abstract String getDelayedExecutionJobHandlerType();
/**
* Subclasses should return the type of the {@link AbstractSetJobDefinitionStateCmd} here.
* It will be used to suspend or activate the {@link JobDefinition}s.
* @param jobDefinitionSuspensionStateBuilder
*/
protected abstract AbstractSe... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\AbstractSetProcessDefinitionStateCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private ImmutableMultimap<Path, JsonPrintingSegment> extractAndAssignPaths(
@NonNull final JsonPrintingData printingData,
@NonNull final String baseDirectory)
{
final ImmutableMultimap.Builder<Path, JsonPrintingSegment> path2Segments = new ImmutableMultimap.Builder<>();
for (final JsonPrintingSegment segmen... | break;
}
}
if(path == null)
{
throw new PrintingException("Shouldn't happen. Segment has TrayId, that doesn't exist in Trays of PrinterHW");
}
}
else
{
path = Paths.get(baseDirectory, FileUtil.stripIllegalCharacters(printer.getName()));
}
path2Segments.put(path, segment);
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-printingclient\src\main\java\de\metas\camel\externalsystems\PrintingClientPDFFileStorer.java | 2 |
请完成以下Java代码 | public <T extends CostCalculationMethodParams> T castParams(@Nullable final CostCalculationMethodParams params, @NonNull final Class<T> type)
{
if (params == null)
{
throw new AdempiereException("No calculation method parameters provided for " + type.getSimpleName());
}
return type.cast(params);
}
public... | public <T> T map(@NonNull final CaseMapper<T> mapper)
{
if (this == CostCalculationMethod.FixedAmount)
{
return mapper.fixedAmount();
}
else if (this == CostCalculationMethod.PercentageOfAmount)
{
return mapper.percentageOfAmount();
}
else
{
throw new AdempiereException("Calculation method not... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\calculation_methods\CostCalculationMethod.java | 1 |
请完成以下Java代码 | public void setEntityType (String EntityType)
{
set_ValueNoCheck (COLUMNNAME_EntityType, EntityType);
}
/** Get Entity Type.
@return Dictionary Entity Type; Determines ownership and synchronization
*/
public String getEntityType ()
{
return (String)get_Value(COLUMNNAME_EntityType);
}
/** Set Comment... | }
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Modification.java | 1 |
请完成以下Java代码 | public class PropertyBasedCorsFilter extends AbstractHttpConfigurer<PropertyBasedCorsFilter, HttpSecurity> {
protected final RestAppProperties restAppProperties;
public PropertyBasedCorsFilter(RestAppProperties restAppProperties) {
this.restAppProperties = restAppProperties;
}
@Override
... | for (String header : cors.getAllowedHeaders()) {
config.addAllowedHeader(header);
}
for (String exposedHeader : cors.getExposedHeaders()) {
config.addExposedHeader(exposedHeader);
}
for (String method : cors.getAllowedMethods()) {
config.addAllowedMeth... | repos\flowable-engine-main\modules\flowable-app-rest\src\main\java\org\flowable\rest\conf\PropertyBasedCorsFilter.java | 1 |
请完成以下Java代码 | public DDOrderMoveSchedule createScheduleToMove(@NonNull final DDOrderMoveScheduleCreateRequest request)
{
final I_DD_Order_MoveSchedule record = InterfaceWrapperHelper.newInstance(I_DD_Order_MoveSchedule.class);
//record.setAD_Org_ID(ddOrderline.getAD_Org_ID());
record.setDD_Order_ID(request.getDdOrderId().getR... | {
warmUpById(id);
final I_DD_Order_MoveSchedule record = getRecordById(id);
final DDOrderMoveSchedule schedule = fromRecord(record);
updater.accept(schedule);
save(schedule);
return schedule;
}
public ImmutableList<DDOrderMoveSchedule> updateByIds(final Set<DDOrderMoveScheduleId> ids, Consumer<DDOrderMo... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\movement\schedule\DDOrderMoveScheduleLoaderAndSaver.java | 1 |
请完成以下Java代码 | public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof Square)) {
return false;
}
Square other = (Square) obj;
if (color == null) {
... | } else if (!color.equals(other.color)) {
return false;
}
return true;
}
protected Color getColor() {
return color;
}
protected void setColor(Color color) {
this.color = color;
}
} | repos\tutorials-master\core-java-modules\core-java-lang-8\src\main\java\com\baeldung\equalshashcode\entities\Square.java | 1 |
请完成以下Java代码 | public ListenableFuture<String> getCustomerName() {
String[] names = new String[] { "Mark", "Jane", "June" };
return lExecService.submit(() -> {
TimeUnit.MILLISECONDS.sleep(500);
return names[new Random().nextInt(names.length)];
});
}
public ListenableFuture<List... | return lExecService.submit(() -> {
TimeUnit.MILLISECONDS.sleep(500);
return firstName.replaceAll("[^a-zA-Z]+","")
.concat("@service.com");
});
}
public ListenableFuture<String> generatePassword(String username) {
return lExecService.submit(() -> {
... | repos\tutorials-master\guava-modules\guava-concurrency\src\main\java\com\baeldung\guava\future\ListenableFutureService.java | 1 |
请完成以下Java代码 | public void propertyChange (PropertyChangeEvent e)
{
MTreeNode tn = (MTreeNode)e.getNewValue();
log.info(tn.toString());
if (tn == null)
return;
ListModel model = centerList.getModel();
int size = model.getSize();
int index = -1;
for (index = 0; index < size; index++)
{
ListItem item = (ListItem)... | {
MTreeNode info = new MTreeNode(item.id, 0, item.name, item.description, -1,
item.isSummary, item.imageIndicator, false, null);
centerTree.nodeChanged(false, info);
deleteNode(item);
}
} // action_treeDelete
/**
* Action: Add All Nodes to Tree
*/
private void action_treeAddAll()
{
log... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\form\VTreeMaintenance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Foo implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(nullable = false)
private String name;
public Foo() {
super();
}
public Foo(final String name) {
super();
this.name = name;
}
publi... | result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return fa... | repos\tutorials-master\persistence-modules\spring-data-jpa-repo\src\main\java\com\baeldung\jpa\domain\Foo.java | 2 |
请完成以下Java代码 | public BigDecimal getQtyToAllocate()
{
return qtyToAllocate;
}
@Override
public BigDecimal getQtyAllocated()
{
return qtyToAllocateInitial.subtract(qtyToAllocate);
}
@Override
public void addTransaction(final IHUTransactionCandidate trx)
{
transactions.add(trx);
}
@Override
public void addTransacti... | @Override
public void addAttributeTransactions(final List<IHUTransactionAttribute> attributeTrxs)
{
attributeTransactions.addAll(attributeTrxs);
}
@Override
public List<IHUTransactionAttribute> getAttributeTransactions()
{
return attributeTransactionsRO;
}
@Override
public void aggregateTransactions()
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\MutableAllocationResult.java | 1 |
请完成以下Java代码 | public class MetricsResourceImpl implements MetricsResource {
protected String metricsName;
protected ProcessEngine processEngine;
protected ObjectMapper objectMapper;
public MetricsResourceImpl(String metricsName, ProcessEngine processEngine, ObjectMapper objectMapper) {
this.metricsName = metricsName;
... | query.endDate(endDate);
}
}
protected Date extractEndDate(MultivaluedMap<String, String> queryParameters, DateConverter dateConverter) {
if(queryParameters.getFirst("endDate") != null) {
return dateConverter.convertQueryParameterToType(queryParameters.getFirst("endDate"));
}
return null;
}
... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\metrics\MetricsResourceImpl.java | 1 |
请完成以下Java代码 | public class ClearPickingSlot extends JavaProcess implements IProcessPrecondition
{
private final SpringContextHolder.Lazy<PickingSlotService> pickingSlotServiceLazy = SpringContextHolder.lazyBean(PickingSlotService.class);
@Param(parameterName = "ForceRemoveForOngoingJobs")
private boolean forceRemoveForOngoingJob... | }
return ProcessPreconditionsResolution.accept();
}
@Override
protected String doIt() throws Exception
{
pickingSlotServiceLazy.get().releasePickingSlot(ReleasePickingSlotRequest.builder()
.pickingSlotId(PickingSlotId.ofRepoId(getRecord_ID()))
.isForceRemoveForOngoingJobs(force... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\process\ClearPickingSlot.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isSigningCredential() {
return getCredentialTypes().contains(Saml2X509CredentialType.SIGNING);
}
/**
* Indicate whether this credential can be used for decryption
* @return true if the credential has a {@link Saml2X509CredentialType#DECRYPTION}
* type
*/
public boolean isDecryptionCredentia... | for (Saml2X509CredentialType usage : usages) {
boolean valid = false;
for (Saml2X509CredentialType validUsage : validUsages) {
if (usage == validUsage) {
valid = true;
break;
}
}
Assert.state(valid, () -> usage + " is not a valid usage for this credential");
}
}
public enum Saml2X509C... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\core\Saml2X509Credential.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private boolean isSameUnderlyingResource(Resource ours, Resource other) {
return ours.equals(other) || isSameFile(getUnderlyingFile(ours), getUnderlyingFile(other));
}
private boolean isSameFile(@Nullable File ours, @Nullable File other) {
return (ours != null) && ours.equals(other);
}
@Override
public int h... | return this.resource.toString();
}
private @Nullable File getUnderlyingFile(Resource resource) {
try {
if (resource instanceof ClassPathResource || resource instanceof FileSystemResource
|| resource instanceof FileUrlResource) {
return resource.getFile().getAbsoluteFile();
}
}
catch (IOException... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\StandardConfigDataResource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public abstract class OnEnabledComponent<T> extends SpringBootCondition implements ConfigurationCondition {
private static final String PREFIX = "spring.cloud.gateway.server.webflux.";
private static final String SUFFIX = ".enabled";
@Override
public ConfigurationPhase getConfigurationPhase() {
return Configur... | context.getClassLoader());
}
catch (Throwable ex) {
throw new IllegalStateException("Failed to extract component class for "
+ methodMetadata.getDeclaringClassName() + "." + methodMetadata.getMethodName(), ex);
}
}
private ConditionOutcome determineOutcome(Class<? extends T> componentClass, PropertyRes... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\config\conditional\OnEnabledComponent.java | 2 |
请完成以下Java代码 | public class UserDetailParam {
private String userId;
private Integer minAge;
private Integer maxAge;
private String realName;
private String introduction;
private String city;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.... | return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getCity() {
... | repos\spring-boot-leaning-master\2.x_42_courses\第 3-4 课: Spring Data JPA 的基本使用\spring-boot-jpa\src\main\java\com\neo\param\UserDetailParam.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DemoServiceImpl implements DemoService {
@Autowired
private PersonRepository personRepository;
@Override
//@CachePut缓存新增的或更新的数据到缓存,其中缓存名字是 people 。数据的key是person的id
@CachePut(value = "people", key = "#person.id")
public Person save(Person person) {
Person p = personReposito... | @CacheEvict(value = "people")
public void remove(Long id) {
System.out.println("删除了id、key为"+id+"的数据缓存");
//这里不做实际删除操作
}
@Override
//@Cacheable缓存key为person 的id 数据到缓存people 中,如果没有指定key则方法参数作为key保存到缓存中。
@Cacheable(value = "people", key = "#person.id")
public Person findOne(Person p... | repos\springBoot-master\springboot-Cache\src\main\java\com\us\example\service\Impl\DemoServiceImpl.java | 2 |
请完成以下Java代码 | private Inventory assigningTo(@NonNull final UserId newResponsibleId, boolean allowReassignment)
{
// no responsible change
if (UserId.equals(responsibleId, newResponsibleId))
{
return this;
}
if (!newResponsibleId.isRegularUser())
{
throw new AdempiereException("Only regular users can be assigned t... | return onlyLineId != null
? Stream.of(getLineById(onlyLineId))
: lines.stream();
}
public Set<LocatorId> getLocatorIdsEligibleForCounting(@Nullable final InventoryLineId onlyLineId)
{
return streamLines(onlyLineId)
.filter(InventoryLine::isEligibleForCounting)
.map(InventoryLine::getLocatorId)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\Inventory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PP_Order_CopyTemplateCustomizer implements CopyTemplateCustomizer
{
@Override
public String getTableName() {return I_PP_Order.Table_Name;}
@Override
public ValueToCopy extractValueToCopy(final POInfo poInfo, final String columnName)
{
if (de.metas.materialtracking.model.I_PP_Order.COLUMNNAME_QtyOrd... | private static BigDecimal computeQtyOrdered(final ValueToCopyResolveContext context)
{
final PO from = context.getFrom();
final BigDecimal qtyOrderedBeforeOrderClose = from.get_ValueAsBigDecimal(de.metas.materialtracking.model.I_PP_Order.COLUMNNAME_QtyBeforeClose);
final BigDecimal qtyEntered = from.get_ValueAs... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\model\validator\PP_Order_CopyTemplateCustomizer.java | 2 |
请完成以下Java代码 | private void resetManualFlags(final I_C_OrderLine orderLineRecord)
{
orderLineRecord.setIsManualDiscount(false);
orderLineRecord.setIsManualPrice(false);
orderLineRecord.setIsManualPaymentTerm(false);
orderLineBL.updatePrices(orderLineRecord); // see task 06727
}
@CalloutMethod(columnNames = { I_C_OrderLin... | I_C_OrderLine.COLUMNNAME_C_BPartner_ID,
I_C_OrderLine.COLUMNNAME_C_BPartner_Location_ID },
skipIfCopying = true)
public void updateBPartnerAddress(final I_C_OrderLine orderLine)
{
documentLocationBL.updateRenderedAddressAndCapturedLocation(OrderLineDocumentLocationAdapterFactory.locationAdapter(orderLine));
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\order\callout\C_OrderLine.java | 1 |
请完成以下Java代码 | class FileProducer implements Runnable {
private final BlockingQueue<String> queue;
private final String inputFileName;
public FileProducer(BlockingQueue<String> queue, String inputFileName) {
this.queue = queue;
this.inputFileName = inputFileName;
}
@Override
public void run(... | public FileConsumer(BlockingQueue queue, String outputFileName) {
this.queue = queue;
this.outputFileName = outputFileName;
}
@Override
public void run() {
try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputFileName))) {
String line;
while (... | repos\tutorials-master\core-java-modules\core-java-io-5\src\main\java\com\baeldung\readwritethread\ReadWriteBlockingQueue.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public R<List<DeptVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> dept, BladeUser bladeUser) {
QueryWrapper<Dept> queryWrapper = Condition.getQueryWrapper(dept, Dept.class);
List<Dept> list = deptService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambd... | public R submit(@Valid @RequestBody Dept dept) {
return R.status(deptService.submit(dept));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 5)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
... | repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\controller\DeptController.java | 2 |
请完成以下Java代码 | public boolean isInternalUseInventory()
{
return inventoryType.isInternalUse();
}
public InventoryLine getLineById(@NonNull final InventoryLineId inventoryLineId)
{
return lines.stream()
.filter(line -> inventoryLineId.equals(line.getId()))
.findFirst()
.orElseThrow(() -> new AdempiereException("No... | return toBuilder().responsibleId(newResponsibleId).build();
}
public Inventory unassign()
{
return responsibleId == null ? this : toBuilder().responsibleId(null).build();
}
public void assertHasAccess(@NonNull final UserId calledId)
{
if (!UserId.equals(responsibleId, calledId))
{
throw new AdempiereEx... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\Inventory.java | 1 |
请完成以下Java代码 | protected JmxManagedProcessEngineController createProcessEngineControllerInstance(ProcessEngineConfigurationImpl configuration) {
return new JmxManagedProcessEngineController(configuration);
}
/**
* <p>Instantiates and applies all {@link ProcessEnginePlugin}s defined in the processEngineXml
*/
protecte... | }
catch (ClassCastException e) {
throw LOG.configurationClassHasWrongType(className, clazz, e);
}
}
/**
* Add additional plugins that are not declared in the process engine xml.
*/
protected void addAdditionalPlugins(ProcessEngineConfigurationImpl configuration) {
// do nothing
}
pro... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\deployment\StartProcessEngineStep.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void notifyOrderCreated(Order order) {
tpl.execute("NOTIFY " + ORDERS_CHANNEL + ", '" + order.getId() + "'");
}
public Runnable createNotificationHandler(Consumer<PGNotification> consumer) {
return () -> {
tpl.execute((Connection c) -> {
log.info(... | if ( nts == null || nts.length == 0 ) {
continue;
}
for( PGNotification nt : nts) {
consumer.accept(nt);
}
}
return 0;
});
... | repos\tutorials-master\messaging-modules\postgres-notify\src\main\java\com\baeldung\messaging\postgresql\service\NotifierService.java | 2 |
请完成以下Java代码 | public ViewRowIdsOrderedSelection getOrderedSelection(@Nullable final DocumentQueryOrderByList orderBys)
{
if(orderBys == null || orderBys.isEmpty())
{
return getDefaultSelection();
}
return computeCurrentSelections(selections -> computeOrderBySelectionIfAbsent(selections, orderBys))
.getSelection(or... | final SqlDocumentFilterConverterContext filterConverterContext = SqlDocumentFilterConverterContext.builder()
.userRolePermissionsKey(viewEvaluationCtx.getPermissionsKey())
.build();
return viewDataRepository.createOrderedSelectionFromSelection(
viewEvaluationCtx,
fromSelection,
DocumentFilterList... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewRowIdsOrderedSelectionsHolder.java | 1 |
请完成以下Java代码 | public class PactDto {
private boolean condition;
private String name;
public PactDto() {
}
public PactDto(boolean condition, String name) {
super();
this.condition = condition;
this.name = name;
}
public boolean isCondition() {
return condition; | }
public void setCondition(boolean condition) {
this.condition = condition;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
} | repos\tutorials-master\spring-boot-modules\spring-boot-runtime\src\main\java\com\baeldung\sampleapp\web\dto\PactDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MultiFileIteamReaderDemo {
@Autowired
private JobBuilderFactory jobBuilderFactory;
@Autowired
private StepBuilderFactory stepBuilderFactory;
@Bean
public Job multiFileItemReaderJob() {
return jobBuilderFactory.get("multiFileItemReaderJob")
.start(step())
... | private FlatFileItemReader<TestData> fileItemReader() {
FlatFileItemReader<TestData> reader = new FlatFileItemReader<>();
reader.setLinesToSkip(1); // 忽略第一行
// AbstractLineTokenizer的三个实现类之一,以固定分隔符处理行数据读取,
// 使用默认构造器的时候,使用逗号作为分隔符,也可以通过有参构造器来指定分隔符
DelimitedLineTokenizer tokenizer ... | repos\SpringAll-master\68.spring-batch-itemreader\src\main\java\cc\mrbird\batch\job\MultiFileIteamReaderDemo.java | 2 |
请完成以下Java代码 | protected void deleteEntity(DbEntityOperation operation) {
final DbEntity dbEntity = operation.getEntity();
// get statement
String deleteStatement = dbSqlSessionFactory.getDeleteStatement(dbEntity.getClass());
ensureNotNull("no delete statement for " + dbEntity.getClass() + " in the ibatis mapping fi... | protected void updateEntity(DbEntityOperation operation) {
final DbEntity dbEntity = operation.getEntity();
String updateStatement = dbSqlSessionFactory.getUpdateStatement(dbEntity);
ensureNotNull("no update statement for " + dbEntity.getClass() + " in the ibatis mapping files", "updateStatement", updateS... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\db\sql\SimpleDbSqlSession.java | 1 |
请完成以下Java代码 | private static String extractChartOfAccountsNameNotNull(final @NonNull I_I_ElementValue importRecord)
{
final String chartOfAccountsName = StringUtils.trimBlankToNull(importRecord.getElementName());
if (chartOfAccountsName == null)
{
throw new FillMandatoryException(I_I_ElementValue.COLUMNNAME_ElementName);
... | public OrgId extractOrgId(@NonNull final I_I_ElementValue importRecord)
{
final String orgValue = importRecord.getOrgValue();
if (Check.isNotBlank(orgValue))
{
final I_AD_Org orgRecord = orgDAO.retrieveOrganizationByValue(Env.getCtx(), orgValue);
if (orgRecord != null)
{
return OrgId.ofRepoId(orgRec... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\impexp\ChartOfAccountsImportHelper.java | 1 |
请完成以下Java代码 | public List<DocumentLayoutElementDescriptor> getElements()
{
return elements;
}
public static final class Builder
{
private static final Logger logger = LogManager.getLogger(DocumentLayoutElementLineDescriptor.Builder.class);
private String internalName;
private final List<DocumentLayoutElementDescriptor.... | if (elementBuilder.isEmpty())
{
logger.trace("Skip adding {} to {} because it's empty", elementBuilder, this);
return false;
}
return true;
}
private final boolean checkValid(final DocumentLayoutElementDescriptor element)
{
if (element.isEmpty())
{
logger.trace("Skip adding {} to {} b... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentLayoutElementLineDescriptor.java | 1 |
请完成以下Java代码 | public class ExternalWorkerTaskCompleteJobHandler implements JobHandler {
public static final String TYPE = "cmmn-external-worker-complete";
protected CmmnEngineConfiguration cmmnEngineConfiguration;
public ExternalWorkerTaskCompleteJobHandler(CmmnEngineConfiguration cmmnEngineConfiguration) {
... | if (!jobVariables.isEmpty()) {
for (VariableInstanceEntity jobVariable : jobVariables) {
planItemInstanceEntity.setVariable(jobVariable.getName(), jobVariable.getValue());
variableService.deleteVariableInstance(jobVariable);
}
if (planItemInstanceEnti... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\job\ExternalWorkerTaskCompleteJobHandler.java | 1 |
请完成以下Java代码 | public AssociationDirection getAssociationDirection() {
return associationDirectionAttribute.getValue(this);
}
public void setAssociationDirection(AssociationDirection associationDirection) {
associationDirectionAttribute.setValue(this, associationDirection);
}
public DmnElement getSource() {
retu... | SequenceBuilder sequenceBuilder = typeBuilder.sequence();
sourceRef = sequenceBuilder.element(SourceRef.class)
.required()
.uriElementReference(DmnElement.class)
.build();
targetRef = sequenceBuilder.element(TargetRef.class)
.required()
.uriElementReference(DmnElement.class)
... | repos\camunda-bpm-platform-master\model-api\dmn-model\src\main\java\org\camunda\bpm\model\dmn\impl\instance\AssociationImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class WEBUI_M_HU_PrintReceiptLabel
extends HUEditorProcessTemplate
implements IProcessPrecondition
{
private final HULabelService huLabelService = SpringContextHolder.instance.getBean(HULabelService.class);
@Param(mandatory = true, parameterName = "Copies")
private int p_copies = 1;
@Override
public P... | if (hu == null)
{
return ProcessPreconditionsResolution.rejectWithInternalReason("No (single) HU selected");
}
return ProcessPreconditionsResolution.accept();
}
@Override
@RunOutOfTrx
protected String doIt()
{
final HUToReport hu = HUReportAwareViewRowAsHUToReport.of(getSingleSelectedRow());
huLabe... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_M_HU_PrintReceiptLabel.java | 2 |
请完成以下Java代码 | /* package */static Optional<JSONDocumentFilterParam> of(final DocumentFilterParam filterParam, final JSONOptions jsonOpts)
{
// Don't convert internal filters
if (filterParam.isSqlFilter())
{
// throw new IllegalArgumentException("Sql filters are not allowed to be converted to JSON filters: " + filterParam);... | @JsonProperty("valueTo")
Object valueTo;
@JsonCreator
@Builder
private JSONDocumentFilterParam(
@JsonProperty("parameterName") final String parameterName,
@JsonProperty("value") final Object value,
@JsonProperty("valueTo") final Object valueTo)
{
this.parameterName = parameterName;
this.value = value... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\json\JSONDocumentFilterParam.java | 1 |
请完成以下Java代码 | public void setAD_WF_Next_ID (final int AD_WF_Next_ID)
{
if (AD_WF_Next_ID < 1)
set_Value (COLUMNNAME_AD_WF_Next_ID, null);
else
set_Value (COLUMNNAME_AD_WF_Next_ID, AD_WF_Next_ID);
}
@Override
public int getAD_WF_Next_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_WF_Next_ID);
}
@Override
public v... | }
@Override
public java.lang.String getEntityType()
{
return get_ValueAsString(COLUMNNAME_EntityType);
}
@Override
public void setIsStdUserWorkflow (final boolean IsStdUserWorkflow)
{
set_Value (COLUMNNAME_IsStdUserWorkflow, IsStdUserWorkflow);
}
@Override
public boolean isStdUserWorkflow()
{
retu... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_NodeNext.java | 1 |
请完成以下Java代码 | public final class XorCsrfChannelInterceptor implements ChannelInterceptor {
private final MessageMatcher<Object> matcher = new SimpMessageTypeMatcher(SimpMessageType.CONNECT);
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
if (!this.matcher.matches(message)) {
return messag... | * @param expected
* @param actual
* @return
*/
private static boolean equalsConstantTime(String expected, @Nullable String actual) {
if (expected == actual) {
return true;
}
if (expected == null || actual == null) {
return false;
}
// Encode after ensure that the string is not null
byte[] expec... | repos\spring-security-main\messaging\src\main\java\org\springframework\security\messaging\web\csrf\XorCsrfChannelInterceptor.java | 1 |
请完成以下Java代码 | private CommentEntryParentId getParentIdOrNull(final @NonNull TableRecordReference tableRecordReference)
{
return queryBL.createQueryBuilder(I_CM_Chat.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_CM_Chat.COLUMNNAME_AD_Table_ID, tableRecordReference.getAD_Table_ID())
.addEqualsFilter(I_CM_Chat.... | .build())
.collect(GuavaCollectors.toImmutableMapByKey(CommentSummary::getReference));
}
private IQuery<I_CM_Chat> createCMChatQueryByTableAndRecordIds(final int tableId, final Set<Integer> recordIds)
{
return queryBL.createQueryBuilder(I_CM_Chat.class)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\comments\CommentsRepository.java | 1 |
请完成以下Java代码 | public List<? extends IViewRow> getIncludedRows()
{
return ImmutableList.of();
}
@Override
public boolean hasAttributes()
{
return false;
}
@Override
public IViewRowAttributes getAttributes() throws EntityNotFoundException
{
throw new EntityNotFoundException("Row does not support attributes");
}
@Ov... | public ShipmentScheduleId getShipmentScheduleId()
{
return shipmentScheduleId;
}
public Optional<OrderLineId> getSalesOrderLineId()
{
return salesOrderLineId;
}
public ProductId getProductId()
{
return product != null ? ProductId.ofRepoIdOrNull(product.getIdAsInt()) : null;
}
public Quantity getQtyOrd... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\packageable\PackageableRow.java | 1 |
请完成以下Java代码 | private static SecurPharmProduct toProductDataResult(@NonNull final I_M_Securpharm_Productdata_Result record)
{
final boolean error = record.isError();
return SecurPharmProduct.builder()
.error(error)
.resultCode(record.getLastResultCode())
.resultMessage(record.getLastResultMessage())
.productDet... | //
.lot(record.getLotNumber())
.serialNumber(record.getSerialNumber())
//
.expirationDate(JsonExpirationDate.ofLocalDate(TimeUtil.asLocalDate(record.getExpirationDate())))
//
.activeStatus(JsonProductPackageState.ofYesNoString(record.getActiveStatus()))
.inactiveReason(record.getInactiveReas... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.securpharm\src\main\java\de\metas\vertical\pharma\securpharm\product\SecurPharmProductRepository.java | 1 |
请完成以下Java代码 | private static KPIField extractUOMField(final List<KPIField> fields)
{
if (fields.size() < 2)
{
return null;
}
for (final KPIField field : fields)
{
final String fieldName = field.getFieldName();
if ("Currency".equalsIgnoreCase(fieldName)
|| "CurrencyCode".equalsIgnoreCase(fieldName)
|| "... | return field;
}
}
throw new AdempiereException("Cannot determine value field: " + fields);
}
@Override
public void loadRowToResult(@NonNull final KPIDataResult.Builder data, final @NonNull ResultSet rs) throws SQLException
{
final KPIDataValue value = SQLRowLoaderUtils.retrieveValue(rs, valueField);
fi... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\kpi\data\sql\ValueAndUomSQLRowLoader.java | 1 |
请完成以下Java代码 | public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassWord() {
return passWor... | public void setAge(int age) {
this.age = age;
}
public Date getRegTime() {
return regTime;
}
public void setRegTime(Date regTime) {
this.regTime = regTime;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
} | repos\spring-boot-leaning-master\1.x\第06课:Jpa 和 Thymeleaf 实践\spring-boot-jpa-thymeleaf\src\main\java\com\neo\entity\User.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class GetSalutationsRoute extends RouteBuilder
{
public static final String GET_SALUTATION_ROUTE_ID = "Shopware6-getSalutations";
private final ProcessLogger processLogger;
public GetSalutationsRoute(@NonNull final ProcessLogger processLogger)
{
this.processLogger = processLogger;
}
@Override
public ... | }
final PInstanceLogger pInstanceLogger = PInstanceLogger.of(processLogger);
final ShopwareClient shopwareClient = ShopwareClient
.of(getSalutationsRequest.getClientId(), getSalutationsRequest.getClientSecret(), getSalutationsRequest.getBaseUrl(), pInstanceLogger);
final ImmutableMap<String, String> salutat... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-shopware6\src\main\java\de\metas\camel\externalsystems\shopware6\salutation\GetSalutationsRoute.java | 2 |
请完成以下Java代码 | private String getNextMatch(String start) {
for (int i = currentIndex; i < items.size(); i++) {
if(items.get(i).toLowerCase().startsWith(start.toLowerCase())) {
currentIndex = i+1;
return items.get(i);
}
}
currentIndex=0;
return start;
}
/**
... | /**
* A TextAction that provides an error feedback for the text component that invoked
* the action. The error feedback is most likely a "beep".
*/
static Object errorFeedbackAction = new TextAction("provide-error-feedback") {
/**
*
*/
private static final long serialVersionUID = 625... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\ADempiereAutoCompleteDecorator.java | 1 |
请完成以下Java代码 | public ServerResponse.BodyBuilder lastModified(Instant lastModified) {
this.headers.setLastModified(lastModified);
return this;
}
@Override
public ServerResponse.BodyBuilder location(URI location) {
this.headers.setLocation(location);
return this;
}
@Override
public ServerResponse.BodyBuilder cacheContr... | }
@Override
public ServerResponse render(String name, Object... modelAttributes) {
return new GatewayRenderingResponseBuilder(name).status(this.statusCode)
.headers(headers -> headers.putAll(this.headers))
.cookies(cookies -> cookies.addAll(this.cookies))
.modelAttributes(modelAttributes)
.build();
}
... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\handler\GatewayServerResponseBuilder.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSlug() {
return slug;
}
public void setSlug(String slug) {
this.slug = slug;
} | public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
} | repos\tutorials-master\spring-boot-modules\spring-boot-annotations\src\main\java\com\baeldung\retryable\transactional\Article.java | 1 |
请完成以下Java代码 | public void registrationSummary(String string) {
logInfo(
"021",
string);
}
public void exceptionWhileLoggingRegistrationSummary(Throwable e) {
logError(
"022",
"Exception while logging registration summary",
e);
}
public boolean isContextSwitchLoggable() {
... | "No target process application found for Execution[{}], ProcessDefinition[{}], Deployment[{}] Registrations[{}]",
execution.getId(),
execution.getProcessDefinitionId(),
execution.getProcessDefinition().getDeploymentId(),
processApplicationManager.getRegistrationSummary())... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\application\impl\ProcessApplicationLogger.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class FreshCCOUNTRYLOOKUPCOUNTRYCODEType {
@XmlElement(name = "CountryCode", required = true)
protected String countryCode;
/**
* Gets the value of the countryCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String ge... | }
/**
* Sets the value of the countryCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCountryCode(String value) {
this.countryCode = value;
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\FreshCCOUNTRYLOOKUPCOUNTRYCODEType.java | 2 |
请完成以下Java代码 | public class ProductDocumentBuilder {
private static ProductDocument productDocument;
// create start
public static ProductDocumentBuilder create(){
productDocument = new ProductDocument();
return new ProductDocumentBuilder();
}
public ProductDocumentBuilder addId(String id) {
... | }
public ProductDocumentBuilder addCreateTime(Date createTime) {
productDocument.setCreateTime(createTime);
return this;
}
public ProductDocumentBuilder addUpdateTime(Date updateTime) {
productDocument.setUpdateTime(updateTime);
return this;
}
public ProductDocumen... | repos\springboot-demo-master\elasticsearch\src\main\java\demo\et59\elaticsearch\document\ProductDocumentBuilder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProductScalePriceService
{
private final IProductPA productPA = Services.get(IProductPA.class);
private final IUOMConversionBL uomConversionBL = Services.get(IUOMConversionBL.class);
@Nullable
public ProductPriceSettings getProductPriceSettings(@NonNull final I_M_ProductPrice productPrice, @Nullable f... | private BigDecimal getQtyInProductPriceUOM(@NonNull final I_M_ProductPrice productPrice, @NonNull final Quantity quantity)
{
final ProductId productId = ProductId.ofRepoId(productPrice.getM_Product_ID());
final UomId productPriceUomId = UomId.ofRepoId(productPrice.getC_UOM_ID());
return uomConversionBL.convertQ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\service\ProductScalePriceService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private static <B extends HttpSecurityBuilder<B>> OAuth2AuthorizedClientService getAuthorizedClientService(
B builder) {
OAuth2AuthorizedClientService authorizedClientService = getAuthorizedClientServiceBean(builder);
if (authorizedClientService == null) {
authorizedClientService = new InMemoryOAuth2Authorize... | }
static <B extends HttpSecurityBuilder<B>> OidcSessionRegistry getOidcSessionRegistry(B builder) {
OidcSessionRegistry sessionRegistry = builder.getSharedObject(OidcSessionRegistry.class);
if (sessionRegistry != null) {
return sessionRegistry;
}
ApplicationContext context = builder.getSharedObject(Applica... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\oauth2\client\OAuth2ClientConfigurerUtils.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public static String convertToBase64(VariableInstanceEntity variable) {
byte[] bytes = variable.getBytes();
if (bytes != null) {
return new String(Base64.getEncoder().encode(variable.getBytes()), StandardCharsets.US_ASCII);
} else {
return null;
}
}
p... | public static Double getDoubleFromJson(ObjectNode objectNode, String fieldName) {
String s = getStringFromJson(objectNode, fieldName);
if (StringUtils.isNotEmpty(s)) {
return Double.valueOf(s);
}
return null;
}
public static Long getLongFromJson(ObjectNode object... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\history\async\util\AsyncHistoryJsonUtil.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void springBeanPointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
/**
* Pointcut that matches all Spring beans in the application's main packages.
*/
@Pointcut("within(com.cars.app.repository..*)" + " || within(com.cars.app.service... | } else {
logger(joinPoint).error(
"Exception in {}() with cause = {}",
joinPoint.getSignature().getName(),
e.getCause() != null ? String.valueOf(e.getCause()) : "NULL"
);
}
}
/**
* Advice that logs when a method is entered and... | repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\car-app\src\main\java\com\cars\app\aop\logging\LoggingAspect.java | 2 |
请完成以下Java代码 | public String getApiUrl() {
return apiUrl;
}
public void setApiUrl(String apiUrl) {
this.apiUrl = apiUrl;
}
@Nullable
public String getChatId() {
return chatId;
}
public void setChatId(@Nullable String chatId) {
this.chatId = chatId;
}
@Nullable
public String getAuthToken() {
return authToken;
... | }
public boolean isDisableNotify() {
return disableNotify;
}
public void setDisableNotify(boolean disableNotify) {
this.disableNotify = disableNotify;
}
public String getParseMode() {
return parseMode;
}
public void setParseMode(String parseMode) {
this.parseMode = parseMode;
}
} | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\notify\TelegramNotifier.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void init() throws Exception {
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() {
JacksonDataFormat jacksonDataFormat = new JacksonDataFormat();
jacksonDataFormat.setPrettyPrint(true);
from("direct:sendW... | Map<String, String> text = new HashMap<>();
text.put("body", message);
body.put("text", text);
producerTemplate.sendBody("direct:sendWhatsAppMessage", body);
}
public void processIncomingMessage(String payload) {
try {
JsonNode jsonNode = objectMapper.readTree(paylo... | repos\tutorials-master\spring-boot-modules\spring-boot-3-3\src\main\java\com\baeldung\chatbot\service\WhatsAppService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class PMESU1 {
@XmlElement(name = "DOCUMENTID", required = true)
protected String documentid;
@XmlElement(name = "MEASUREQUAL", required = true)
protected String measurequal;
@XmlElement(name = "MEASUREATTR", required = true)
protected String measureattr;
@XmlElement(name = "MEASUREU... | */
public String getMEASUREUNIT() {
return measureunit;
}
/**
* Sets the value of the measureunit property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMEASUREUNIT(String value) {
this.measureunit = value;
... | 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\PMESU1.java | 2 |
请完成以下Java代码 | public PageData<TbPair<UUID, String>> getAllAssetTypes(PageLink pageLink) {
log.debug("Try to find all asset types and pageLink [{}]", pageLink);
return DaoUtil.pageToPageData(assetRepository.getAllAssetTypes(
DaoUtil.toPageable(pageLink, Arrays.asList(new SortOrder("tenantId"), new Sort... | return findAssetsByTenantId(tenantId, pageLink);
}
@Override
public AssetId getExternalIdByInternal(AssetId internalId) {
return Optional.ofNullable(assetRepository.getExternalIdById(internalId.getId()))
.map(AssetId::new).orElse(null);
}
@Override
public PageData<Asset... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\asset\JpaAssetDao.java | 1 |
请完成以下Java代码 | public static PickingJobQuery.Facets retainFacetsOfGroups(
@NonNull final PickingJobQuery.Facets queryFacets,
@NonNull final Collection<PickingJobFacetGroup> groups)
{
if (groups.isEmpty())
{
return PickingJobQuery.Facets.EMPTY;
}
final PickingJobQuery.Facets.FacetsBuilder builder = PickingJobQuery.F... | final PickingJobQuery.Facets.FacetsBuilder builder = PickingJobQuery.Facets.builder();
facetIds.forEach(facetId -> collectFromFacetId(builder, facetId));
return builder.build();
}
private static void collectFromFacetId(@NonNull PickingJobQuery.Facets.FacetsBuilder collector, @NonNull WorkflowLaunchersFacetId fac... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\model\facets\PickingJobFacetHandlers.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Future<ResponseTransfer> getBlock() {
ResponseTransfer responseTransfer = new ResponseTransfer();
Instant start = TimeHelper.start();
return CompletableFuture.supplyAsync(() -> {
try {
EthBlockNumber result = web3Service.getBlockNumber();
respo... | responseTransfer.setMessage(GENERIC_EXCEPTION);
}
return responseTransfer;
}).thenApplyAsync(result -> {
result.setPerformance(TimeHelper.stop(start));
return result;
});
}
@RequestMapping(value = Constants.API_BALANCE, method = RequestMethod.GET)... | repos\tutorials-master\ethereum\src\main\java\com\baeldung\web3j\controllers\EthereumRestController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class RevolutExportCsvRow
{
@NonNull
RevolutPaymentExport row;
@NonNull
public static String getCSVHeader()
{
return Stream.of(RevolutExportCSVColumn.Name,
RevolutExportCSVColumn.RecipientType,
RevolutExportCSVColumn.AccountNo,
RevolutExportCSVColumn.RoutingNo,
RevolutExportCS... | row.getSwiftCode(),
recipientBankCountryName,
row.getAmount().getCurrencyCode().toThreeLetterCode(),
String.valueOf(row.getAmount().getAsBigDecimal()),
row.getPaymentReference(),
recipientCountryName,
row.getRegionName(),
row.getAddressLine1(),
row.getAddressLine2... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.revolut\src\main\java\de\metas\payment\revolut\model\RevolutExportCsvRow.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getJobType() {
return job.getJobType();
}
@Override
public String getElementId() {
return job.getElementId();
}
@Override
public String getElementName() {
return job.getElementName();
}
@Override
public String getScopeId() {
return job... | @Override
public String getTenantId() {
return job.getTenantId();
}
@Override
public String getJobHandlerType() {
return job.getJobHandlerType();
}
@Override
public String getJobHandlerConfiguration() {
return job.getJobHandlerConfiguration();
}
@Override
... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\AcquiredExternalWorkerJobImpl.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.