instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public boolean canRead(EvaluationContext context, @Nullable Object target, String name) { return asEnvironment(target) .filter(environment -> environment.containsProperty(name)) .isPresent(); } /** * @inheritDoc */ @Override public TypedValue read(EvaluationContext context, @Nullable Object target, St...
* @inheritDoc * @return {@literal false}. */ @Override public boolean canWrite(EvaluationContext context, @Nullable Object target, String name) { return false; } /** * @inheritDoc */ @Override public void write(EvaluationContext context, @Nullable Object target, String name, @Nullable Object newValue) ...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\expression\SmartEnvironmentAccessor.java
1
请在Spring Boot框架中完成以下Java代码
public class SqlInitializationProperties { /** * Locations of the schema (DDL) scripts to apply to the database. */ private @Nullable List<String> schemaLocations; /** * Locations of the data (DML) scripts to apply to the database. */ private @Nullable List<String> dataLocations; /** * Platform to use...
public @Nullable String getUsername() { return this.username; } public void setUsername(@Nullable String username) { this.username = username; } public @Nullable String getPassword() { return this.password; } public void setPassword(@Nullable String password) { this.password = password; } public boo...
repos\spring-boot-4.0.1\module\spring-boot-sql\src\main\java\org\springframework\boot\sql\autoconfigure\init\SqlInitializationProperties.java
2
请完成以下Java代码
public class PrimeGenerator { public static List<Integer> sieveOfEratosthenes(int n) { final boolean prime[] = new boolean[n + 1]; Arrays.fill(prime, true); for (int p = 2; p * p <= n; p++) { if (prime[p]) { for (int i = p * 2; i <= n; i += p) ...
return primeNumbers; } private static boolean isPrimeBruteForce(int x) { for (int i = 2; i < x; i++) { if (x % i == 0) { return false; } } return true; } public static List<Integer> primeNumbersTill(int max) { return IntStream.ran...
repos\tutorials-master\core-java-modules\core-java-numbers-2\src\main\java\com\baeldung\prime\PrimeGenerator.java
1
请完成以下Java代码
public boolean isValid () { Object oo = get_Value(COLUMNNAME_IsValid); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName ...
/** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName(...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Alert.java
1
请在Spring Boot框架中完成以下Java代码
public static class Export { /** * Whether unsampled spans should be exported. */ private boolean includeUnsampled; /** * Maximum time an export will be allowed to run before being cancelled. */ private Duration timeout = Duration.ofSeconds(30); /** * Maximum batch size for each export. This...
public int getMaxBatchSize() { return this.maxBatchSize; } public void setMaxBatchSize(int maxBatchSize) { this.maxBatchSize = maxBatchSize; } public int getMaxQueueSize() { return this.maxQueueSize; } public void setMaxQueueSize(int maxQueueSize) { this.maxQueueSize = maxQueueSize; } pu...
repos\spring-boot-4.0.1\module\spring-boot-micrometer-tracing-opentelemetry\src\main\java\org\springframework\boot\micrometer\tracing\opentelemetry\autoconfigure\OpenTelemetryTracingProperties.java
2
请完成以下Java代码
public String getDescription() { if (localizedDescription != null && localizedDescription.length() > 0) { return localizedDescription; } else { return description; } } public void setDescription(String description) { this.description = description; } ...
return type; } public void setType(String type) { this.type = type; } public String getDataObjectDefinitionKey() { return dataObjectDefinitionKey; } public void setDataObjectDefinitionKey(String dataObjectDefinitionKey) { this.dataObjectDefinitionKey = dataObjectDefini...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\DataObjectImpl.java
1
请在Spring Boot框架中完成以下Java代码
public Boolean getWithoutTenantId() { return withoutTenantId; } public void setWithoutTenantId(Boolean withoutTenantId) { this.withoutTenantId = withoutTenantId; } public String getRootScopeId() { return rootScopeId; } public void setRootScopeId(String rootScopeId) { ...
return parentScopeId; } public void setParentScopeId(String parentScopeId) { this.parentScopeId = parentScopeId; } public Set<String> getCallbackIds() { return callbackIds; } public void setCallbackIds(Set<String> callbackIds) { this.callbackIds = callbackIds; } }
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\history\HistoricProcessInstanceQueryRequest.java
2
请完成以下Java代码
public Builder setMandatory(final boolean mandatory) { this.mandatory = mandatory; return this; } public Builder setHideGridColumnIfEmpty(final boolean hideGridColumnIfEmpty) { this.hideGridColumnIfEmpty = hideGridColumnIfEmpty; return this; } public Builder setValueClass(final Class<?> valueC...
if (_sqlValueClass != null) { return _sqlValueClass; } return getValueClass(); } public Builder setLookupDescriptor(@Nullable final LookupDescriptor lookupDescriptor) { this._lookupDescriptor = lookupDescriptor; return this; } public OptionalBoolean getNumericKey() { return _numericK...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\sql\SqlDocumentFieldDataBindingDescriptor.java
1
请完成以下Java代码
private void syncCollectedExternalReferencesIfRequired(@NonNull final Collection<ExternalReferenceId> externalReferenceIds) { if (externalReferenceIds.isEmpty()) { Loggables.withLogger(logger, Level.DEBUG).addLog("ExternalReferenceId list to sync is empty! No action is performed!"); return; } if (!exter...
@NonNull protected abstract Optional<Set<IExternalSystemChildConfigId>> getAdditionalExternalSystemConfigIds(@NonNull final ExternalReferenceId externalReferenceId); @Override protected void runPreExportHook(final TableRecordReference recordReferenceToExport) { } protected abstract Map<String, String> buildPara...
repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\export\externalreference\ExportExternalReferenceToExternalSystem.java
1
请在Spring Boot框架中完成以下Java代码
public class UserApi { private final UserServiceImpl userServiceImpl; public UserApi(UserServiceImpl userServiceImpl) { this.userServiceImpl = userServiceImpl; } @PostMapping public ResponseEntity<Response> createUser(@RequestBody User user) { if (StringUtils.isBlank(user.getId())...
public User getUser(@PathVariable("userId") String userId) { return userServiceImpl.findById(userId).orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "No user exists with the given Id")); } @GetMapping() public List<User> getAllUsers() { return userServiceImpl.findAll().o...
repos\tutorials-master\spring-security-modules\spring-security-web-boot-3\src\main\java\com\baeldung\httpfirewall\api\UserApi.java
2
请在Spring Boot框架中完成以下Java代码
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SubscriptionState that = (SubscriptionState) o; if (subscriptionId != that.subscriptionId) return false; if (wsSessionId != null ? !wsSessionId.equals(that.w...
result = 31 * result + subscriptionId; result = 31 * result + (entityId != null ? entityId.hashCode() : 0); result = 31 * result + (type != null ? type.hashCode() : 0); return result; } @Override public String toString() { return "SubscriptionState{" + "type=...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\ws\telemetry\sub\SubscriptionState.java
2
请完成以下Java代码
public void setSiteName (final @Nullable java.lang.String SiteName) { set_ValueNoCheck (COLUMNNAME_SiteName, SiteName); } @Override public java.lang.String getSiteName() { return get_ValueAsString(COLUMNNAME_SiteName); } @Override public void setValue (final @Nullable java.lang.String Value) { set_Val...
return get_ValueAsString(COLUMNNAME_Value); } @Override public void setVATaxID (final @Nullable java.lang.String VATaxID) { set_Value (COLUMNNAME_VATaxID, VATaxID); } @Override public java.lang.String getVATaxID() { return get_ValueAsString(COLUMNNAME_VATaxID); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_119_v.java
1
请完成以下Java代码
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception { String identityLinkType = BpmnXMLUtil.getAttributeValue(ATTRIBUTE_NAME, xtr); // the attribute value may be unqualified if (identityLinkType == null) { i...
String userPrefix = "user("; String groupPrefix = "group("; if (assignmentValue.startsWith(userPrefix)) { assignmentValue = assignmentValue.substring(userPrefix.length(), assignmentValue.length() - 1).trim(); ((UserT...
repos\flowable-engine-main\modules\flowable-bpmn-converter\src\main\java\org\flowable\bpmn\converter\UserTaskXMLConverter.java
1
请完成以下Java代码
public static DeliveryViaRule ofNullableCode(@Nullable final String code) { final DeliveryViaRule defaultWhenNull = null; return ofNullableCodeOr(code, defaultWhenNull); } @Nullable public static DeliveryViaRule ofNullableCodeOr(@Nullable final String code, @Nullable final DeliveryViaRule defaultWhenNull) { ...
} return type; } private static final ImmutableMap<String, DeliveryViaRule> typesByCode = Maps.uniqueIndex(Arrays.asList(values()), DeliveryViaRule::getCode); public boolean isShipper() { return this == Shipper; } @Nullable public static String toCodeOrNull(final DeliveryViaRule type) { return type != ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\order\DeliveryViaRule.java
1
请完成以下Spring Boot application配置
management.endpoints.web.exposure.include=* management.metrics.enable.root=true management.metrics.enable.jvm=true management.endpoint.restart.enabled=true spring.
datasource.jmx-enabled=false management.endpoint.shutdown.enabled=true
repos\tutorials-master\spring-boot-modules\spring-boot-deployment\src\main\resources\application.properties
2
请在Spring Boot框架中完成以下Java代码
public CustomNotifier customNotifier(InstanceRepository repository) { return new CustomNotifier(repository); } @Bean public CustomEndpoint customEndpoint() { return new CustomEndpoint(); } // tag::customization-http-headers-providers[] @Bean public HttpHeadersProvider customHttpHeadersProvider() { return...
} @Bean public AuditEventRepository auditEventRepository() { return new InMemoryAuditEventRepository(); } @Bean public EmbeddedDatabase dataSource() { return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL) .addScript("org/springframework/session/jdbc/schema-hsqldb.sql") .build(); } }
repos\spring-boot-admin-master\spring-boot-admin-samples\spring-boot-admin-sample-servlet\src\main\java\de\codecentric\boot\admin\sample\SpringBootAdminServletApplication.java
2
请完成以下Java代码
public TransportClient getObject() throws Exception { return client; } @Override public Class<TransportClient> getObjectType() { return TransportClient.class; } @Override public boolean isSingleton() { return true; } @Override public void afterPropertiesSet...
} public void setClientTransportSniff(Boolean clientTransportSniff) { this.clientTransportSniff = clientTransportSniff; } public String getClientNodesSamplerInterval() { return clientNodesSamplerInterval; } public void setClientNodesSamplerInterval(String clientNodesSamplerInterva...
repos\SpringBoot-Labs-master\lab-40\lab-40-elasticsearch\src\main\java\cn\iocoder\springboot\lab40\zipkindemo\spring\TracingTransportClientFactoryBean.java
1
请完成以下Java代码
public String getEmployeeUsingMapSqlParameterSource() { final SqlParameterSource namedParameters = new MapSqlParameterSource().addValue("id", 1); return namedParameterJdbcTemplate.queryForObject("SELECT FIRST_NAME FROM EMPLOYEE WHERE ID = :id", namedParameters, String.class); } public int getE...
} @Override public int getBatchSize() { return 3; } }); } public int[] batchUpdateUsingNamedParameterJDBCTemplate(final List<Employee> employees) { final SqlParameterSource[] batch = SqlParameterSourceUtils.createBatch(employees.toArray()); ...
repos\tutorials-master\persistence-modules\spring-persistence-simple\src\main\java\com\baeldung\spring\jdbc\template\guide\EmployeeDAO.java
1
请完成以下Java代码
public class MaterialTrackingReportAgregationItem { /** * * @param ppOrder can be <code>null</code>. If <code>null</code>, then the item is counted as an <code>M_InOut</code> material receipt.<br> * If not <code>null</code> then it is counted as a <code>PP_Order</code> material issue. * @param inOut...
/** * Useful for tracking, troubleshooting */ private final I_M_Material_Tracking materialTracking; /** * The significant qty for the item. It can either be qtyIssued if the pp_Order is set, or qtyReceived if it isn't */ BigDecimal qty; public BigDecimal getQty() { return qty; } public I_PP_Order ge...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\process\MaterialTrackingReportAgregationItem.java
1
请完成以下Java代码
public Set<InvoiceId> generateInvoicesFromShipmentLines(@NonNull final List<I_M_InOutLine> shipmentLines) { if (shipmentLines.isEmpty()) { Loggables.withLogger(logger, Level.DEBUG).addLog("generateInvoicesFromShipmentLines - Given shipmentLines list is empty; -> nothing to do"); return ImmutableSet.of(); }...
final AsyncBatchId asyncBatchId = asyncBatchBL.newAsyncBatch(C_Async_Batch_InternalName_InvoiceCandidate_Processing); final PInstanceId invoiceCandidatesSelectionId = DB.createT_Selection(invoiceCandIds, Trx.TRXNAME_None); final IInvoiceCandidateEnqueuer enqueuer = invoiceCandBL.enqueueForInvoicing() .setCont...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoice\InvoiceService.java
1
请完成以下Java代码
public int getC_AcctSchema_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_AcctSchema_ID); if (ii == null) return 0; return ii.intValue(); } public I_C_ValidCombination getIntercompanyDueFrom_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.T...
} public I_C_ValidCombination getIntercompanyDueTo_A() throws RuntimeException { return (I_C_ValidCombination)MTable.get(getCtx(), I_C_ValidCombination.Table_Name) .getPO(getIntercompanyDueTo_Acct(), get_TrxName()); } /** Set Intercompany Due To Acct. @param IntercompanyDueTo_Acct Intercompany Due To ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_InterOrg_Acct.java
1
请在Spring Boot框架中完成以下Java代码
public FileWritableDataSource writableDataSource(ObjectMapper objectMapper) throws IOException { // File 配置。这里先写死,推荐后面写到 application.yaml 配置文件中。 String directory = System.getProperty("user.home") + File.separator + "sentinel" + File.separator + System.getProperty("project...
} catch (JsonProcessingException e) { throw new RuntimeException(e); } } }); // 注册到 WritableDataSourceRegistry 中 WritableDataSourceRegistry.registerFlowDataSource(fileWritableDataSource); return fileWritable...
repos\SpringBoot-Labs-master\lab-46\lab-46-sentinel-demo-file\src\main\java\cn\iocoder\springboot\lab46\sentineldemo\config\SentinelConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public class FunctionalSpringBootApplication { private static final Actor BRAD_PITT = new Actor("Brad", "Pitt"); private static final Actor TOM_HANKS = new Actor("Tom", "Hanks"); private static final List<Actor> actors = new CopyOnWriteArrayList<>(Arrays.asList(BRAD_PITT, TOM_HANKS)); private RouterFu...
}); } @Bean public ServletRegistrationBean servletRegistrationBean() throws Exception { HttpHandler httpHandler = WebHttpHandlerBuilder.webHandler((WebHandler) toHttpHandler(routingFunction())) .filter(new IndexRewriteFilter()) .build(); ServletRegistrationBean regis...
repos\tutorials-master\spring-reactive-modules\spring-reactive-3\src\main\java\com\baeldung\functional\FunctionalSpringBootApplication.java
2
请在Spring Boot框架中完成以下Java代码
public boolean isReadable() { return this.resource.isReadable(); } @Override public boolean isOpen() { return this.resource.isOpen(); } @Override public URL getURL() throws IOException { return this.resource.getURL(); } @Override public URI getURI() throws IOException { ret...
public net.shibboleth.shared.resource.Resource createRelativeResource(String relativePath) throws IOException { return new SpringResource(this.resource.createRelative(relativePath)); } @Override public String getFilename() { return this.resource.getFilename(); } @Override public String ...
repos\spring-security-main\saml2\saml2-service-provider\src\opensaml5Main\java\org\springframework\security\saml2\provider\service\registration\OpenSaml5AssertingPartyMetadataRepository.java
2
请完成以下Spring Boot application配置
server: port: 8081 spring: security: oauth2: client: registration: keycloak: client-id: my-client scope: openid,profile,email authorization-grant-type: authorization_code redirect-uri: "{baseUrl}/login/oauth
2/code/{registrationId}" provider: keycloak: issuer-uri: http://localhost:8787/realms/my-realm
repos\tutorials-master\spring-security-modules\spring-security-faking-oauth2-sso\src\main\resources\application.yaml
2
请完成以下Java代码
private I_C_Invoice retrieveInvoiceRecordByDocumentNoAndCreated(@NonNull final String documentNo, @NonNull final Instant created) { final I_C_Invoice invoiceRecord = retrieveInvoiceRecordByDocumentNoAndCreatedOrNull(documentNo, created); if (invoiceRecord != null) { return invoiceRecord; } throw new Inv...
.tags(response.getAdditionalTags()) .build(); final AttachmentEntryCreateRequest attachmentEntryCreateRequest = AttachmentEntryCreateRequest .builderFromByteArray(response.getRequest().getFileName(), response.getRequest().getData()) .tags(attachmentTags) .build(); attachmentEntryService.createNewAt...
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_base\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\base\imp\InvoiceResponseRepo.java
1
请在Spring Boot框架中完成以下Java代码
public CalculatedFieldType getType() { return CalculatedFieldType.GEOFENCING; } @Override @JsonIgnore public Map<String, Argument> getArguments() { Map<String, Argument> args = new HashMap<>(entityCoordinates.toArguments()); zoneGroups.forEach((zgName, zgConfig) -> args.put(zgNa...
.map(ZoneGroupConfiguration::getRefEntityId) .filter(Objects::nonNull) .collect(toSet()); } @Override public Output getOutput() { return output; } @Override public void validate() { zoneGroups.forEach((key, value) -> value.validate(key)); } ...
repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\cf\configuration\geofencing\GeofencingCalculatedFieldConfiguration.java
2
请完成以下Java代码
public class PurchaseViewLayoutFactory { private final CCache<LayoutKey, ViewLayout> viewLayoutCache = CCache.newCache(PurchaseViewLayoutFactory.class + "#ViewLayout", 1, 0); private final ITranslatableString caption; @Builder private PurchaseViewLayoutFactory(final ITranslatableString caption) { this.caption ...
.setHasTreeSupport(true) .setTreeCollapsible(true) .setTreeExpandedDepth(ViewLayout.TreeExpandedDepth_AllCollapsed) // .addElementsFromViewRowClass(PurchaseRow.class, key.getViewDataType()) // .build(); } @lombok.Value @lombok.Builder private static class LayoutKey { WindowId windowId; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\sales\purchasePlanning\view\PurchaseViewLayoutFactory.java
1
请在Spring Boot框架中完成以下Java代码
public void refreshEx(I_AD_Table_MView mview, PO sourcePO, RefreshMode refreshMode, String trxName) { if (refreshMode == RefreshMode.Complete) { updateComplete(mview); } else if (refreshMode == RefreshMode.Partial) { updatePartial(mview, sourcePO, trxName); } else { throw new AdempiereExceptio...
} }); return ok[0]; } @Override public boolean isSourceChanged(MViewMetadata mdata, PO sourcePO, int changeType) { final String sourceTableName = sourcePO.get_TableName(); final Set<String> sourceColumns = mdata.getSourceColumns(sourceTableName); if (sourceColumns == null || sourceColumns.isEmpty()) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\service\impl\TableMViewBL.java
2
请在Spring Boot框架中完成以下Java代码
public @Nullable Boolean getEnableComplexMapKeySerialization() { return this.enableComplexMapKeySerialization; } public void setEnableComplexMapKeySerialization(@Nullable Boolean enableComplexMapKeySerialization) { this.enableComplexMapKeySerialization = enableComplexMapKeySerialization; } public @Nullable Bo...
public void setDisableHtmlEscaping(@Nullable Boolean disableHtmlEscaping) { this.disableHtmlEscaping = disableHtmlEscaping; } public @Nullable String getDateFormat() { return this.dateFormat; } public void setDateFormat(@Nullable String dateFormat) { this.dateFormat = dateFormat; } /** * Enumeration of...
repos\spring-boot-4.0.1\module\spring-boot-gson\src\main\java\org\springframework\boot\gson\autoconfigure\GsonProperties.java
2
请完成以下Java代码
public String getSrlNb() { return srlNb; } /** * Sets the value of the srlNb property. * * @param value * allowed object is * {@link String } * */ public void setSrlNb(String value) { this.srlNb = value; } /** * Gets the value o...
* This is why there is not a <CODE>set</CODE> method for the apprvlNb property. * * <p> * For example, to add a new item, do as follows: * <pre> * getApprvlNb().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@li...
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\PointOfInteractionComponent1.java
1
请完成以下Java代码
public long getTimeoutTime() { return timeoutTime; } public void setTimeoutTime(long timeoutTime) { this.timeoutTime = timeoutTime; } } /** * set cache * * @param key * @param val * @param cacheTime * @return */ public sta...
} /** * get cache * * @param key * @return */ public static Object get(String key){ if (key==null || key.trim().length()==0) { return null; } LocalCacheData localCacheData = cacheRepository.get(key); if (localCacheData!=null && System.current...
repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\core\util\LocalCacheUtil.java
1
请完成以下Java代码
I_C_Order getOrder() { return order; } private void setBPSalesRepIdToOrder(@NonNull final I_C_Order order, @NonNull final OLCand olCand) { switch (olCand.getAssignSalesRepRule()) { case Candidate: order.setC_BPartner_SalesRep_ID(BPartnerId.toRepoId(olCand.getSalesRepId())); break; case BPartner...
private void setExternalBPartnerInfo(@NonNull final I_C_OrderLine orderLine, @NonNull final OLCand candidate) { orderLine.setExternalSeqNo(candidate.getLine()); final I_C_OLCand olCand = candidate.unbox(); orderLine.setBPartner_QtyItemCapacity(olCand.getQtyItemCapacity()); final UomId uomId = UomId.ofRepoId...
repos\metasfresh-new_dawn_uat\backend\de.metas.salescandidate.base\src\main\java\de\metas\ordercandidate\api\OLCandOrderFactory.java
1
请完成以下Java代码
public class BubbleSort { void bubbleSort(Integer[] arr) { int n = arr.length; IntStream.range(0, n - 1) .flatMap(i -> IntStream.range(1, n - i)) .forEach(j -> { if (arr[j - 1] > arr[j]) { int temp = arr[j]; arr[j] = arr[j - 1]; ...
boolean swapNeeded = true; while (i < n - 1 && swapNeeded) { swapNeeded = false; for (int j = 1; j < n - i; j++) { if (arr[j - 1] > arr[j]) { int temp = arr[j - 1]; arr[j - 1] = arr[j]; arr[j] = temp; ...
repos\tutorials-master\algorithms-modules\algorithms-sorting-2\src\main\java\com\baeldung\algorithms\bubblesort\BubbleSort.java
1
请完成以下Java代码
public void setExtension(String newExtension) { m_extension = newExtension; } /** * Get Extension * @return extension */ public String getExtension() { return m_extension; } /** * Accept File * @param file file to be tested * @return true if OK */ public boolean accept(File file) { // N...
} // getFileName /** * Verify file with filter * @param file file * @param filter filter * @return file */ public static File getFile(File file, FileFilter filter) { String fName = file.getAbsolutePath(); if (fName == null || fName.equals("")) fName = "Adempiere"; // ExtensionFileFilter eff ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\ExtensionFileFilter.java
1
请在Spring Boot框架中完成以下Java代码
public void initExecutor() { executor = ThingsBoardExecutors.newSingleThreadScheduledExecutor("re-rest-callback"); } @PreDestroy public void shutdownExecutor() { if (executor != null) { executor.shutdownNow(); } } @Override public void processRestApiCallToRu...
callback.onSuccess(); } private void sendRequestToRuleEngine(TenantId tenantId, TbMsg msg, boolean useQueueFromTbMsg) { clusterService.pushMsgToRuleEngine(tenantId, msg.getOriginator(), msg, useQueueFromTbMsg, null); } private void scheduleTimeout(TbMsg request, UUID requestId, ConcurrentMap<U...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\ruleengine\DefaultRuleEngineCallService.java
2
请在Spring Boot框架中完成以下Java代码
public void requestAllUpdates() { convertAndSend(RabbitMQConfig.QUEUENAME_MSV3ServerRequests, MSV3ServerRequest.requestAll()); logger.info("Requested all data from MSV3 server peer"); } public void requestConfigUpdates() { convertAndSend(RabbitMQConfig.QUEUENAME_MSV3ServerRequests, MSV3ServerRequest.requestC...
} public void publishProductExcludes(@NonNull final MSV3ProductExcludesUpdateEvent event) { convertAndSend(RabbitMQConfig.QUEUENAME_ProductExcludeUpdatedEvents, event); } public void publishSyncOrderRequest(final MSV3OrderSyncRequest request) { convertAndSend(RabbitMQConfig.QUEUENAME_SyncOrderRequestEvents, ...
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server-peer\src\main\java\de\metas\vertical\pharma\msv3\server\peer\service\MSV3ServerPeerService.java
2
请完成以下Java代码
protected void initializeVersion(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context, BaseCallableElement callableElement) { ExpressionManager expressionManager = context.getExpressionManager(); String version = getVersion(element, activity, context); ParameterValueProvider versionProvide...
} else if (isCompositeExpression(value, expressionManager)) { Expression expression = expressionManager.createExpression(value); return new ElValueProvider(expression); } else { return new ConstantValueProvider(value); } } protected abstract BaseCallableElement createCallableElement(); ...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\handler\CallingTaskItemHandler.java
1
请在Spring Boot框架中完成以下Java代码
public BigDecimal getSettFee() { return settFee; } /** * 结算手续费 * * @param settFee */ public void setSettFee(BigDecimal settFee) { this.settFee = settFee; } /** * 结算打款金额 * * @return */ public BigDecimal getRemitAmount() { return remitAmount; } /** * 结算打款金额 * * @param remitAmount...
* @return */ public String getRemitRemark() { return remitRemark; } /** * 打款备注 * * @param remitRemark */ public void setRemitRemark(String remitRemark) { this.remitRemark = remitRemark == null ? null : remitRemark.trim(); } /** * 操作员登录名 * * @return */ public String getOperatorLoginname(...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\account\entity\RpSettRecord.java
2
请完成以下Java代码
private void processDocuments(final Iterator<GenericPO> documents, final String docAction) { while (documents.hasNext()) { final Object doc = documents.next(); trxManager.runInNewTrx(new TrxRunnable2() { @Override public void run(final String localTrxName) { InterfaceWrapperHelper.refresh...
{ final String msg = "Processing of document " + doc + ": Failed - ProccessMsg: " + documentBL.getDocument(doc).getProcessMsg() + "; ExceptionMsg: " + e.getMessage(); addLog(msg); log.warn(msg, e); countError++; return true; // rollback } @Override public void doFinal...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\process\AbstractProcessDocumentsTemplate.java
1
请在Spring Boot框架中完成以下Java代码
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) { return this.notSupportedFile(model, fileAttribute, "系统还不支持该格式文件的在线预览"); } /** * 通用的预览失败,导向到不支持的文件响应页面 * * @return 页面 */ public String notSupportedFile(Model model, FileAttribute fileAttribute...
return this.notSupportedFile(model, "未知", errMsg); } /** * 通用的预览失败,导向到不支持的文件响应页面 * * @return 页面 */ public String notSupportedFile(Model model, String fileType, String errMsg) { model.addAttribute("fileType", KkFileUtils.htmlEscape(fileType)); model.addAttribute("msg", K...
repos\kkFileView-master\server\src\main\java\cn\keking\service\impl\OtherFilePreviewImpl.java
2
请完成以下Java代码
public static boolean isRotationUsingSuffixAndPrefix(String origin, String rotation) { if (origin.length() == rotation.length()) { return checkPrefixAndSuffix(origin, rotation); } return false; } static boolean checkPrefixAndSuffix(String origin, String rotation) { ...
} } } return false; } private static boolean checkRotationPrefixWithOriginSuffix(String origin, String rotation, int i) { return origin.substring(i) .equals(rotation.substring(0, origin.length() - i)); } private static boolean checkOriginPrefixWithRotati...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-7\src\main\java\com\baeldung\algorithms\stringrotation\StringRotation.java
1
请完成以下Java代码
public Boolean getGenerateUniqueProcessEngineName() { return generateUniqueProcessEngineName; } public void setGenerateUniqueProcessEngineName(Boolean generateUniqueProcessEngineName) { this.generateUniqueProcessEngineName = generateUniqueProcessEngineName; } public Boolean getGenerateUniqueProcessApp...
.add("historyLevelDefault=" + historyLevelDefault) .add("autoDeploymentEnabled=" + autoDeploymentEnabled) .add("deploymentResourcePattern=" + Arrays.toString(deploymentResourcePattern)) .add("defaultSerializationFormat=" + defaultSerializationFormat) .add("licenseFile=" + licenseFile) .add...
repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\property\CamundaBpmProperties.java
1
请完成以下Java代码
private synchronized void updateFromBusinessRulesRepository() { final BusinessRulesCollection rulesPrev = this.rules; this.rules = ruleService.getRules(); if (Objects.equals(this.rules, rulesPrev)) { return; } updateRegisteredInterceptors(); } private synchronized void updateRegisteredInterceptors()...
registeredTableNames.add(triggerTableName); logger.info("Registered trigger for {}", triggerTableName); } // // Remove no longer needed interceptors for (final String triggerTableName : registeredTableNamesNoLongerNeeded) { engine.removeModelChange(triggerTableName, this); registeredTableNames.remov...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\business_rule\trigger\interceptor\BusinessRuleTriggerInterceptor.java
1
请完成以下Java代码
public class PermissionCheckBuilder { protected List<PermissionCheck> atomicChecks = new ArrayList<PermissionCheck>(); protected List<CompositePermissionCheck> compositeChecks = new ArrayList<CompositePermissionCheck>(); protected boolean disjunctive = true; protected PermissionCheckBuilder parent; public ...
return parent; } public CompositePermissionCheck build() { validate(); CompositePermissionCheck permissionCheck = new CompositePermissionCheck(disjunctive); permissionCheck.setAtomicChecks(atomicChecks); permissionCheck.setCompositeChecks(compositeChecks); return permissionCheck; } pub...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\db\PermissionCheckBuilder.java
1
请完成以下Java代码
private IQueryBuilder<I_C_POS_Order> toSqlQuery(final POSOrderQuery query) { final IQueryBuilder<I_C_POS_Order> sqlQueryBuilder = queryBL.createQueryBuilder(I_C_POS_Order.class) .addEqualsFilter(I_C_POS_Order.COLUMNNAME_C_POS_ID, query.getPosTerminalId()) .addEqualsFilter(I_C_POS_Order.COLUMNNAME_Cashier_ID,...
{ return trxManager.callInThreadInheritedTrx(() -> newLoaderAndSaver().createOrUpdateByExternalId(externalId, factory, updater)); } public void updateById(@NonNull final POSOrderId id, @NonNull final Consumer<POSOrder> updater) { trxManager.callInThreadInheritedTrx(() -> newLoaderAndSaver().updateById(id, updat...
repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java\de\metas\pos\POSOrdersRepository.java
1
请在Spring Boot框架中完成以下Java代码
public class ScriptType { public static ScriptType ofFileExtension(final String fileExtension) { return scriptTypesByFileExtension.computeIfAbsent( normalizeFileExtension(fileExtension), ScriptType::new); } public static final ScriptType NONE = new ScriptType(""); public static final ScriptType SQL = ne...
private final String fileExtension; private ScriptType(@NonNull final String fileExtension) { this.fileExtension = normalizeFileExtension(fileExtension); } private static final String normalizeFileExtension(final String fileExtension) { if (fileExtension == null) { return ""; } return fileExtension...
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\ScriptType.java
2
请完成以下Java代码
public List<int[][]> generate(int minLength, int maxLength, int size) { List<int[][]> samples = new ArrayList<int[][]>(size); for (int i = 0; i < size; i++) { samples.add(generate((int) (Math.floor(Math.random() * (maxLength - minLength)) + minLength))); } return ...
} protected static boolean similar(float[] A, float[] B) { final float eta = 1e-2f; for (int i = 0; i < A.length; i++) if (Math.abs(A[i] - B[i]) > eta) return false; return true; } protected static Object deepCopy(Object object) { if (object == null) ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\hmm\HiddenMarkovModel.java
1
请完成以下Java代码
public void setpackingmaterialname (java.lang.String packingmaterialname) { set_ValueNoCheck (COLUMNNAME_packingmaterialname, packingmaterialname); } /** Get packingmaterialname. @return packingmaterialname */ @Override public java.lang.String getpackingmaterialname () { return (java.lang.String)get_Val...
Schlüssel des Produktes */ @Override public void setProductValue (java.lang.String ProductValue) { set_ValueNoCheck (COLUMNNAME_ProductValue, ProductValue); } /** Get Produktschlüssel. @return Schlüssel des Produktes */ @Override public java.lang.String getProductValue () { return (java.lang.Strin...
repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java-gen\de\metas\fresh\model\X_M_PriceList_V.java
1
请在Spring Boot框架中完成以下Java代码
public Inventory complete(Inventory inventory) { final InventoryId inventoryId = inventory.getId(); inventoryService.completeDocument(inventoryId); return inventoryService.getById(inventory.getId()); } public LocatorScannedCodeResolverResult resolveLocator( @NonNull ScannedCode scannedCode, @NonNull WFP...
} private ResolveHUCommandBuilder newHUScannedCodeResolveCommand() { return ResolveHUCommand.builder() .productService(productService) .huService(huService); } public Inventory reportCounting(@NonNull final JsonCountRequest request, final UserId callerId) { final InventoryId inventoryId = toInventory...
repos\metasfresh-new_dawn_uat\backend\de.metas.inventory.mobileui\src\main\java\de\metas\inventory\mobileui\job\service\InventoryJobService.java
2
请完成以下Java代码
public CalloutException setCalloutInstance(final ICalloutInstance calloutInstance) { this.calloutInstance = calloutInstance; setParameter("calloutInstance", calloutInstance); return this; } public CalloutException setCalloutInstanceIfAbsent(final ICalloutInstance calloutInstance) { if (this.calloutInstance...
return this; } public CalloutException setFieldIfAbsent(final ICalloutField field) { if (this.field == null) { setField(field); } return this; } public ICalloutField getCalloutField() { return field; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\callout\exceptions\CalloutException.java
1
请完成以下Java代码
public ResponseEntity<JsonError> handlePageNotFoundException(@NonNull final PageNotFoundException e) { return logAndCreateError(e, HttpStatus.NOT_FOUND); } @ExceptionHandler(PermissionNotGrantedException.class) public ResponseEntity<JsonError> handlePermissionNotGrantedException(@NonNull final PermissionNotGrant...
private ResponseEntity<JsonError> logAndCreateError( @NonNull final Exception e, @NonNull final HttpStatus status) { return logAndCreateError(e, null, status); } private ResponseEntity<JsonError> logAndCreateError( @NonNull final Exception e, @Nullable final String detail, @NonNull final HttpStatus...
repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\util\web\exception\RestResponseEntityExceptionHandler.java
1
请完成以下Java代码
default String getGender() { return this.getClaimAsString(StandardClaimNames.GENDER); } /** * Returns the user's birth date {@code (birthdate)}. * @return the user's birth date */ default String getBirthdate() { return this.getClaimAsString(StandardClaimNames.BIRTHDATE); } /** * Returns the user's ti...
*/ default Boolean getPhoneNumberVerified() { return this.getClaimAsBoolean(StandardClaimNames.PHONE_NUMBER_VERIFIED); } /** * Returns the user's preferred postal address {@code (address)}. * @return the user's preferred postal address */ default AddressStandardClaim getAddress() { Map<String, Object> ad...
repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\oidc\StandardClaimAccessor.java
1
请在Spring Boot框架中完成以下Java代码
public class AppController { private EndpointRefreshConfigBean endpointRefreshConfigBean; private EnvironmentConfigBean environmentConfigBean; @Autowired public AppController(EndpointRefreshConfigBean endpointRefreshConfigBean, EnvironmentConfigBean environmentConfigBean) { this.endpointRefres...
@GetMapping("/bar2") public String bar2Handler() { return "bar2"; } @Bean @ConditionalOnBean(EnvironmentConfigBean.class) public FilterRegistrationBean<DynamicEndpointFilter> dynamicEndpointFilterFilterRegistrationBean(EnvironmentConfigBean environmentConfigBean) { FilterRegistratio...
repos\tutorials-master\spring-boot-modules\spring-boot-mvc-5\src\main\java\com\baeldung\dynamicendpoints\controller\AppController.java
2
请完成以下Java代码
public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getHouseNumber() { return houseNumber; } public void setHouseNumber(String houseNumber) { this.houseNumber = houseNumber; } public...
public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void se...
repos\tutorials-master\javaxval\src\main\java\com\baeldung\javaxval\validationgroup\RegistrationForm.java
1
请在Spring Boot框架中完成以下Java代码
public void deleteJob(JobForm form) throws SchedulerException { scheduler.pauseTrigger(TriggerKey.triggerKey(form.getJobClassName(), form.getJobGroupName())); scheduler.unscheduleJob(TriggerKey.triggerKey(form.getJobClassName(), form.getJobGroupName())); scheduler.deleteJob(JobKey.jobKey(form.ge...
CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerKey); // 根据Cron表达式构建一个Trigger trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); // 按新的trigger重新设置job执行 scheduler.rescheduleJob(triggerKey, trigger); ...
repos\spring-boot-demo-master\demo-task-quartz\src\main\java\com\xkcoding\task\quartz\service\impl\JobServiceImpl.java
2
请完成以下Java代码
private boolean isESIndexExists(final FTSConfig config) throws IOException { return configService.elasticsearchClient() .indices() .exists(new GetIndexRequest(config.getEsIndexName()), RequestOptions.DEFAULT); } private void createESIndex(final FTSConfig config) throws IOException { configService.elast...
private static class ConfigAndEvents { @Getter private final FTSConfig config; @Getter private final ImmutableSet<TableName> sourceTableNames; private final ArrayList<ModelToIndex> events = new ArrayList<>(); private ConfigAndEvents( @NonNull final FTSConfig config, @NonNull final ImmutableSet<T...
repos\metasfresh-new_dawn_uat\backend\de.metas.elasticsearch\src\main\java\de\metas\fulltextsearch\indexer\queue\ModelToIndexEnqueueProcessor.java
1
请完成以下Java代码
public Object getValueAt(final int rowIndexView, final String columnName) { final int colIndexModel = getColumnModelIndex(columnName); if (colIndexModel < 0) // it starts with 0, not with 1, so it's <0, not <=0 { throw new IllegalArgumentException("No column index found for " + columnName); } final int r...
if (colIndexModel <= 0) { throw new IllegalArgumentException("No column index found for " + columnName); } final int rowIndexModel = convertRowIndexToModel(rowIndexView); getModel().setValueAt(value, rowIndexModel, colIndexModel); } @Override public void clear() { final PO[] pos = new PO[] {}; loa...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\minigrid\MiniTable.java
1
请完成以下Java代码
default void addPostProcessor(ConsumerPostProcessor<K, V> postProcessor) { } /** * Remove a post processor. * @param postProcessor the post processor. * @return true if removed. * @since 2.5.3 */ default boolean removePostProcessor(ConsumerPostProcessor<K, V> postProcessor) { return false; } /** * ...
default void removeConfig(String configKey) { } /** * Called whenever a consumer is added or removed. * * @param <K> the key type. * @param <V> the value type. * * @since 2.5 * */ interface Listener<K, V> { /** * A new consumer was created. * @param id the consumer id (factory bean name and...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\core\ConsumerFactory.java
1
请在Spring Boot框架中完成以下Java代码
private PortMapper getPortMapper() { if (this.portMapper == null) { PortMapperImpl portMapper = new PortMapperImpl(); portMapper.setPortMappings(this.httpsPortMappings); this.portMapper = portMapper; } return this.portMapper; } /** * Allows specifying the HTTPS port for a given HTTP port when redire...
private HttpPortMapping(int httpPort) { this.httpPort = httpPort; } /** * Maps the given HTTP port to the provided HTTPS port and vice versa. * @param httpsPort the HTTPS port to map to * @return the {@link PortMapperConfigurer} for further customization */ public PortMapperConfigurer<H> mapsTo(in...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\PortMapperConfigurer.java
2
请完成以下Java代码
public DataEntryRecordsMap get( final int recordId, @NonNull final Set<DataEntrySubTabId> subTabIds) { Check.assumeGreaterOrEqualToZero(recordId, "recordId"); Check.assumeNotEmpty(subTabIds, "subTabIds is not empty"); final Collection<DataEntryRecord> records = cache.getAllOrLoad(toCacheKeys(recordId, sub...
@Value(staticConstructor = "of") private static final class CacheKey { int mainRecordId; DataEntrySubTabId subTabId; } @ToString @VisibleForTesting static final class DataEntryRecordIdIndex implements CacheIndexDataAdapter<DataEntryRecordId, CacheKey, DataEntryRecord> { @Override public DataEntryRecordI...
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\dataentry\impl\DataEntryRecordCache.java
1
请在Spring Boot框架中完成以下Java代码
public String getTopic() { return topic; } public void setTopic(String topic) { this.topic = topic; } public Duration getLockDuration() { return lockDuration; } public void setLockDuration(Duration lockDuration) { this.lockDuration = lockDuration; } pu...
public void setNumberOfRetries(int numberOfRetries) { this.numberOfRetries = numberOfRetries; } public String getWorkerId() { return workerId; } public void setWorkerId(String workerId) { this.workerId = workerId; } public String getScopeType() { return scopeTy...
repos\flowable-engine-main\modules\flowable-external-job-rest\src\main\java\org\flowable\external\job\rest\service\api\acquire\AcquireExternalWorkerJobRequest.java
2
请完成以下Java代码
protected Date getPlanItemInstanceEndTime(List<HistoricPlanItemInstance> planItemInstances, PlanItemDefinition planItemDefinition) { return getPlanItemInstance(planItemInstances, planItemDefinition) .map(HistoricPlanItemInstance::getEndedTime) .orElse(null); } protected Optional...
} public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getDisplayOrder() { return displayOrder; } ...
repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\cmd\GetHistoricStageOverviewCmd.java
1
请完成以下Java代码
protected Object extractAndConvertValue(ConsumerRecord<?, ?> record, @Nullable Type type) { Object value = record.value(); if (value == null) { return KafkaNull.INSTANCE; } Class<?> rawType = ResolvableType.forType(type).resolve(Object.class); if (!rawType.isInterface()) { return this.delegate.extrac...
* @return the source instance as byte array. */ private static byte[] getAsByteArray(Object source) { Assert.notNull(source, "Source must not be null"); if (source instanceof String) { return ((String) source).getBytes(StandardCharsets.UTF_8); } if (source instanceof byte[]) { return (byte[]) source;...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\converter\ProjectingMessageConverter.java
1
请在Spring Boot框架中完成以下Java代码
public RepositoryDetectionStrategies getDetectionStrategy() { return this.detectionStrategy; } public void setDetectionStrategy(RepositoryDetectionStrategies detectionStrategy) { this.detectionStrategy = detectionStrategy; } public @Nullable MediaType getDefaultMediaType() { return this.defaultMediaType; }...
this.enableEnumTranslation = enableEnumTranslation; } public void applyTo(RepositoryRestConfiguration rest) { PropertyMapper map = PropertyMapper.get(); map.from(this::getBasePath).to(rest::setBasePath); map.from(this::getDefaultPageSize).to(rest::setDefaultPageSize); map.from(this::getMaxPageSize).to(rest::...
repos\spring-boot-4.0.1\module\spring-boot-data-rest\src\main\java\org\springframework\boot\data\rest\autoconfigure\DataRestProperties.java
2
请在Spring Boot框架中完成以下Java代码
public Logbook compositesink() { CompositeSink comsink = new CompositeSink(Arrays.asList(new CommonsLogFormatSink(new DefaultHttpLogWriter()), new ExtendedLogFormatSink( new DefaultHttpLogWriter()))); Logbook logbook = Logbook.builder() .sink(comsink) .build(); ...
//@Bean public Logbook commonLogFormat() { Logbook logbook = Logbook.builder() .sink(new CommonsLogFormatSink(new DefaultHttpLogWriter())) .build(); return logbook; } //@Bean public Logbook extendedLogFormat() { Logbook logbook = Logbook.builder() ...
repos\tutorials-master\spring-boot-modules\spring-boot-logging-logback\src\main\java\com\baeldung\logbookconfig\LogBookConfig.java
2
请完成以下Java代码
public Integer getEmployeeId() { return employeeId; } public void setEmployeeId(Integer employeeId) { this.employeeId = employeeId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; ...
public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Role getRole() { return role; } public void setRole(Role role) { this.role = role; } }
repos\tutorials-master\spring-reactive-modules\spring-reactive-client\src\main\java\com\baeldung\reactive\model\Employee.java
1
请完成以下Java代码
public int getUOMPrecision() { return getProduct().getUOMPrecision(); } // getUOMPrecision /************************************************************************** * String Representation * @return info */ public String toString () { StringBuffer sb = new StringBuffer ("MDistributionRunLine[") ...
* Get Info * @return info */ public String getInfo() { StringBuffer sb = new StringBuffer (); sb.append("Line=").append(getLine()) .append (",TotalQty=").append(getTotalQty()) .append(",SumMin=").append(getActualMin()) .append(",SumQty=").append(getActualQty()) .append(",SumAllocation=").append(g...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MDistributionRunLine.java
1
请完成以下Java代码
public int getFrom_Product_ID() { return get_ValueAsInt(COLUMNNAME_From_Product_ID); } @Override public void setMatured_Product_ID (final int Matured_Product_ID) { if (Matured_Product_ID < 1) set_Value (COLUMNNAME_Matured_Product_ID, null); else set_Value (COLUMNNAME_Matured_Product_ID, Matured_Pro...
} @Override public int getM_Maturing_Configuration_ID() { return get_ValueAsInt(COLUMNNAME_M_Maturing_Configuration_ID); } @Override public void setM_Maturing_Configuration_Line_ID (final int M_Maturing_Configuration_Line_ID) { if (M_Maturing_Configuration_Line_ID < 1) set_ValueNoCheck (COLUMNNAME_M_M...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Maturing_Configuration_Line.java
1
请完成以下Java代码
public T forget() { // https://github.com/metasfresh/metasfresh-webui-api/issues/787 - similar to the code of get(); // if the instance known to not be initialized // then don't attempt to acquire lock (and to other time consuming stuff..) if (initialized) { synchronized (this) { if (initialized) ...
return null; } /** * @return true if this supplier has a value memorized */ public boolean isInitialized() { return initialized; } @Override public String toString() { return "ExtendedMemorizingSupplier[" + delegate + "]"; } private static final long serialVersionUID = 0; }
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\lang\ExtendedMemorizingSupplier.java
1
请完成以下Java代码
public class C_Invoice_Candidate { /** * Set the IC's <code>QtyEnteredTU</code> from either the referenced object or order line (if available). * * @param ic */ @ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE }) public void updateQtyEnteredTU(final I_C_Invoice_Candi...
{ final I_C_OrderLine ol = InterfaceWrapperHelper.create(ic.getC_OrderLine(), I_C_OrderLine.class); final BigDecimal olQtyEnteredTU = ol.getQtyEnteredTU(); if (olQtyEnteredTU != null) // safety { qtyEnteredTU = olQtyEnteredTU; } } for (final I_M_InOutLine iol : iols) { // // Just to be s...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\model\validator\C_Invoice_Candidate.java
1
请完成以下Java代码
public void setCounter_DocBaseType (java.lang.String Counter_DocBaseType) { set_Value (COLUMNNAME_Counter_DocBaseType, Counter_DocBaseType); } /** Get Counter_DocBaseType. @return Counter_DocBaseType */ @Override public java.lang.String getCounter_DocBaseType () { return (java.lang.String)get_Value(COLU...
*/ @Override public void setDocBaseType (java.lang.String DocBaseType) { set_Value (COLUMNNAME_DocBaseType, DocBaseType); } /** Get Document BaseType. @return Logical type of document */ @Override public java.lang.String getDocBaseType () { return (java.lang.String)get_Value(COLUMNNAME_DocBaseType); ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DocBaseType_Counter.java
1
请在Spring Boot框架中完成以下Java代码
private ScheduledPackageable toScheduledPackageable(@NonNull Packageable packageable) { if (query.isScheduledForWorkplaceOnly()) { final PickingJobSchedule schedule = getJobSchedule(packageable.getShipmentScheduleId()).orElse(null); return schedule != null ? ScheduledPackageable.of(packageable, schedule...
case SALES_ORDER: { orderBasedAggregates.computeIfAbsent(OrderBasedAggregationKey.of(item), OrderBasedAggregation::new).add(item); break; } case PRODUCT: { productBasedAggregates.computeIfAbsent(ProductBasedAggregationKey.of(item), ProductBasedAggregation::new).add(item); break; } case...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\retrieve\PickingJobCandidateRetrieveCommand.java
2
请完成以下Java代码
final class CodecDelegate { private static final ResolvableType MESSAGE_TYPE = ResolvableType.forClass(GraphQlWebSocketMessage.class); private final CodecConfigurer codecConfigurer; private final Decoder<?> decoder; private final Encoder<?> encoder; CodecDelegate(CodecConfigurer configurer) { Assert.notNu...
} CodecConfigurer getCodecConfigurer() { return this.codecConfigurer; } @SuppressWarnings("unchecked") <T> WebSocketMessage encode(WebSocketSession session, GraphQlWebSocketMessage message) { DataBuffer buffer = ((Encoder<T>) this.encoder).encodeValue( (T) message, session.bufferFactory(), MESSAGE_TYPE...
repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\client\CodecDelegate.java
1
请完成以下Java代码
public void afterPropertiesSet() { Assert.notNull(this.connectionFactory, "ConnectionFactory is required"); } /** * Create a RabbitMQ Connection via this template's ConnectionFactory and its host and port values. * @return the new RabbitMQ Connection * @see ConnectionFactory#createConnection */ protected ...
protected RuntimeException convertRabbitAccessException(Exception ex) { return RabbitExceptionTranslator.convertRabbitAccessException(ex); } protected void obtainObservationRegistry(@Nullable ApplicationContext appContext) { if (appContext != null) { ObjectProvider<ObservationRegistry> registry = appCont...
repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\connection\RabbitAccessor.java
1
请完成以下Java代码
private static String extractSummary(@NonNull final WFProcess wfProcess) { final WFState state = wfProcess.getState(); String summary = wfProcess.getProcessingResultMessage(); if (Check.isBlank(summary)) { final WFActivity activity = wfProcess.getFirstActivityByWFState(state).orElse(null); if (activity !...
}); } private List<WFProcess> getActiveProcesses() { final List<WFProcessId> wfProcessIds = wfProcessRepository.getActiveProcessIds(context.getDocumentRef()); return getWFProcesses(wfProcessIds); } private List<WFProcess> getWFProcesses(final List<WFProcessId> wfProcessIds) { if (wfProcessIds.isEmpty()) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\workflow\execution\WorkflowExecutor.java
1
请完成以下Java代码
public class LongDataPoint extends AbstractDataPoint { @Getter private final long value; public LongDataPoint(long ts, long value) { super(ts); this.value = value; } @Override public DataType getType() { return DataType.LONG; } @Override public long getLon...
@Override public String valueToString() { return Long.toString(value); } @Override public int compareTo(DataPoint dataPoint) { if (dataPoint.getType() == DataType.DOUBLE) { return Double.compare(getDouble(), dataPoint.getDouble()); } else if (dataPoint.getType() == D...
repos\thingsboard-master\common\edqs\src\main\java\org\thingsboard\server\edqs\data\dp\LongDataPoint.java
1
请完成以下Java代码
public static Response bearerAuthenticationWithOAuth2AtClientLevel(String token) { Feature feature = OAuth2ClientSupport.feature(token); Client client = ClientBuilder.newBuilder().register(feature).build(); return client.target(TARGET) .path(MAIN_RESOURCE) .reque...
.path(MAIN_RESOURCE) .request() .header(headerKey, headerValue) .get(); } public static String simpleSSEHeader() throws InterruptedException { Client client = ClientBuilder.newBuilder() .register(AddHeaderOnRequestFilter.class) ...
repos\tutorials-master\web-modules\jersey\src\main\java\com\baeldung\jersey\client\JerseyClientHeaders.java
1
请完成以下Java代码
public class Tutorial { private String tutId; private String type; private String title; private String description; private String date; private String author; public String getTutId() { return tutId; } @XmlAttribute public void setTutId(String tutId) { this.t...
public String getDescription() { return description; } @XmlElement public void setDescription(String description) { this.description = description; } public String getDate() { return date; } @XmlElement public void setDate(String date) { this.date = dat...
repos\tutorials-master\xml-modules\xml\src\main\java\com\baeldung\xml\binding\Tutorial.java
1
请完成以下Java代码
public CompositeScriptScanner addScriptScanner(final IScriptScanner scriptScanner) { if (scriptScanner == null) { throw new IllegalArgumentException("scriptScanner is null"); } if (children.contains(scriptScanner)) { return this; } children.add(scriptScanner); return this; } @Override prote...
{ final int nextIndex = currentIndex + 1; if (nextIndex >= children.size()) { return null; } final IScriptScanner nextScanner = children.get(nextIndex); currentIndex = nextIndex; return nextScanner; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\scanner\impl\CompositeScriptScanner.java
1
请完成以下Java代码
public static final AdempiereException wrapIfNeeded(final Throwable throwable) { if (throwable == null) { return null; } else if (throwable instanceof PostingExecutionException) { return (PostingExecutionException)throwable; } else { final Throwable cause = extractCause(throwable); if (caus...
private PostingExecutionException(final String message, final Throwable cause) { super(message, cause); } private static final String buildMessage(final String message, final String serverStackTrace) { final StringBuilder sb = new StringBuilder(); sb.append(!Check.isEmpty(message) ? message.trim() : "unknow ...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\api\impl\PostingExecutionException.java
1
请完成以下Java代码
public <T> IQuery<T> toQuery(Class<T> clazz, String trxName) { return toQueryBuilder(clazz, trxName) .create(); } private <T> IQueryBuilder<T> toQueryBuilder(final Class<T> clazz, final String trxName) { final String tableName = InterfaceWrapperHelper.getTableName(clazz); final POInfo poInfo = PO...
// e.g. querying PP_Order_Cost, have this.AD_Org_ID=0 but PP_Order_Costs are created using PP_Order's AD_Org_ID // see http://dewiki908/mediawiki/index.php/07741_Rate_Variance_%28103334042334%29. if (!this.orgId.isAny() || I_M_Cost.Table_Name.equals(tableName)) { queryBuilder.addEqualsFilter(COLUMNNAME_AD_...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\process\CopyPriceToStandard.java
1
请完成以下Java代码
public final class ESCommand { @NonNull private final String string; private ESCommand(@NonNull final String string) { final String stringNorm = StringUtils.trimBlankToNull(string); if (stringNorm == null) { throw new AdempiereException("Invalid blank ESCommand string: " + string); } this.string = st...
return new ESCommand(string); } @Override @Deprecated public String toString() { return getAsString(); } public String getAsString() { return string; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.elasticsearch\src\main\java\de\metas\fulltextsearch\config\ESCommand.java
1
请完成以下Java代码
public List<WidgetsBundle> findSystemOrTenantWidgetsBundlesByIds(TenantId tenantId, List<WidgetsBundleId> widgetsBundleIds) { log.trace("Executing findSystemOrTenantWidgetsBundlesByIds, tenantId [{}], widgetsBundleIds [{}]", tenantId, widgetsBundleIds); return widgetsBundleDao.findSystemOrTenantWidgetBu...
@Override public EntityType getEntityType() { return EntityType.WIDGETS_BUNDLE; } private final PaginatedRemover<TenantId, WidgetsBundle> tenantWidgetsBundleRemover = new PaginatedRemover<>() { @Override protected PageData<WidgetsBundle> findEntities(TenantId tenantId, TenantId id,...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\widget\WidgetsBundleServiceImpl.java
1
请完成以下Java代码
public class CreateMaterialTrackingReportLineFromMaterialTrackingRefAggregator extends MapReduceAggregator<I_M_Material_Tracking_Report_Line, MaterialTrackingReportAgregationItem> { final IMaterialTrackingReportBL materialTrackingReportBL = Services.get(IMaterialTrackingReportBL.class); /** * Report header contai...
// save the line final BigDecimal qtyReceived = reportLine.getQtyReceived().setScale(1, RoundingMode.HALF_UP); final BigDecimal qtyIssued = reportLine.getQtyIssued().setScale(1, RoundingMode.HALF_UP); final BigDecimal qtyDifference = qtyReceived.subtract(qtyIssued).setScale(1, RoundingMode.HALF_UP); reportLin...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\process\CreateMaterialTrackingReportLineFromMaterialTrackingRefAggregator.java
1
请完成以下Java代码
public BigDecimal getBdryAmt() { return bdryAmt; } /** * Sets the value of the bdryAmt property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setBdryAmt(BigDecimal value) { this.bdryAmt = value; } /** ...
* */ public boolean isIncl() { return incl; } /** * Sets the value of the incl property. * */ public void setIncl(boolean value) { this.incl = value; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\AmountRangeBoundary1.java
1
请完成以下Java代码
public Integer getResourceType() { return resourceType; } public void setResourceType(Integer resourceType) { this.resourceType = resourceType; } public String getResourceId() { return resourceId; } public void setResourceId(String resourceId) { this.resourceId = resourceId; } public Str...
} public Date getRemovalTime() { return removalTime; } public void setRemovalTime(Date removalTime) { this.removalTime = removalTime; } private static Permission[] getPermissions(Authorization dbAuthorization, ProcessEngineConfiguration engineConfiguration) { int givenResourceType = dbAuthorizati...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\authorization\AuthorizationDto.java
1
请完成以下Java代码
public String transform(FeelToJuelTransform transform, String feelExpression, String inputName) { List<String> juelExpressions = transformExpressions(transform, feelExpression, inputName); return joinExpressions(juelExpressions); } protected List<String> collectExpressions(String feelExpression) { retu...
juelExpressions.add(juelExpression); } else { throw LOG.invalidListExpression(feelExpression); } } return juelExpressions; } protected String joinExpressions(List<String> juelExpressions) { StringBuilder builder = new StringBuilder(); builder.append("(").append(juelExpress...
repos\camunda-bpm-platform-master\engine-dmn\feel-juel\src\main\java\org\camunda\bpm\dmn\feel\impl\juel\transform\ListTransformer.java
1
请在Spring Boot框架中完成以下Java代码
default boolean hasPermission(SecurityUser user, Operation operation) { return false; } default boolean hasPermission(SecurityUser user, Operation operation, I entityId, T entity) { return false; } public class GenericPermissionChecker<I extends EntityId, T extends HasTenantId> impleme...
public static PermissionChecker denyAllPermissionChecker = new PermissionChecker() {}; public static PermissionChecker allowAllPermissionChecker = new PermissionChecker<EntityId, HasTenantId>() { @Override public boolean hasPermission(SecurityUser user, Operation operation) { return tr...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\permission\PermissionChecker.java
2
请在Spring Boot框架中完成以下Java代码
private static List<AuthenticationConverter> createDefaultAuthenticationConverters() { List<AuthenticationConverter> authenticationConverters = new ArrayList<>(); authenticationConverters.add(new OAuth2DeviceVerificationAuthenticationConverter()); authenticationConverters.add(new OAuth2DeviceAuthorizationConsent...
new OAuth2DeviceVerificationAuthenticationProvider( registeredClientRepository, authorizationService, authorizationConsentService); // @formatter:on authenticationProviders.add(deviceVerificationAuthenticationProvider); // @formatter:off OAuth2DeviceAuthorizationConsentAuthenticationProvider deviceAuthor...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\oauth2\server\authorization\OAuth2DeviceVerificationEndpointConfigurer.java
2
请完成以下Java代码
protected void continueThroughMultiInstanceFlowNode(FlowNode flowNode) { if (!flowNode.isAsynchronous()) { executeSynchronous(flowNode); } else { executeAsynchronous(flowNode); } } protected void executeSynchronous(FlowNode flowNode) { // Execution listen...
try { activityBehavior.execute(execution); } catch (BpmnError error) { // re-throw business fault so that it can be caught by an Error Intermediate Event or Error Event Sub-Process in the process ErrorPropagation.propagateError(error, execution); }...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\agenda\ContinueMultiInstanceOperation.java
1
请完成以下Java代码
protected void options() { } public final ExitStatus run(String... args) throws Exception { String[] argsToUse = args.clone(); for (int i = 0; i < argsToUse.length; i++) { if ("-cp".equals(argsToUse[i])) { argsToUse[i] = "--cp"; } argsToUse[i] = this.argumentProcessor.apply(argsToUse[i]); } Opti...
} } return ""; } Collection<OptionHelp> getOptionHelp() { return Collections.unmodifiableList(this.help); } } private static class OptionHelpAdapter implements OptionHelp { private final Set<String> options; private final String description; OptionHelpAdapter(OptionDescriptor descriptor) { ...
repos\spring-boot-4.0.1\cli\spring-boot-cli\src\main\java\org\springframework\boot\cli\command\options\OptionHandler.java
1
请完成以下Java代码
public int getM_SerNoCtl_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_SerNoCtl_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get ...
{ return (String)get_Value(COLUMNNAME_Prefix); } /** Set Start No. @param StartNo Starting number/position */ public void setStartNo (int StartNo) { set_Value (COLUMNNAME_StartNo, Integer.valueOf(StartNo)); } /** Get Start No. @return Starting number/position */ public int getStartNo () { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_SerNoCtl.java
1
请完成以下Java代码
public java.lang.String getHostKey() { return (java.lang.String)get_Value(COLUMNNAME_HostKey); } @Override public void setIsManualCalibration (boolean IsManualCalibration) { set_Value (COLUMNNAME_IsManualCalibration, Boolean.valueOf(IsManualCalibration)); } @Override public boolean isManualCalibration() ...
} @Override public void setMeasurementY (java.math.BigDecimal MeasurementY) { set_Value (COLUMNNAME_MeasurementY, MeasurementY); } @Override public java.math.BigDecimal getMeasurementY() { BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_MeasurementY); return bd != null ? bd : BigDecimal.ZERO; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.printing\de.metas.printing.base\src\main\java-gen\de\metas\printing\model\X_AD_PrinterHW_Calibration.java
1
请完成以下Java代码
public void setMarginTop (int MarginTop) { set_Value (COLUMNNAME_MarginTop, Integer.valueOf(MarginTop)); } /** Get Top Margin. @return Top Space in 1/72 inch */ public int getMarginTop () { Integer ii = (Integer)get_Value(COLUMNNAME_MarginTop); if (ii == null) return 0; return ii.intValue(); } ...
X (horizontal) dimension size */ public void setSizeX (BigDecimal SizeX) { set_Value (COLUMNNAME_SizeX, SizeX); } /** Get Size X. @return X (horizontal) dimension size */ public BigDecimal getSizeX () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_SizeX); if (bd == null) return Env.ZERO; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_PrintPaper.java
1
请完成以下Java代码
protected String doIt() throws Exception { if (p_QtyTU <= 0) { throw new FillMandatoryException("QtyTU"); } topLevelHU = getRecord(I_M_HU.class); // // Get the original receipt line final List<I_M_InOutLine> receiptLines = huAssignmentDAO.retrieveModelsForHU(topLevelHU, I_M_InOutLine.class) .str...
} @Override protected void postProcess(final boolean success) { // If something failed, don't bother if (!success) { return; } // Remove the TUs from our view (in case of any top level TUs) if (tusToReturn != null && !tusToReturn.isEmpty()) { getView().removeHUIds(tusToReturn.getHuIds()); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_M_HU_ReturnTUsToVendor.java
1
请完成以下Java代码
public void setDescription (final @Nullable java.lang.String Description) { set_Value (COLUMNNAME_Description, Description); } @Override public java.lang.String getDescription() { return get_ValueAsString(COLUMNNAME_Description); } /** * InvoicableQtyBasedOn AD_Reference_ID=541023 * Reference name: I...
{ set_Value (COLUMNNAME_PriceStd, PriceStd); } @Override public BigDecimal getPriceStd() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PriceStd); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setValidFrom (final java.sql.Timestamp ValidFrom) { set_Value (COLUMNNAME_Vali...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Campaign_Price.java
1
请完成以下Java代码
protected List<TsKvEntry> convertResultToTsKvEntryList(List<Row> rows) { List<TsKvEntry> entries = new ArrayList<>(rows.size()); if (!rows.isEmpty()) { rows.forEach(row -> entries.add(convertResultToTsKvEntry(row))); } return entries; } private TsKvEntry convertResul...
private BasicTsKvEntry getBasicTsKvEntry(String key, Row row) { Optional<String> foundKeyOpt = getKey(row); long ts = row.getLong(ModelConstants.TS_COLUMN); return new BasicTsKvEntry(ts, toKvEntry(row, foundKeyOpt.orElse(key))); } private Optional<String> getKey(Row row){ try{ ...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\timeseries\AbstractCassandraBaseTimeseriesDao.java
1
请完成以下Java代码
private Set<RecordHolder<K, R>> addToCollection(ConsumerRecord record, Object correlationId) { Set<RecordHolder<K, R>> set = this.pending.computeIfAbsent(correlationId, id -> new LinkedHashSet<>()); set.add(new RecordHolder<>(record)); return set; } private static final class RecordHolder<K, R> { private fi...
if (getClass() != obj.getClass()) { return false; } @SuppressWarnings("rawtypes") RecordHolder other = (RecordHolder) obj; if (this.record == null) { if (other.record != null) { return false; } } else { return this.record.topic().equals(other.record.topic()) && this.record.p...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\requestreply\AggregatingReplyingKafkaTemplate.java
1
请完成以下Java代码
public static MResource get(Properties ctx, int S_Resource_ID) { if (S_Resource_ID <= 0) return null; MResource r = s_cache.get(S_Resource_ID); if (r == null) { r = new MResource(ctx, S_Resource_ID, null); if (r.get_ID() == S_Resource_ID) { s_cache.put(S_Resource_ID, r); } } return r; } /*...
m_resourceType = new MResourceType (getCtx(), getS_ResourceType_ID(), get_TrxName()); } return m_resourceType; } // getResourceType @Override protected boolean beforeSave (boolean newRecord) { // // Validate Manufacturing Resource if (isManufacturingResource() && MANUFACTURINGRESOURCETYPE_Plant.equal...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MResource.java
1