instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public int getM_TargetDistribution_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_TargetDistribution_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Menge. @param Qty Quantity */ public void setQty (BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); } /** Get Quantity....
/** Get Reward Type. @return Type of reward which consists of percentage discount, flat discount or absolute amount */ public String getRewardType () { return (String)get_Value(COLUMNNAME_RewardType); } /** Set Reihenfolge. @param SeqNo Method of ordering records; lowest number comes first */ publ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PromotionReward.java
1
请在Spring Boot框架中完成以下Java代码
public String toString() { return "AuthenticationManagerDelegator [delegate=" + this.delegate + "]"; } } static class DefaultPasswordEncoderAuthenticationManagerBuilder extends AuthenticationManagerBuilder { private PasswordEncoder defaultPasswordEncoder; /** * Creates a new instance * @param objec...
return getPasswordEncoder().matches(rawPassword, encodedPassword); } @Override public boolean upgradeEncoding(String encodedPassword) { return getPasswordEncoder().upgradeEncoding(encodedPassword); } private PasswordEncoder getPasswordEncoder() { if (this.passwordEncoder != null) { return this.pas...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\authentication\configuration\AuthenticationConfiguration.java
2
请完成以下Java代码
public class ProductionSimulationRows implements IEditableRowsData<ProductionSimulationRow> { public static ProductionSimulationRows cast(final IRowsData<ProductionSimulationRow> rowsData) { return (ProductionSimulationRows)rowsData; } private final ImmutableList<DocumentId> rowIds; private final ConcurrentHash...
@Override public DocumentIdsSelection getDocumentIdsToInvalidate(final TableRecordReferenceSet recordRefs) { return DocumentIdsSelection.EMPTY; } @Override public void invalidateAll() { } @NonNull public ImmutableList<DocumentId> getRowIds() { return rowIds; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\simulation\ProductionSimulationRows.java
1
请完成以下Java代码
public boolean isRfQResponseAccepted () { Object oo = get_Value(COLUMNNAME_IsRfQResponseAccepted); 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...
} @Override public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException { return get_ValueAsPO(COLUMNNAME_SalesRep_ID, org.compiere.model.I_AD_User.class); } @Override public void setSalesRep(org.compiere.model.I_AD_User SalesRep) { set_ValueFromPO(COLUMNNAME_SalesRep_ID, org.compiere.model.I...
repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java-gen\de\metas\rfq\model\X_RV_C_RfQ_UnAnswered.java
1
请完成以下Java代码
public class SysLog implements Serializable { private static final long serialVersionUID = 1L; /** * id */ @TableId(type = IdType.ASSIGN_ID) private String id; /** * 创建人 */ private String createBy; /** * 创建时间 */ @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timez...
/** * 操作人用户名称 */ private String username; /** * 操作人用户账户 */ @Excel(name = "操作人", width = 15) private String userid; /** * 操作详细日志 */ @Excel(name = "日志内容", width = 50) private String logContent; /** * 日志类型(1登录日志,2操作日志) */ @Dict(dicCode = "log_type") private Integer logType; /** * 操作类型(1查询,2添...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\entity\SysLog.java
1
请完成以下Java代码
public void enqueuePurchaseCandidates( @NonNull final I_PMM_PurchaseCandidate purchaseCandidateRecord, @NonNull final ModelChangeType type) { final ProductDescriptor productDescriptor = productDescriptorFactory.createProductDescriptor(purchaseCandidateRecord); final AbstractPurchaseOfferEvent event; fina...
else { final I_PMM_PurchaseCandidate oldPurchaseCandidate = InterfaceWrapperHelper.createOld(purchaseCandidateRecord, I_PMM_PurchaseCandidate.class); final BigDecimal oldQtyPromised = oldPurchaseCandidate.getQtyPromised(); event = PurchaseOfferUpdatedEvent.builder() .date(TimeUtil.asInstant(purchaseCan...
repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\material\interceptor\PMM_PurchaseCandidate.java
1
请完成以下Java代码
public class BPMNActivityImpl extends BPMNElementImpl implements BPMNActivity { private String activityName; private String activityType; private String executionId; public BPMNActivityImpl() {} public BPMNActivityImpl(String elementId, String activityName, String activityType) { this.set...
return false; } if (getClass() != obj.getClass()) { return false; } BPMNActivityImpl other = (BPMNActivityImpl) obj; return ( Objects.equals(activityName, other.activityName) && Objects.equals(activityType, other.activityType) && Ob...
repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-process-model-impl\src\main\java\org\activiti\api\runtime\model\impl\BPMNActivityImpl.java
1
请完成以下Java代码
private static class LoggableAsGraphLoggerAdapter implements ILogger { @NonNull private final ILoggable loggable; @NonNull @Getter @Setter private LoggerLevel loggingLevel = LoggerLevel.DEBUG; @Override public void logDebug(@NonNull final String message) { loggable.addLog(message); } @Override pub...
else if (Level.ERROR.equals(level) || Level.WARN.equals(level)) { return LoggerLevel.ERROR; } else { return LoggerLevel.DEBUG; } } @Override public void logDebug(@NonNull final String message) { logger.debug(message); } @Override public void logError(@NonNull final String messa...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\email\sender\MicrosoftGraphMailSender.java
1
请在Spring Boot框架中完成以下Java代码
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) { exeTimeThreadLocal.set(System.currentTimeMillis()); statisticsInterceptor.startCounter(); return true; } @Override public void postHandle(HttpServletRequest req, HttpServletResponse resp, Ob...
statisticsInterceptor.clearCounter(); exeTimeThreadLocal.remove(); log.debug("Queries executed: {}, Request Url: {}, Time: {} ms", queryCount, request.getRequestURI(), duration); } @Override public void afterConcurrentHandlingStarted(HttpServletRequest req, HttpServletResponse resp, Object...
repos\spring-boot-web-application-sample-master\main-app\main-webapp\src\main\java\gt\app\config\logging\WebRequestInterceptor.java
2
请完成以下Java代码
public InvalidRequestException setupActionNotAvailable() { return new InvalidRequestException(Status.FORBIDDEN, "Setup action not available"); } public RestException processEngineProviderNotFound() { return new RestException(Status.BAD_REQUEST, "Could not find an implementation of the " + ProcessEngineProv...
public void traceCacheValidationTimeUpdated(Date cacheValidationTime, Date newCacheValidationTime) { logTrace("005", "Cache validation time updated from: {} to: {}", cacheValidationTime, newCacheValidationTime); } public void traceAuthenticationUpdated(String engineName) { logTrace("006", "Authentication u...
repos\camunda-bpm-platform-master\webapps\assembly\src\main\java\org\camunda\bpm\webapp\impl\WebappLogger.java
1
请完成以下Java代码
public String getProcessInstanceId() { return processInstanceId; } public void setProcessInstanceId(String processInstanceId) { this.processInstanceId = processInstanceId; } public String getExecutionId() { return executionId; } public void setExecutionId(String executionId) { this.execut...
} public String getTenantId() { return tenantId; } public static VariableInstanceDto fromVariableInstance(VariableInstance variableInstance) { VariableInstanceDto dto = new VariableInstanceDto(); dto.id = variableInstance.getId(); dto.name = variableInstance.getName(); dto.processDefinition...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\runtime\VariableInstanceDto.java
1
请完成以下Java代码
public EntityImpl update(EntityImpl entity) { return update(entity, true); } @Override public EntityImpl update(EntityImpl entity, boolean fireUpdateEvent) { EntityImpl updatedEntity = getDataManager().update(entity); if (fireUpdateEvent) { fireEntityUpdatedEvent(entity)...
if (eventDispatcher != null && eventDispatcher.isEnabled()) { eventDispatcher.dispatchEvent(createEntityEvent(FlowableEngineEventType.ENTITY_DELETED, entity), engineType); } } protected FlowableEntityEvent createEntityEvent(FlowableEngineEventType eventType, Entity entity) { return ...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\persistence\entity\AbstractEntityManager.java
1
请完成以下Java代码
public boolean supportsParameter(MethodParameter parameter) { return (getArgumentResolver(parameter) != null); } /** * Iterate over registered * {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} * and invoke the one that supports it. * @throws IllegalArgumentException if no suitable argu...
/** * Find a registered {@link HandlerMethodArgumentResolver} that supports * the given method parameter. * @param parameter the method parameter */ public @Nullable HandlerMethodArgumentResolver getArgumentResolver(MethodParameter parameter) { return this.argumentResolverCache.computeIfAbsent(parameter, (p)...
repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\data\method\HandlerMethodArgumentResolverComposite.java
1
请完成以下Java代码
public class BusinessRuleTaskActivityBehavior extends TaskActivityBehavior implements BusinessRuleTaskDelegate { private static final long serialVersionUID = 1L; protected Set<Expression> variablesInputExpressions = new HashSet<>(); protected Set<Expression> rulesExpressions = new HashSet<>(); protect...
ksession.fireAllRules(filter); } else { ksession.fireAllRules(); } Collection<? extends Object> ruleOutputObjects = ksession.getObjects(); if (ruleOutputObjects != null && !ruleOutputObjects.isEmpty()) { Collection<Object> outputVariables = new ArrayList<>(ruleO...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\bpmn\behavior\BusinessRuleTaskActivityBehavior.java
1
请完成以下Java代码
public void setFeature_id_(int feature_id_) { this.feature_id_ = feature_id_; } public int getThread_id_() { return thread_id_; } public void setThread_id_(int thread_id_) { this.thread_id_ = thread_id_; } public FeatureIndex getFeature_index_() { ...
System.err.printf("model not exits for %s", args[0]); return; } if (stream != null && !tagger.open(stream, 2, 0, 1.0)) { System.err.println("open error"); return; } System.out.println("Done reading model"); if (args.length >= 2) ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\crfpp\TaggerImpl.java
1
请完成以下Java代码
public static AdMessageKey ofNullable(@Nullable final String value) { return value != null && Check.isNotBlank(value) ? of(value) : null; } private final String value; private AdMessageKey(final String value) { Check.assumeNotEmpty(value, "value is not empty"); this.value = value; } @Override public St...
return toAD_Message(); } @JsonValue public String toAD_Message() { return value; } public String toAD_MessageWithMarkers() { return "@" + toAD_Message() + "@"; } public boolean startsWith(final String prefix) {return value.startsWith(prefix);} }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\AdMessageKey.java
1
请完成以下Java代码
public class BaseEntity { @Id @Column(name = "Id") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Transient private Integer page = 1; @Transient private Integer rows = 10; public Integer getId() { return id; } public void setId(Integer id...
public Integer getPage() { return page; } public void setPage(Integer page) { this.page = page; } public Integer getRows() { return rows; } public void setRows(Integer rows) { this.rows = rows; } }
repos\MyBatis-Spring-Boot-master\src\main\java\tk\mybatis\springboot\model\BaseEntity.java
1
请在Spring Boot框架中完成以下Java代码
public class ArrayOfDocuments extends ArrayList<Document> { @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } return super.equals(o); } @Override public int hashCode() { ret...
sb.append("class ArrayOfDocuments {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedStri...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-document-api\src\main\java\io\swagger\client\model\ArrayOfDocuments.java
2
请完成以下Java代码
public double getFitness() { return fitness; } /** * Gets the {@link #bestPosition}. * * @return the {@link #bestPosition} */ public long[] getBestPosition() { return bestPosition; } /** * Gets the {@link #bestFitness}. * * @return the {@link #bestFitness} */ public double getBestFitness() {...
public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(bestFitness); result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + Arrays.hashCode(bestPosition); temp = Double.doubleToLongBits(fitness); result = prime * result + (int) ...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-4\src\main\java\com\baeldung\algorithms\multiswarm\Particle.java
1
请完成以下Java代码
public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof AttachmentEntryItem) { final AttachmentEntryItem other = (AttachmentEntryItem)obj; return attachmentEntryId == other.attachmentEntryId; } else { return false; } } } /*********...
if (m_image == null) { return; } MediaTracker mt = new MediaTracker(this); mt.addImage(m_image, 0); try { mt.waitForID(0); } catch (Exception e) { } Dimension dim = new Dimension(m_image.getWidth(this), m_image.getHeight(this)); this.setPreferredSize(dim); } // setImage ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\Attachment.java
1
请完成以下Java代码
public boolean isFileSystem() { return get_ValueAsBoolean(COLUMNNAME_IsFileSystem); } @Override public void setIsReport (final boolean IsReport) { set_Value (COLUMNNAME_IsReport, IsReport); } @Override public boolean isReport() { return get_ValueAsBoolean(COLUMNNAME_IsReport); } @Override public ...
@Override public java.lang.String getPOReference() { return get_ValueAsString(COLUMNNAME_POReference); } @Override public void setRecord_ID (final int Record_ID) { if (Record_ID < 0) set_Value (COLUMNNAME_Record_ID, null); else set_Value (COLUMNNAME_Record_ID, Record_ID); } @Override public in...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Archive.java
1
请在Spring Boot框架中完成以下Java代码
public String getPOReference() { return POReference; } public Date getDateCandidate() { return dateCandidate; } public Date getDatePromised() { return datePromised; } public int getM_Product_ID() { return M_Product_ID; } public String getProductDescription() { return productDescription; } ...
return M_ProductPrice_ID; } public int getM_ProductPrice_Attribute_ID() { return M_ProductPrice_Attribute_ID; } public int getM_HU_PI_Item_Product_ID() { return M_HU_PI_Item_Product_ID; } public int getC_BPartner_ID() { return C_BPartner_ID; } public int getC_BPartner_Location_ID() { return C_BP...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\excelimport\Excel_OLCand_Row.java
2
请完成以下Java代码
public class AstLambdaParameters extends AstRightValue { private final List<String> parameterNames; public AstLambdaParameters(List<String> parameterNames) { this.parameterNames = parameterNames; } public List<String> getParameterNames() { return parameterNames; } @Override ...
} @Override public int getCardinality() { return 0; } @Override public AstNode getChild(int i) { return null; } @Override public String toString() { return parameterNames.size() == 1 ? parameterNames.get(0) : parameterNames.toString(); } }
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\de\odysseus\el\tree\impl\ast\AstLambdaParameters.java
1
请完成以下Java代码
private FlatrateTerm getById0(@NonNull final FlatrateTermId id) { final I_C_Flatrate_Term term = flatrateDAO.getById(id); final OrgId orgId = OrgId.ofRepoId(term.getAD_Org_ID()); final I_C_Flatrate_Conditions flatrateConditionsRecord = term.getC_Flatrate_Conditions(); final ProductId productId = ProductId.o...
.orgId(orgId) .billPartnerLocationAndCaptureId(billPartnerLocationAndCaptureId) .billLocation(billLocation) .dropshipPartnerLocationAndCaptureId(dropshipLPartnerLocationAndCaptureId) .productId(productId) .flatrateConditionsId(ConditionsId.ofRepoId(term.getC_Flatrate_Conditions_ID())) .pricingSy...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\FlatrateTermRepo.java
1
请完成以下Java代码
public class FindWithObjectId { private static final String OBJECT_ID_FIELD = "_id"; private static MongoClient mongoClient; private static MongoDatabase database; private static MongoCollection<Document> collection; private static String collectionName; private static String databaseName; ...
System.out.println(document); FindIterable<Document> documents = collection.find(eq(OBJECT_ID_FIELD, document.get(OBJECT_ID_FIELD))); Document queriedDocument = documents.first(); System.out.println(queriedDocument); } public static void retrieveDocumentWithRandomObjectId() { ...
repos\tutorials-master\persistence-modules\java-mongodb-3\src\main\java\com\baeldung\mongo\find\FindWithObjectId.java
1
请完成以下Java代码
private Iterable<I_C_Invoice_Candidate> retrieveSelection(@NonNull final PInstanceId pinstanceId) { return () -> invoiceCandDAO.retrieveIcForSelection(pinstanceId, PlainContextAware.newWithThreadInheritedTrx(getCtx())); } @Override public IInvoiceCandidateEnqueuer setContext(@NonNull final Prope...
if (isFailOnChanges()) { return new InvoiceCandidatesChangesChecker() .setTotalNetAmtToInvoiceChecksum(_totalNetAmtToInvoiceChecksum); } else { return IInvoiceCandidatesChangesChecker.NULL; } } @Override public IInvoiceCandidateEnqueuer setTotalNetAmtToInvoiceChecksum(final BigDecimal totalNetA...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceCandidateEnqueuer.java
1
请在Spring Boot框架中完成以下Java代码
public class MenuWrapper extends BaseEntityWrapper<Menu, MenuVO> { private static IMenuService menuService; private static IDictClient dictClient; static { menuService = SpringUtil.getBean(IMenuService.class); dictClient = SpringUtil.getBean(IDictClient.class); } public static MenuWrapper build() { retur...
if (d1.isSuccess()) { menuVO.setCategoryName(d1.getData()); } if (d2.isSuccess()) { menuVO.setActionName(d2.getData()); } if (d3.isSuccess()) { menuVO.setIsOpenName(d3.getData()); } return menuVO; } public List<MenuVO> listNodeVO(List<Menu> list) { List<MenuVO> collect = list.stream().map(men...
repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\wrapper\MenuWrapper.java
2
请完成以下Java代码
private PackageDimensions extractDimensionsInCM(@Nullable final JsonDimensions dimensions) { if (dimensions == null) { return PackageDimensions.UNSPECIFIED; } return PackageDimensions.builder() .lengthInCM(dimensions.getLength()) .widthInCM(dimensions.getWidth()) .heightInCM(dimensions.getHeight...
private void createTransportationOrderAndPackages(@NonNull final HashMap<GenerateShippingPackagesGroupingKey, HashSet<PackageInfo>> groupingKey2PackageInfoList) { groupingKey2PackageInfoList.entrySet() .stream() .map(entry -> AddTrackingInfosForInOutWithoutHUReq.builder() .inOutId(entry.getKey().getInO...
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\shipping\mpackage\ShippingPackageService.java
1
请完成以下Java代码
public void removeLast() { if (isEmpty()) { return; } else if (size() == 1) { tail = null; head = null; } else { Node<S> secondToLast = null; Node<S> last = head; while (last.next != null) { secondToLast = la...
} private boolean isLastNode(Node<S> node) { return tail == node; } private boolean isFistNode(Node<S> node) { return head == node; } public static class Node<T> { private T element; private Node<T> next; public Node(T element) { this.element...
repos\tutorials-master\core-java-modules\core-java-collections-list-7\src\main\java\com\baeldung\linkedlistremove\SinglyLinkedList.java
1
请完成以下Java代码
public class LogListener extends LogBaseListener { private static final DateTimeFormatter DEFAULT_DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm:ss", Locale.ENGLISH); private List<LogEntry> entries = new ArrayList<>(); private LogEntry currentLogEntry; @Override p...
} @Override public void enterMessage(LogParser.MessageContext ctx) { currentLogEntry.setMessage(ctx.getText()); } @Override public void enterLevel(LogParser.LevelContext ctx) { currentLogEntry.setLevel(LogLevel.valueOf(ctx.getText())); } public List<LogEntry> getEntries() ...
repos\tutorials-master\text-processing-libraries-modules\antlr\src\main\java\com\baeldung\antlr\log\LogListener.java
1
请完成以下Java代码
public I_C_Calendar getC_Calendar() throws RuntimeException { return (I_C_Calendar)MTable.get(getCtx(), I_C_Calendar.Table_Name) .getPO(getC_Calendar_ID(), get_TrxName()); } /** Set Calendar. @param C_Calendar_ID Accounting Calendar Name */ public void setC_Calendar_ID (int C_Calendar_ID) { if (C...
} /** Get Year. @return The Fiscal Year */ public String getFiscalYear () { return (String)get_Value(COLUMNNAME_FiscalYear); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getFiscalYear(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Year.java
1
请在Spring Boot框架中完成以下Java代码
private StatsCounter register(StatsCounter counter) { counters.add(counter); return counter; } public void log(ToEdgeNotificationMsg msg) { totalCounter.increment(); if (msg.hasEdgeHighPriority()) { edgeHighPriorityCounter.increment(); } else if (msg.hasEdgeE...
edgeNotificationsCounter.increment(); } public void printStats() { int total = totalCounter.get(); if (total > 0) { StringBuilder stats = new StringBuilder(); counters.forEach(counter -> stats.append(counter.getName()).append(" = [").append(counter.get()).append("] ")); ...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\queue\EdgeConsumerStats.java
2
请完成以下Java代码
public boolean isFinishedGoods() { return !isBOMLine(); } public boolean isBOMLine() { return ppOrderBOMLineId != null; } public PPOrderRef withPPOrderAndBOMLineId(@Nullable final PPOrderAndBOMLineId newPPOrderAndBOMLineId) { final PPOrderId ppOrderIdNew = newPPOrderAndBOMLineId != null ? newPPOrderAndBO...
@Nullable public static PPOrderRef withPPOrderAndBOMLineId(@Nullable final PPOrderRef ppOrderRef, @Nullable final PPOrderAndBOMLineId newPPOrderAndBOMLineId) { if (ppOrderRef != null) { return ppOrderRef.withPPOrderAndBOMLineId(newPPOrderAndBOMLineId); } else if (newPPOrderAndBOMLineId != null) { retu...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\pporder\PPOrderRef.java
1
请完成以下Java代码
protected String getHistoryRemovalTimeStrategy(CommandContext commandContext) { return commandContext.getProcessEngineConfiguration() .getHistoryRemovalTimeStrategy(); } protected boolean isDmnEnabled(CommandContext commandContext) { return commandContext.getProcessEngineConfiguration().isDmnEnabled(...
protected SetRemovalTimeBatchConfiguration createJobConfiguration(SetRemovalTimeBatchConfiguration configuration, List<String> batchIds) { return new SetRemovalTimeBatchConfiguration(batchIds) .setRemovalTime(configuration.getRemovalTime()) .setHasRemovalTime(configuration.hasRemovalTime()); } prot...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\removaltime\BatchSetRemovalTimeJobHandler.java
1
请完成以下Java代码
public boolean computeUnsetValue(@NonNull final SyncAdvise syncAdvise) { final boolean explicitlyUnsetDiscount = coalesce(this.getUnsetValue(), false); if (explicitlyUnsetDiscount) { return true; } final boolean implicitlyUnsetPrice = this.getValue() == null && syncAdvise.getIfExists().isUpdateRemove(); ...
} final boolean dontChangeIfNotSet = dontChangeAtAll || isExistsAdvise.isUpdateMerge(); final boolean implicitlyDontSetPrice = this.getValue() == null && dontChangeIfNotSet; if (implicitlyDontSetPrice) { return false; } return true; } protected abstract Object getValue(); protected abstract Boolea...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-rest_api\src\main\java\de\metas\common\rest_api\v1\JsonUnsettableValue.java
1
请在Spring Boot框架中完成以下Java代码
public String getLastModifiedBy() { return lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Instant lastMod...
"login='" + login + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", imageUrl='" + imageUrl + '\'' + ", activated=" + activated + ", langKey='" + langKey + '\'' + ", createdB...
repos\tutorials-master\jhipster-8-modules\jhipster-8-microservice\gateway-app\src\main\java\com\gateway\service\dto\AdminUserDTO.java
2
请完成以下Java代码
public final class ShipmentCandidatesView extends AbstractCustomView<ShipmentCandidateRow> implements IEditableView { private final IShipmentScheduleBL shipmentScheduleBL; @Builder private ShipmentCandidatesView( @NonNull final IShipmentScheduleBL shipmentScheduleBL, // @NonNull final ViewId viewId, @Nu...
} @Override public void close(final ViewCloseAction closeAction) { if (closeAction.isDone()) { saveChanges(); } } private void saveChanges() { final ShipmentScheduleUserChangeRequestsList userChanges = getRowsData().createShipmentScheduleUserChangeRequestsList().orElse(null); if (userChanges == nul...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\shipment_candidates_editor\ShipmentCandidatesView.java
1
请完成以下Java代码
public Integer getId() { return id; } public UserCacheObject setId(Integer id) { this.id = id; return this; } public String getName() { return name; } public UserCacheObject setName(String name) { this.name = name; return this; } public...
return gender; } public UserCacheObject setGender(Integer gender) { this.gender = gender; return this; } @Override public String toString() { return "UserCacheObject{" + "id=" + id + ", name='" + name + '\'' + ", gender=" + ge...
repos\SpringBoot-Labs-master\lab-11-spring-data-redis\lab-07-spring-data-redis-with-jedis\src\main\java\cn\iocoder\springboot\labs\lab10\springdatarediswithjedis\cacheobject\UserCacheObject.java
1
请完成以下Java代码
private Set<String> getCombinedParameterNames() { Set<String> names = new HashSet<>(); names.addAll(super.getParameterMap().keySet()); names.addAll(this.savedRequest.getParameterMap().keySet()); return names; } @Override public Enumeration<String> getParameterNames() { return new Enumerator<>(getCombinedP...
} if (wrappedRequestParams == null) { return savedRequestParams; } // We have parameters in both saved and wrapped requests so have to merge them List<String> wrappedParamsList = Arrays.asList(wrappedRequestParams); List<String> combinedParams = new ArrayList<>(wrappedParamsList); // We want to add all p...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\savedrequest\SavedRequestAwareWrapper.java
1
请完成以下Java代码
public class ExternalIdsUtil { private static final String EXTERNAL_ID_DELIMITER = ";,;"; public static String joinExternalIds(@NonNull final List<String> externalIds) { return externalIds .stream() .collect(Collectors.joining(EXTERNAL_ID_DELIMITER)); } /** * @return empty list if the given parameter...
{ if (externalIds.size() != 1) { return -1; } final String externalId = CollectionUtils.singleElement(externalIds); final List<String> externalIdSegments = Splitter .on("_") .splitToList(externalId); if (externalIdSegments.isEmpty()) { return -1; } final String recordIdStr = externalIdS...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\lang\ExternalIdsUtil.java
1
请完成以下Java代码
private ImmutableTableNamesGroupsIndex getTableNamesToBroadcastIndex() { return _tableNamesToBroadcastIndex; } public ImmutableSet<String> getTableNamesToBroadcast() { return getTableNamesToBroadcastIndex().getTableNames(); } /** * Broadcast a cache invalidation request. */ public void postEvent(final ...
{ logger.debug("onEvent - ignoring event without payload; event={}", event); return; } // // Reset cache for TableName/Record_ID logger.debug("onEvent - resetting local cache for request {} because we got remote event={}", request, event); CacheMgt.get().reset(request, CacheMgt.ResetMode.LOCAL); // don...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\CacheInvalidationRemoteHandler.java
1
请在Spring Boot框架中完成以下Java代码
public void addInterceptors(InterceptorRegistry registry) { // Add Sentinel interceptor // addSentinelWebTotalInterceptor(registry); addSentinelWebInterceptor(registry); } private void addSentinelWebInterceptor(InterceptorRegistry registry) { // 创建 SentinelWebMvcConfig 对象 ...
// }); // 添加 SentinelWebInterceptor 拦截器 registry.addInterceptor(new SentinelWebInterceptor(config)).addPathPatterns("/**"); } private void addSentinelWebTotalInterceptor(InterceptorRegistry registry) { // 创建 SentinelWebMvcTotalConfig 对象 SentinelWebMvcTotalConfig config =...
repos\SpringBoot-Labs-master\lab-46\lab-46-sentinel-demo\src\main\java\cn\iocoder\springboot\lab46\sentineldemo\config\SpringMvcConfiguration.java
2
请完成以下Java代码
public class YamlLoaderInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> { private final YamlPropertySourceLoader loader = new YamlPropertySourceLoader(); private final String file; public YamlLoaderInitializer() { this.file = null; } public YamlLoaderIn...
applicationContext.getEnvironment() .getPropertySources() .addLast(propertySource); } private PropertySource<?> loadYaml(Resource path) { if (!path.exists()) { throw new IllegalArgumentException("Resource " + path + " does not exist"); } try { ...
repos\tutorials-master\spring-security-modules\spring-security-oidc\src\main\java\com\baeldung\openid\oidc\utils\YamlLoaderInitializer.java
1
请完成以下Java代码
public class Fruit { @Min(value = 10, message = "Fruit weight must be 10 or greater") private Integer weight; @Size(min = 5, max = 200) private String name; @Size(min = 5, max = 200) private String colour; private String serial; public Fruit() { } public Fruit(String name, Str...
this.colour = colour; } public String getColour() { return colour; } public Integer getWeight() { return weight; } public void setWeight(Integer weight) { this.weight = weight; } public String getSerial() { return serial; } public void set...
repos\tutorials-master\web-modules\jersey\src\main\java\com\baeldung\jersey\server\model\Fruit.java
1
请完成以下Java代码
public int getRepoId() { return repoId; } public static boolean equals(@Nullable final CurrencyId currencyId1, @Nullable final CurrencyId currencyId2) { return Objects.equals(currencyId1, currencyId2); } @NonNull @SafeVarargs public static <T> CurrencyId getCommonCurrencyIdOfAll( @NonNull final Functio...
} if (commonCurrencyId == null) { throw new AdempiereException("At least one non null " + name + " instance was expected: " + Arrays.asList(objects)); } return commonCurrencyId; } } @SafeVarargs public static <T> void assertCurrencyMatching( @NonNull final Function<T, CurrencyId> getCurrencyI...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\money\CurrencyId.java
1
请在Spring Boot框架中完成以下Java代码
public class SourceCodeProjectGenerationConfiguration { @Bean public MainApplicationTypeCustomizer<TypeDeclaration> springBootApplicationAnnotator() { return (typeDeclaration) -> typeDeclaration.annotations() .addSingle(ClassName.of("org.springframework.boot.autoconfigure.SpringBootApplication")); } @Bean p...
WarPackagingConfiguration(ProjectDescription description) { this.description = description; } @Bean @ConditionalOnPlatformVersion("2.0.0.M1") ServletInitializerContributor boot20ServletInitializerContributor( ObjectProvider<ServletInitializerCustomizer<?>> servletInitializerCustomizers) { return new ...
repos\initializr-main\initializr-generator-spring\src\main\java\io\spring\initializr\generator\spring\code\SourceCodeProjectGenerationConfiguration.java
2
请完成以下Java代码
private URL getURL(final String relativePath, final Map<String, String> params) { final String serverUrl = getServerUrl(); final StringBuilder urlStrBuf = new StringBuilder(); urlStrBuf.append(serverUrl); if (!urlStrBuf.toString().endsWith("/") && !IArchiveEndpoint.PATH_Service.startsWith("/")) { urlStr...
in = httpPost.getResponseBodyAsStream(); if (result != 200) { final String errorMsg = in == null ? "code " + result : IOStreamUtils.toString(in); throw new AdempiereException("Error " + result + " while posting on " + url + ": " + errorMsg); } if (responseClass != null) { final T response = ...
repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\spi\impl\RestHttpArchiveEndpoint.java
1
请完成以下Java代码
public class MethodInfo { private final String name; private final Class<?>[] paramTypes; private final Class<?> returnType; public MethodInfo(String name, Class<?> returnType, Class<?>[] paramTypes) { this.name = name; this.returnType = returnType; this.paramTypes = paramTypes; } public String getN...
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } MethodInfo other = (MethodInfo) obj; if (name == ...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\javax\el\MethodInfo.java
1
请完成以下Java代码
public void setIsOneAssetPerUOM (boolean IsOneAssetPerUOM) { set_Value (COLUMNNAME_IsOneAssetPerUOM, Boolean.valueOf(IsOneAssetPerUOM)); } /** Get One Asset Per UOM. @return Create one asset per UOM */ public boolean isOneAssetPerUOM () { Object oo = get_Value(COLUMNNAME_IsOneAssetPerUOM); if (oo != n...
/** Get Track Issues. @return Enable tracking issues for this asset */ public boolean isTrackIssues () { Object oo = get_Value(COLUMNNAME_IsTrackIssues); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Group.java
1
请在Spring Boot框架中完成以下Java代码
public class PostMaterialEventService { private static final Logger logger = LogManager.getLogger(PostMaterialEventService.class); private final MetasfreshEventBusService materialEventService; public PostMaterialEventService(@NonNull final MetasfreshEventBusService materialEventService) { this.materialEventServ...
} /** * Fires the given event using our (distributed) event framework. * <b>Important:</b> Please make sure to only use this method if you know that all the data which this event refers to is already committed to database! */ public void enqueueEventNow(final MaterialEvent event) { materialEventService.enqu...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\PostMaterialEventService.java
2
请完成以下Java代码
private HashMap<DocumentPath, TableRecordReference> getTableRecordReferences(@NonNull final ImmutableList<IViewRow> rows) { final ImmutableSet<DocumentPath> documentPaths = rows.stream() .map(IViewRow::getDocumentPath) .filter(Objects::nonNull) .collect(ImmutableSet.toImmutableSet()); final HashMap<Do...
final TableRecordReference tableRecordReference = documentDescriptorFactory.getTableRecordReference(documentPath); final List<CommentEntry> comments = commentsRepository.retrieveLastCommentEntries(tableRecordReference, 100); return comments.stream() .map(comment -> toJsonComment(comment, zoneId)) .sorted(C...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\comments\CommentsService.java
1
请完成以下Java代码
public String getSysNm() { return sysNm; } /** * Sets the value of the sysNm property. * * @param value * allowed object is * {@link String } * */ public void setSysNm(String value) { this.sysNm = value; } /** * Gets the value o...
} /** * Sets the value of the cpblties property. * * @param value * allowed object is * {@link PointOfInteractionCapabilities1 } * */ public void setCpblties(PointOfInteractionCapabilities1 value) { this.cpblties = value; } /** * Gets the v...
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代码
public class Article { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String slug; private String title; @Enumerated(EnumType.STRING) private Status status; public enum Status { DRAFT, PUBLISHED } public Article() { } ...
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; ...
repos\tutorials-master\spring-boot-modules\spring-boot-annotations\src\main\java\com\baeldung\retryable\transactional\Article.java
2
请完成以下Java代码
public class OpenApiPermission implements Serializable { /** * id */ @TableId(type = IdType.ASSIGN_ID) private String id; /** * 接口ID */ private String apiId; /** * 认证ID */ private String apiAuthId; /**
* 创建人 */ private String createBy; /** * 创建时间 */ private Date createTime; /** * 更新人 */ private String updateBy; /** * 更新时间 */ private Date updateTime; }
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\openapi\entity\OpenApiPermission.java
1
请完成以下Java代码
public Set<String> getAllowedOrigins() { return allowedOrigins == null ? Collections.emptySet() : allowedOrigins; } public void setAllowedOrigins(Set<String> allowedOrigins) { this.allowedOrigins = allowedOrigins; } public Set<String> getAllowedHeaders() { ...
return exposedHeaders == null ? Collections.emptySet() : exposedHeaders; } public void setExposedHeaders(Set<String> exposedHeaders) { this.exposedHeaders = exposedHeaders; } public Set<String> getAllowedMethods() { return allowedMethods == null ? Collections.em...
repos\flowable-engine-main\modules\flowable-app-rest\src\main\java\org\flowable\rest\app\properties\RestAppProperties.java
1
请完成以下Java代码
public ProcessPreconditionsResolution checkPreconditionsApplicable(@NonNull final IProcessPreconditionsContext context) { if (context.getSelectionSize().isNoSelection()) { return ProcessPreconditionsResolution.rejectBecauseNoSelection(); } return ProcessPreconditionsResolution.accept(); } @Override prot...
@Override protected String doIt() throws Exception { final PInstanceId pinstanceId = getPinstanceId(); final IShipmentSchedulePA shipmentSchedulePA = Services.get(IShipmentSchedulePA.class); // update delivery date // no invalidation shipmentSchedulePA.updateDeliveryDate_Override(p_deliveryDate, pinstance...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\process\M_ShipmentSchedule_ChangeDeliveryDate.java
1
请完成以下Java代码
public final class OAuth2RestClientHttpServiceGroupConfigurer implements RestClientHttpServiceGroupConfigurer { private final HttpRequestValues.Processor processor = ClientRegistrationIdProcessor.DEFAULT_INSTANCE; private final ClientHttpRequestInterceptor interceptor; private OAuth2RestClientHttpServiceGroupConf...
); groups.forEachProxyFactory((group, factory) -> factory.httpRequestValuesProcessor(this.processor) ); // @formatter:on } public static OAuth2RestClientHttpServiceGroupConfigurer from( OAuth2AuthorizedClientManager authorizedClientManager) { OAuth2ClientHttpRequestInterceptor interceptor = new OAuth2C...
repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\web\client\support\OAuth2RestClientHttpServiceGroupConfigurer.java
1
请在Spring Boot框架中完成以下Java代码
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PricingSummary pricingSummary = (PricingSummary)o; return Objects.equals(this.adjustment, pricingSummary.adjustment) && Objects.equals(this.deliveryCost, pricingSum...
{ StringBuilder sb = new StringBuilder(); sb.append("class PricingSummary {\n"); sb.append(" adjustment: ").append(toIndentedString(adjustment)).append("\n"); sb.append(" deliveryCost: ").append(toIndentedString(deliveryCost)).append("\n"); sb.append(" deliveryDiscount: ").append(toIndentedString(del...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\ebay-api-client\src\main\java\de\metas\camel\externalsystems\ebay\api\model\PricingSummary.java
2
请完成以下Java代码
public String toString() { return "DocOutboundProducer [" + "tableName=" + tableName + ", isDocument=" + isDocument + "]"; } @Override public boolean accept(@Nullable final Object model) { if (model == null) { return false; } // Check tableName match final String modelTableName = Int...
{ enqueueModelForWorkpackageProcessor(model, DocOutboundWorkpackageProcessor.class); } @Override public void voidDocOutbound(@NonNull final Object model) { enqueueModelForWorkpackageProcessor(model, ProcessPrintingQueueWorkpackageProcessor.class); } private void enqueueModelForWorkpackageProcessor( @NonN...
repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\spi\impl\AbstractDocOutboundProducer.java
1
请在Spring Boot框架中完成以下Java代码
public class ReconciliationFileDownBiz { private static final Log LOG = LogFactory.getLog(ReconciliationFileDownBiz.class); private static final int DOWNLOAD_TRY_TIMES = 3;// 下载尝试次数 @Autowired private ReconciliationFactory reconciliationFactory; /** * 请求下载对账文件 . * * @param interfaceCode * 支付...
* @param interfaceCode * 接口编码 * @param tradeGainCheckFileTime * 业务对账文件的获取时间 */ private File downFile(String interfaceCode, Date billDate) { LOG.info("银行渠道编号[" + interfaceCode + "],进入下载业务对账文件操作>>>"); try { File file = null; int downloadTrytimes = 0; // 默认尝试三次 while (file ...
repos\roncoo-pay-master\roncoo-pay-app-reconciliation\src\main\java\com\roncoo\pay\app\reconciliation\biz\ReconciliationFileDownBiz.java
2
请在Spring Boot框架中完成以下Java代码
H2ConsoleLogger h2ConsoleLogger(ObjectProvider<DataSource> dataSources) { return new H2ConsoleLogger(dataSources, this.properties.getPath()); } private void configureH2ConsoleSettings(ServletRegistrationBean<JakartaWebServlet> registration, Settings settings) { if (settings.isTrace()) { registration.addIni...
.toList(); } private @Nullable String getConnectionUrl(DataSource dataSource) { try (Connection connection = dataSource.getConnection()) { return "'" + connection.getMetaData().getURL() + "'"; } catch (Exception ex) { return null; } } private void log(List<String> urls, String path) { i...
repos\spring-boot-4.0.1\module\spring-boot-h2console\src\main\java\org\springframework\boot\h2console\autoconfigure\H2ConsoleAutoConfiguration.java
2
请完成以下Java代码
public java.lang.String getRfQType () { return (java.lang.String)get_Value(COLUMNNAME_RfQType); } @Override public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException { return get_ValueAsPO(COLUMNNAME_SalesRep_ID, org.compiere.model.I_AD_User.class); } @Override public void setSalesRep(org...
{ if (SalesRep_ID < 1) set_Value (COLUMNNAME_SalesRep_ID, null); else set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID)); } /** Get Aussendienst. @return Aussendienst */ @Override public int getSalesRep_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID); if (ii == n...
repos\metasfresh-new_dawn_uat\backend\de.metas.rfq\src\main\java-gen\de\metas\rfq\model\X_C_RfQ.java
1
请完成以下Java代码
public final String getPropagationType() { return huPIAttribute.getPropagationType(); } @Override public final IAttributeAggregationStrategy retrieveAggregationStrategy() { final Properties ctx = InterfaceWrapperHelper.getCtx(huPIAttribute); final int adJavaClassId = huPIAttribute.getAggregationStrategy_Jav...
} } @Override public final boolean isReadonlyUI() { return huPIAttribute.isReadOnly(); } @Override public final boolean isDisplayedUI() { return huPIAttribute.isDisplayed(); } @Override public final boolean isMandatory() { return huPIAttribute.isMandatory(); } @Override public final int getDisp...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\impl\AbstractHUAttributeValue.java
1
请完成以下Java代码
public static Json succ(String operate, String dataKey, Object dataVal) { return new Json(operate, true, DEFAULT_SUCC_CODE, DEFAULT_SUCC_MSG, null).data(dataKey, dataVal); } ////// 操作失败的: public static Json fail() { return new Json(DEFAULT_OPER_VAL, false, DEFAULT_FAIL_CODE, DEFAULT_FAIL_MSG, null); } public...
public Json oper(String operate) { this.put(KEY_OPER, operate); return this; } /** 设置操作结果是否成功的标记 */ public Json succ(boolean success) { this.put(KEY_SUCC, success); return this; } /** 设置操作结果的代码 */ public Json code(int code) { this.put(KEY_CODE, code); return this; } /** 设置操作结果的信息 */ public Json ...
repos\spring-boot-quick-master\quick-spring-shiro\src\main\java\com\shiro\vo\Json.java
1
请完成以下Java代码
public java.lang.String getProxyPassword () { return (java.lang.String)get_Value(COLUMNNAME_ProxyPassword); } /** Set Proxy port. @param ProxyPort Port of your proxy server */ @Override public void setProxyPort (int ProxyPort) { set_Value (COLUMNNAME_ProxyPort, Integer.valueOf(ProxyPort)); } /** ...
*/ @Override public java.lang.String getStmtLoaderClass () { return (java.lang.String)get_Value(COLUMNNAME_StmtLoaderClass); } /** Set User ID. @param UserID User ID or account number */ @Override public void setUserID (java.lang.String UserID) { set_Value (COLUMNNAME_UserID, UserID); } /** Get...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-gen\org\compiere\model\X_C_BankStatementLoader.java
1
请完成以下Java代码
public boolean hasTransactions() { if (trxAttributesCollector == null) { return false; } return !trxAttributesCollector.isEmpty(); } @Override public void clearTransactions() { if (trxAttributesCollector != null) { trxAttributesCollector.clearTransactions(); } } @Override public void trans...
@Override public IAllocationResult createAllocationResult() { final List<IHUTransactionAttribute> attributeTrxs = getAndClearTransactions(); if (attributeTrxs.isEmpty()) { // no transactions, nothing to do return AllocationUtils.nullResult(); } return AllocationUtils.createQtyAllocationResult( Bi...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\impl\HUTransactionAttributeBuilder.java
1
请在Spring Boot框架中完成以下Java代码
public List<Map<String, Object>> uploadAndQuery(@RequestParam("file") MultipartFile file, @RequestParam("tableName") String tableName) { List<Map<String, Object>> results = new ArrayList<>(); Connection connection = null; try { // Save the uploaded file to the server's temporary directory File tempFile =...
} catch (Exception e) { e.printStackTrace(); } finally { // Close the database connection if (connection != null) { try { connection.close(); } catch (Exception e) { e.printStackTrace(); } } } return results; } }
repos\springboot-demo-master\accessDB\src\main\java\com\demo\controller\AccessDatabaseController.java
2
请完成以下Java代码
public void updatePostCalculationAmounts(final CurrencyPrecision precision) { for (final CostElementId costElementId : getCostElementIds()) { updatePostCalculationAmountsForCostElement(precision, costElementId); } } public void updatePostCalculationAmountsForCostElement( final CurrencyPrecision precisio...
.map(PPOrderCost::getPostCalculationAmount) .reduce(CostAmount::add) .orElseThrow(() -> new AdempiereException("No inbound costs found in " + costs)); // // Update co-product costs and calculate total co-product costs coProductCosts.forEach(cost -> cost.setPostCalculationAmount(totalInboundCostAmount.mul...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\PPOrderCosts.java
1
请完成以下Java代码
public void setName(String name) { this.name = name; } public String getOwner() { return owner; } public void setOwner(String owner) { this.owner = owner; } public AbstractQueryDto<?> getQuery() { return query; } @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXT...
} public void setItemCount(Long itemCount) { this.itemCount = itemCount; } public static FilterDto fromFilter(Filter filter) { FilterDto dto = new FilterDto(); dto.id = filter.getId(); dto.resourceType = filter.getResourceType(); dto.name = filter.getName(); dto.owner = filter.getOwner()...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\runtime\FilterDto.java
1
请完成以下Java代码
public class JavaClassBL implements IJavaClassBL { @Override public <T> T newInstance(@NonNull final JavaClassId javaClassId) { final I_AD_JavaClass javaClassRecord = loadOutOfTrx(javaClassId, I_AD_JavaClass.class); return newInstance(javaClassRecord); } @Override public <T> T newInstance(@NonNull final I_AD...
throw new AdempiereException("Classname not found: " + className, e); } return javaClass; } private Class<?> getJavaTypeClassOrNull(final I_AD_JavaClass javaClassDef) { if (javaClassDef.getAD_JavaClass_Type_ID() <= 0) { return null; } final I_AD_JavaClass_Type javaClassTypeDef = javaClassDef.getAD_Ja...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\javaclasses\impl\JavaClassBL.java
1
请完成以下Java代码
Mono<Neo4jHealthDetails> runHealthCheckQuery() { return Mono.using(this::session, this::healthDetails, ReactiveSession::close); } private ReactiveSession session() { return this.driver.session(ReactiveSession.class, Neo4jHealthIndicator.DEFAULT_SESSION_CONFIG); } private Mono<Neo4jHealthDetails> healthDetails...
private static final class Neo4jHealthDetailsBuilder { private @Nullable Record record; void record(Record record) { this.record = record; } private Neo4jHealthDetails build(ResultSummary summary) { Assert.state(this.record != null, "'record' must not be null"); return new Neo4jHealthDetails(this.re...
repos\spring-boot-4.0.1\module\spring-boot-neo4j\src\main\java\org\springframework\boot\neo4j\health\Neo4jReactiveHealthIndicator.java
1
请完成以下Java代码
public class LdapSearchResults implements NamingEnumeration<SearchResult>, AutoCloseable { protected NamingEnumeration<SearchResult> enumeration; public LdapSearchResults(NamingEnumeration<SearchResult> enumeration) { this.enumeration = enumeration; } @Override public SearchResult next() throws NamingE...
return enumeration.hasMoreElements(); } @Override public SearchResult nextElement() { return enumeration.nextElement(); } @Override public void close() { try { if (enumeration != null) { enumeration.close(); } } catch (Exception e) { // ignore silently } } }
repos\camunda-bpm-platform-master\engine-plugins\identity-ldap\src\main\java\org\camunda\bpm\identity\impl\ldap\LdapSearchResults.java
1
请完成以下Spring Boot application配置
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE spring.datasource.username=sa spring.datasource.password= spring.datasource.driver-class-name=org.h2.Driver spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.
show-sql=true spring.jpa.properties.hibernate.format_sql=true spring.batch.jdbc.initialize-schema=always
repos\tutorials-master\spring-batch-2\src\main\resources\application-test.properties
2
请在Spring Boot框架中完成以下Java代码
public static class SubGroup { @XmlElement(name = "ID") protected String id; @XmlElement(name = "SubDescription") protected List<GroupDescriptionType> subDescription; /** * Gets the value of the id property. * * @retur...
* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the subDescription property. * ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\ProductGroupType.java
2
请完成以下Java代码
public GatewayFilter apply(Config config) { return new OrderedGatewayFilter((exchange, chain) -> { if (config.isPreLogger()) logger.info("Pre GatewayFilter logging: " + config.getBaseMessage()); return chain.filter(exchange) .then(Mono.fromRunnable(() -> {...
public boolean isPostLogger() { return postLogger; } public void setBaseMessage(String baseMessage) { this.baseMessage = baseMessage; } public void setPreLogger(boolean preLogger) { this.preLogger = preLogger; } public void setPostLo...
repos\tutorials-master\spring-cloud-modules\spring-cloud-gateway\src\main\java\com\baeldung\springcloudgateway\customfilters\gatewayapp\filters\factories\LoggingGatewayFilterFactory.java
1
请完成以下Java代码
public class AuthenticationCredentialsNotFoundEvent extends AbstractAuthorizationEvent { private final AuthenticationCredentialsNotFoundException credentialsNotFoundException; private final Collection<ConfigAttribute> configAttribs; /** * Construct the event. * @param secureObject the secure object * @param...
Assert.isTrue(attributes != null && credentialsNotFoundException != null, "All parameters are required and cannot be null"); this.configAttribs = attributes; this.credentialsNotFoundException = credentialsNotFoundException; } public Collection<ConfigAttribute> getConfigAttributes() { return this.configAttr...
repos\spring-security-main\access\src\main\java\org\springframework\security\access\event\AuthenticationCredentialsNotFoundEvent.java
1
请完成以下Java代码
public static Date getDate(Map<String, String> requestParams, String name) { if (requestParams != null && name != null) { return parseLongDate(requestParams.get(name)); } return null; } public static Date parseLongDate(String aDate) { OffsetDateTime offsetDateTime = ...
Date parsedDate = null; try { parsedDate = shortDateFormat.parse(date); } catch (Exception e) { } return parsedDate; } public static List<String> parseToList(String value) { if (value == null || value.isEmpty()) { return null; } St...
repos\flowable-engine-main\modules\flowable-common-rest\src\main\java\org\flowable\common\rest\api\RequestUtil.java
1
请完成以下Java代码
public int getId() { return id; } public void setId(int id) { this.id = id; } public User getCustomer() { return customer; } public void setCustomer(User customer) { this.customer = customer; } // public List<Product> getProducts() { // return p...
// userProducts.add(product); // } // } // return userProducts; // } // public void setProducts(List<Product> products) { // this.products = products; // } // public void addProduct(Product product) { // products.add(product); // } // // public v...
repos\E-commerce-project-springBoot-master2\JtProject\src\main\java\com\jtspringproject\JtSpringProject\models\Cart.java
1
请完成以下Java代码
protected ProjectGenerationRequest createProjectGenerationRequest(OptionSet options) { List<?> nonOptionArguments = new ArrayList<Object>(options.nonOptionArguments()); Assert.state(nonOptionArguments.size() <= 1, "Only the target location may be specified"); ProjectGenerationRequest request = new ProjectGener...
} if (options.has(this.name)) { request.setName(options.valueOf(this.name)); } if (options.has(this.version)) { request.setVersion(options.valueOf(this.version)); } if (options.has(this.description)) { request.setDescription(options.valueOf(this.description)); } request.setExtract(optio...
repos\spring-boot-4.0.1\cli\spring-boot-cli\src\main\java\org\springframework\boot\cli\command\init\InitCommand.java
1
请完成以下Java代码
public static HUQRCode fromGlobalQRCode(final GlobalQRCode globalQRCode) { if (!isHandled(globalQRCode)) { throw new AdempiereException(INVALID_QR_CODE_ERROR_MSG) .setParameter("globalQRCode", globalQRCode); // avoid adding it to error message, it might be quite long } // // IMPORTANT: keep in sync ...
} public static JsonDisplayableQRCode toRenderedJson(@NonNull final HUQRCode huQRCode) { return JsonDisplayableQRCode.builder() .code(toGlobalQRCodeJsonString(huQRCode)) .displayable(huQRCode.toDisplayableQRCode()) .build(); } public static boolean isTypeMatching(final @NonNull GlobalQRCode globalQR...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\qrcodes\model\json\HUQRCodeJsonConverter.java
1
请完成以下Java代码
public void process(final IT item) throws Exception { processor.process(item); } @Override public RT getResult() { return processor.getResult(); } /** * @return always return <code>false</code>. Each item is a separated chunk */ @Override public boolean isSameChunk(final IT item) { return false; ...
public void newChunk(final IT item) { // nothing } @Override public void completeChunk() { // nothing } @Override public void cancelChunk() { // nothing } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\trx\processor\api\impl\TrxItemProcessor2TrxItemChunkProcessorWrapper.java
1
请完成以下Java代码
public String getId() { return id; } public void setId(String id) { this.id = id; } public String getSitename() { return sitename; } public void setSitename(String sitename) { this.sitename = sitename; } public String getSitedomain() { return sitedomain; } public void setSitedomain(String sited...
} public String getComname() { return comname; } public void setComname(String comname) { this.comname = comname; } public String getComaddress() { return comaddress; } public void setComaddress(String comaddress) { this.comaddress = comaddress; } public String getUpdateTime() { return updateTim...
repos\spring-boot-quick-master\quick-feign\src\main\java\com\quick\feign\entity\DomainDetail.java
1
请完成以下Java代码
public boolean isDeleted() { return deleted; } public boolean isNotDeleted() { return notDeleted; } public boolean isIncludeProcessVariables() { return includeProcessVariables; } public boolean isWithException() { return withJobException; } public Stri...
} public String getNameLikeIgnoreCase() { return nameLikeIgnoreCase; } public List<HistoricProcessInstanceQueryImpl> getOrQueryObjects() { return orQueryObjects; } public List<String> getInvolvedGroups() { return involvedGroups; } public HistoricProcessInstanceQue...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\HistoricProcessInstanceQueryImpl.java
1
请完成以下Java代码
public class User { @Transient public static final String SEQUENCE_NAME = "users_sequence"; @Id private BigInteger id; private String firstName; private String lastName; private String email; public User() { } public User(String firstName, String lastName, String email) { ...
public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } @Override public String toString() { return "User{" + "id=" + id + ", firstName='" + firstName + '\'' + ", lastName='" ...
repos\tutorials-master\persistence-modules\spring-boot-persistence-mongodb\src\main\java\com\baeldung\mongodb\models\User.java
1
请完成以下Java代码
private static int readInt(ByteArrayInputStream result) throws IOException { byte[] b = new byte[2]; result.read(b); return ((b[0] & 0xFF) << 8) | (b[1] & 0xFF); } private static byte[] decrypt(byte[] text, @Nullable PrivateKey key, RsaAlgorithm alg, String salt, boolean gcm) { ByteArrayInputStream input = n...
private static boolean isHex(String input) { try { Hex.decode(input); return true; } catch (Exception ex) { return false; } } public boolean canDecrypt() { return this.privateKey != null; } }
repos\spring-security-main\crypto\src\main\java\org\springframework\security\crypto\encrypt\RsaSecretEncryptor.java
1
请完成以下Java代码
public class DeleteIdentityLinkForProcessDefinitionCmd implements Command<Object>, Serializable { private static final long serialVersionUID = 1L; protected String processDefinitionId; protected String userId; protected String groupId; public DeleteIdentityLinkForProcessDefinitionCmd(String pro...
throw new ActivitiIllegalArgumentException("userId and groupId cannot both be null"); } } public Void execute(CommandContext commandContext) { ProcessDefinitionEntity processDefinition = commandContext .getProcessDefinitionEntityManager() .findById(processDefinitionId); ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\DeleteIdentityLinkForProcessDefinitionCmd.java
1
请在Spring Boot框架中完成以下Java代码
public void setLOCATIONQUAL(String value) { this.locationqual = value; } /** * Gets the value of the locationcode property. * * @return * possible object is * {@link String } * */ public String getLOCATIONCODE() { return locationcode; } ...
return quantity; } /** * Sets the value of the quantity property. * * @param value * allowed object is * {@link String } * */ public void setQUANTITY(String value) { this.quantity = value; } /** * Gets the value of the quantitymeasureun...
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\DPLAC1.java
2
请完成以下Java代码
public ReactiveAuthenticationManager customersAuthenticationManager() { return authentication -> customer(authentication) .switchIfEmpty(Mono.error(new UsernameNotFoundException(authentication .getPrincipal() .toString()))) .map(b -> new UsernamePasswordAuthentication...
.toString() .startsWith("customer") ? authentication .getPrincipal() .toString() : null); } public Mono<String> employee(Authentication authentication) { return Mono.justOrEmpty(authentication .getPrincipal() .toString() .startsWith("employee"...
repos\tutorials-master\spring-reactive-modules\spring-reactive-security\src\main\java\com\baeldung\reactive\authresolver\CustomWebSecurityConfig.java
1
请完成以下Java代码
public void setServiceFee_Product_ID (int ServiceFee_Product_ID) { if (ServiceFee_Product_ID < 1) set_Value (COLUMNNAME_ServiceFee_Product_ID, null); else set_Value (COLUMNNAME_ServiceFee_Product_ID, Integer.valueOf(ServiceFee_Product_ID)); } @Override public int getServiceFee_Product_ID() { return...
{ return get_ValueAsInt(COLUMNNAME_ServiceInvoice_DocType_ID); } @Override public void setValidFrom (java.sql.Timestamp ValidFrom) { set_Value (COLUMNNAME_ValidFrom, ValidFrom); } @Override public java.sql.Timestamp getValidFrom() { return get_ValueAsTimestamp(COLUMNNAME_ValidFrom); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_InvoiceProcessingServiceCompany.java
1
请在Spring Boot框架中完成以下Java代码
public @Nullable String getApiKey() { return this.apiKey; } public void setApiKey(@Nullable String apiKey) { this.apiKey = apiKey; } public @Nullable Proxy getProxy() { return this.proxy; } public void setProxy(@Nullable Proxy proxy) { this.proxy = proxy; } public static class Proxy { /** * Se...
return this.host; } public void setHost(@Nullable String host) { this.host = host; } public @Nullable Integer getPort() { return this.port; } public void setPort(@Nullable Integer port) { this.port = port; } } }
repos\spring-boot-4.0.1\module\spring-boot-sendgrid\src\main\java\org\springframework\boot\sendgrid\autoconfigure\SendGridProperties.java
2
请完成以下Java代码
public I_ESR_ImportFile createESRImportFile(@NonNull final I_ESR_Import header) { final I_ESR_ImportFile esrImportFile = newInstance(I_ESR_ImportFile.class); esrImportFile.setESR_Import_ID(header.getESR_Import_ID()); esrImportFile.setAD_Org_ID(header.getAD_Org_ID()); esrImportFile.setC_BP_BankAccount_ID(header...
@Override public void validateEsrImport(final I_ESR_Import esrImport) { final ImmutableList<I_ESR_ImportFile> esrImportFiles = retrieveActiveESRImportFiles(esrImport); final boolean isValid = esrImportFiles.stream() .allMatch(I_ESR_ImportFile::isValid); esrImport.setIsValid(isValid); save(esrImport); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\api\impl\ESRImportDAO.java
1
请完成以下Java代码
public class EdgeEventsCleanUpService extends AbstractCleanUpService { public static final String RANDOM_DELAY_INTERVAL_MS_EXPRESSION = "#{T(org.apache.commons.lang3.RandomUtils).nextLong(0, ${sql.ttl.edge_events.execution_interval_ms})}"; @Value("${sql.ttl.edge_events.edge_events_ttl}") priva...
public EdgeEventsCleanUpService(PartitionService partitionService, EdgeEventService edgeEventService, SqlPartitioningRepository partitioningRepository) { super(partitionService); this.edgeEventService = edgeEventService; this.partitioningRepository = partitioningRepository; } @Scheduled...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\ttl\EdgeEventsCleanUpService.java
1
请完成以下Java代码
public void setIsInDispute (boolean IsInDispute) { set_Value (COLUMNNAME_IsInDispute, Boolean.valueOf(IsInDispute)); } /** Get In Dispute. @return Document is in dispute */ public boolean isInDispute () { Object oo = get_Value(COLUMNNAME_IsInDispute); if (oo != null) { if (oo instanceof Boolean...
{ set_Value (COLUMNNAME_TimesDunned, Integer.valueOf(TimesDunned)); } /** Get Times Dunned. @return Number of times dunned previously */ public int getTimesDunned () { Integer ii = (Integer)get_Value(COLUMNNAME_TimesDunned); if (ii == null) return 0; return ii.intValue(); } /** Set Total Amoun...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DunningRunLine.java
1
请完成以下Java代码
protected HistoryEvent getHistoricProcessInstance(CommandContext commandContext) { String historicProcessInstanceId = authorization.getResourceId(); if (isNullOrAny(historicProcessInstanceId)) { return null; } return commandContext.getHistoricProcessInstanceManager() .findHistoricProcess...
} protected boolean isNullOrAny(String resourceId) { return resourceId == null || isAny(resourceId); } protected boolean isAny(String resourceId) { return Objects.equals(Authorization.ANY, resourceId); } protected boolean isResourceEqualTo(Resources resource) { return Objects.equals(resource.re...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\SaveAuthorizationCmd.java
1
请完成以下Java代码
public PrintingQueueProcessingInfo getProcessingInfo() { final boolean createWithSpecificHostKey = !item.isPrintoutForOtherUser(); return new PrintingQueueProcessingInfo(adUserPrintJobId, AD_User_ToPrint_IDs, createWithSpecificHostKey); } @Override public Iterator<I_C_Printing_Queue> createItemsIterator() { ...
{ if (persistPrintedFlag) { return super.isPrinted(item); } else { return temporaryPrinted; } } @Override public void markPrinted(@NonNull final I_C_Printing_Queue item) { if (persistPrintedFlag) { super.markPrinted(item); } else { temporaryPrinted = true; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java\de\metas\printing\api\impl\SingletonPrintingQueueSource.java
1
请完成以下Java代码
public TransactionAgents2 createTransactionAgents2() { return new TransactionAgents2(); } /** * Create an instance of {@link TransactionDates2 } * */ public TransactionDates2 createTransactionDates2() { return new TransactionDates2(); } /** * Create an instance...
return new TransactionQuantities1Choice(); } /** * Create an instance of {@link TransactionReferences2 } * */ public TransactionReferences2 createTransactionReferences2() { return new TransactionReferences2(); } /** * Create an instance of {@link JAXBElement }{@code <}...
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\ObjectFactory.java
1
请完成以下Java代码
public class SpringIoInitializrMetadataUpdateStrategy implements InitializrMetadataUpdateStrategy { private static final Log logger = LogFactory.getLog(SpringIoInitializrMetadataUpdateStrategy.class); private final RestTemplate restTemplate; private final ObjectMapper objectMapper; public SpringIoInitializrMeta...
* retrieved */ protected List<DefaultMetadataElement> fetchSpringBootVersions(String url) { if (StringUtils.hasText(url)) { try { logger.info("Fetching Spring Boot metadata from " + url); return new SpringBootMetadataReader(this.objectMapper, this.restTemplate, url).getBootVersions(); } catch (Exc...
repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\support\SpringIoInitializrMetadataUpdateStrategy.java
1
请完成以下Java代码
private int onCacheReset(CacheInvalidateMultiRequest multiRequest) { if (!multiRequest.isResetAll()) { return 0; } // reset defaults qualityBasedConfigProviderDefault = null; qualityInvoiceLineGroupsBuilderProviderDefault = null; return 2; } private final <T> T getInstance(final String sysConfigNa...
qualityBasedConfigProvider = provider; } @Override public IQualityInvoiceLineGroupsBuilderProvider getQualityInvoiceLineGroupsBuilderProvider() { if (qualityInvoiceLineGroupsBuilderProvider != null) { return qualityInvoiceLineGroupsBuilderProvider; } if (qualityInvoiceLineGroupsBuilderProviderDefault =...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\impl\QualityBasedSpiProviderService.java
1
请在Spring Boot框架中完成以下Java代码
public class RestTemplateConfiguration { @Bean public RestTemplate restTemplate() { try { // Timeout configurations SocketConfig socketConfig = SocketConfig.custom() .setSoTimeout(Timeout.ofSeconds(30)) // Read timeout .build(); Connecti...
.setDefaultSocketConfig(socketConfig) .setDefaultConnectionConfig(connectionConfig) .build(); CloseableHttpClient httpClient = HttpClients.custom() .setConnectionManager(connectionManager) .setDefaultRequestConfig(requestConfig) .bui...
repos\tutorials-master\spring-boot-modules\spring-boot-3\src\main\java\com\baeldung\restclient\RestTemplateConfiguration.java
2
请完成以下Java代码
public static <T> CompletableFuture<T> retryUnsafe(Supplier<T> supplier, int maxRetries) { CompletableFuture<T> cf = CompletableFuture.supplyAsync(supplier); sleep(100l); for (int i = 0; i < maxRetries; i++) { cf = cf.exceptionally(__ -> supplier.get()); } return cf; ...
sleep(100); for (int i = 0; i < maxRetries; i++) { cf = cf.exceptionallyAsync(__ -> supplier.get()); } return cf; } private static void sleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { throw new Runti...
repos\tutorials-master\core-java-modules\core-java-concurrency-basic-3\src\main\java\com\baeldung\concurrent\completablefuture\retry\RetryCompletableFuture.java
1