instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public Inventory unassign() { return responsibleId == null ? this : toBuilder().responsibleId(null).build(); } public void assertHasAccess(@NonNull final UserId calledId) { if (!UserId.equals(responsibleId, calledId)) { throw new AdempiereException("No access"); } } public Stream<InventoryLine> strea...
return streamLines(onlyLineId) .filter(InventoryLine::isEligibleForCounting) .map(InventoryLine::getLocatorId) .collect(ImmutableSet.toImmutableSet()); } public Inventory updatingLineById(@NonNull final InventoryLineId lineId, @NonNull UnaryOperator<InventoryLine> updater) { final ImmutableList<Invent...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\Inventory.java
1
请在Spring Boot框架中完成以下Java代码
public IUserDAO userDAO() { return Services.get(IUserDAO.class); } @Bean public ITrxManager trxManager() { return Services.get(ITrxManager.class); } @Bean public IQueryBL queryBL() { return Services.get(IQueryBL.class); } @Bean public ImportQueue<ImportTimeBookingInfo> timeBookingImportQueue() { ...
{ return new ImportQueue<>(ISSUE_QUEUE_CAPACITY, IMPORT_LOG_MESSAGE_PREFIX); } @Bean public ObjectMapper objectMapper() { return JsonObjectMapperHolder.sharedJsonObjectMapper(); } @Bean public IMsgBL msgBL() { return Services.get(IMsgBL.class); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\configuration\ApplicationConfiguration.java
2
请完成以下Java代码
public void notifyRecordsChangedNow(@NonNull final TableRecordReferenceSet recordRefs) { if (recordRefs.isEmpty()) { logger.trace("No changed records provided. Skip notifying views."); return; } try (final IAutoCloseable ignored = ViewChangesCollector.currentOrNewThreadLocalCollector()) { for (fina...
view.notifyRecordsChanged(recordRefs, watchedByFrontend); notifiedCount.incrementAndGet(); } catch (final Exception ex) { logger.warn("Failed calling notifyRecordsChanged on view={} with recordRefs={}. Ignored.", view, recordRefs, ex); } } logger.debug("Notified {} views in {} about changed rec...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewsRepository.java
1
请完成以下Java代码
private ColumnSql getVirtualColumnSql() { return _virtualColumnSql; } public Builder setMandatory(final boolean mandatory) { this.mandatory = mandatory; return this; } public Builder setHideGridColumnIfEmpty(final boolean hideGridColumnIfEmpty) { this.hideGridColumnIfEmpty = hideGridColumnIf...
{ if (_sqlValueClass != null) { return _sqlValueClass; } return getValueClass(); } public Builder setLookupDescriptor(@Nullable final LookupDescriptor lookupDescriptor) { this._lookupDescriptor = lookupDescriptor; return this; } public OptionalBoolean getNumericKey() { return _num...
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代码
public String toString() { final StringBuilder sb = new StringBuilder("M_Element[") .append(get_ID()) .append("-") .append(getColumnName()) .append("]"); return sb.toString(); } @Override protected boolean beforeSave(final boolean newRecord) { // Column AD_Element.ColumnName should be unique...
} final int no = DB.getSQLValueEx(ITrx.TRXNAME_ThreadInherited, sql, columnName); if (no > 0) { throw new AdempiereException("@SaveErrorNotUnique@ @ColumnName@: " + columnName); } } @Override protected boolean afterSave(final boolean newRecord, final boolean success) { if (!newRecord) { // upda...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\M_Element.java
1
请完成以下Java代码
public Instant getAuditEventDate() { return auditEventDate; } public void setAuditEventDate(Instant auditEventDate) { this.auditEventDate = auditEventDate; } public String getAuditEventType() { return auditEventType; } public void setAuditEventType(String auditEventTyp...
PersistentAuditEvent persistentAuditEvent = (PersistentAuditEvent) o; return !(persistentAuditEvent.getId() == null || getId() == null) && Objects.equals(getId(), persistentAuditEvent.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override pu...
repos\tutorials-master\jhipster-6\bookstore-monolith\src\main\java\com\baeldung\jhipster6\domain\PersistentAuditEvent.java
1
请完成以下Java代码
public String getDirectDeploy () { return (String)get_Value(COLUMNNAME_DirectDeploy); } /** Set Comment/Help. @param Help Comment or Hint */ public void setHelp (String Help) { set_Value (COLUMNNAME_Help, Help); } /** Get Comment/Help. @return Comment or Hint */ public String getHelp () { ...
/** Get Media Type. @return Defines the media type for the browser */ public String getMediaType () { return (String)get_Value(COLUMNNAME_MediaType); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Media.java
1
请完成以下Java代码
public final boolean isDateOrTime() { return TYPES_ALL_DATES.contains(this); } public final boolean isDateWithTime() { return this == ZonedDateTime || this == Timestamp; } public final boolean isNumeric() { return TYPES_ALL_NUMERIC.contains(this); } public final boolean isBigDecimal() { return ...
} public final boolean isSupportZoomInto() { return isLookup() || this == DocumentFieldWidgetType.ZoomIntoButton // || this == DocumentFieldWidgetType.Labels // not implemented yet ; } public final boolean isBoolean() { return this == YesNo || this == Switch; } /** * Same as {@link #getValueClas...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentFieldWidgetType.java
1
请完成以下Java代码
public void disableExistingStartEventSubscriptions() { timerManager.removeExistingTimerStartEventJobs(); eventSubscriptionManager.removeExistingSignalStartEventSubscriptions(); eventSubscriptionManager.removeExistingMessageStartEventSubscriptions(); } protected enum ExpressionType { ...
ProcessDefinitionEntity processDefinition, ExpressionType expressionType ) { if (expressions != null) { Iterator<String> iterator = expressions.iterator(); while (iterator.hasNext()) { @SuppressWarnings("cast") String expression = iterator.next...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\deployer\BpmnDeploymentHelper.java
1
请完成以下Java代码
public <T> void addRecordsByFilter(@NonNull final Class<T> modelClass, @NonNull final IQueryFilter<T> filters) { _records = null; _selection_AD_Table_ID = null; if (_filters == null) { _filters = new ArrayList<>(); } _filters.add(LockRecordsByFilter.of(modelClass, filters)); } public List<LockRecord...
public PInstanceId getSelection_PInstanceId() { return _selection_pinstanceId; } public Iterator<TableRecordReference> getRecordsIterator() { return _records == null ? null : _records.iterator(); } public void addRecordByModel(final Object model) { final TableRecordReference record = TableRecordReference...
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\api\impl\LockRecords.java
1
请完成以下Java代码
public String toString() { return "Book [isbn=" + isbn + ", title=" + title + ", author=" + author + ", publisher=" + publisher + ", cost=" + cost + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((author == null) ? 0...
} else if (!author.equals(other.author)) return false; if (Double.doubleToLongBits(cost) != Double.doubleToLongBits(other.cost)) return false; if (isbn == null) { if (other.isbn != null) return false; } else if (!isbn.equals(other.isbn)) ...
repos\tutorials-master\persistence-modules\java-mongodb\src\main\java\com\baeldung\bsontojson\Book.java
1
请完成以下Java代码
public String getMsg(final Properties ctx, @NonNull final AdMessageKey adMessage) { return adMessage.toAD_Message(); } @Override public String getMsg(final Properties ctx, @NonNull final AdMessageKey adMessage, final boolean text) { return adMessage.toAD_Message() + "_" + (text ? "Text" : "Tooltip"); } @Ov...
} else { return TranslatableStrings.constant(adMessage.toAD_Message() + " - " + Joiner.on(", ").useForNull("-").join(msgParameters)); } } @Override public void cacheReset() { // nothing } @Override public String getBaseLanguageMsg(@NonNull final AdMessageKey adMessage, @Nullable final Object... msgP...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\i18n\impl\PlainMsgBL.java
1
请完成以下Java代码
private final void loadQtysIfNeeded() { final IUOMDAO uomDAO = Services.get(IUOMDAO.class); if (_loaded) { return; } final I_M_InOutLine firstInOutLine = inOutLines.get(0); // // Vendor Product final int productId = _product.getM_Product_ID(); final UomId productUomId = UomId.ofRepoIdOrNull(_pro...
final BigDecimal qtyReceivedConv = uomConversionBL.convertQty(uomConversionCtx, qtyReceived, productUomId, qtyReceivedTotalUomId); qtyReceivedTotal = qtyReceivedTotal.add(qtyReceivedConv); final IHandlingUnitsInfo handlingUnitsInfo = handlingUnitsInfoFactory.createFromModel(inoutLine); if (handlingUnitsInfo =...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\qualityBasedInvoicing\impl\InOutLineAsVendorReceipt.java
1
请完成以下Java代码
private ImmutableList<PPOrderCandidateToAllocate> getSortedCandidates(@NonNull final Stream<I_PP_Order_Candidate> candidateStream) { final Map<String, PPOrderCandidatesGroup> headerAgg2PPOrderCandGroup = new HashMap<>(); candidateStream .filter(orderCandidate -> !orderCandidate.isProcessed()) .sorted(Comp...
@NonNull public static PPOrderCandidatesGroup of(@NonNull final PPOrderCandidateToAllocate ppOrderCandidateToAllocate) { return new PPOrderCandidatesGroup(ppOrderCandidateToAllocate); } public void addToGroup(@NonNull final PPOrderCandidateToAllocate ppOrderCandidateToAllocate) { ppOrderCandidateToAllo...
repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\productioncandidate\async\GeneratePPOrderFromPPOrderCandidate.java
1
请完成以下Java代码
public static long getSerialVersionUID() { return serialVersionUID; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public ...
this.age = age; } @Override public String toString() { return "Customer{" + "firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", age=" + age + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null ||...
repos\tutorials-master\apache-libraries-2\src\main\java\com\baeldung\apache\geode\Customer.java
1
请完成以下Java代码
public ListenerContainerFactoryResolver listenerContainerFactoryResolver(BeanFactory beanFactory) { return new ListenerContainerFactoryResolver(beanFactory); } /** * Create a {@link ListenerContainerFactoryConfigurer} that will be used to * configure the {@link KafkaListenerContainerFactory} resolved by the ...
/** * Return the {@link Clock} instance that will be used for all * time-related operations in the retry topic processes. * @return the instance. */ public Clock internalRetryTopicClock() { return this.internalRetryTopicClock; } /** * Create a {@link Clock} instance that will be used for all time-relate...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\retrytopic\RetryTopicComponentFactory.java
1
请完成以下Java代码
public String getDescription() { return Description; } // getDescription /** * Return String representation * * @return Combination */ @Override public String toString() { if (C_ValidCombination_ID == 0) { return ""; } return Combination; } // toString /** * Load C_ValidCombination w...
{ return I_C_ValidCombination.Table_Name + "." + I_C_ValidCombination.COLUMNNAME_C_ValidCombination_ID; } // getColumnName @Override public String getColumnNameNotFQ() { return I_C_ValidCombination.COLUMNNAME_C_ValidCombination_ID; } // getColumnName /** * Return data as sorted Array. Used in Web Inte...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MAccountLookup.java
1
请完成以下Java代码
public Long getMaxBackoff() { return maxBackoff; } public void setMaxBackoff(Long maxBackoff) { this.maxBackoff = maxBackoff; } public Integer getBackoffDecreaseThreshold() { return backoffDecreaseThreshold; } public void setBackoffDecreaseThreshold(Integer backoffDecreaseThreshold) { thi...
.add("deploymentAware=" + deploymentAware) .add("corePoolSize=" + corePoolSize) .add("maxPoolSize=" + maxPoolSize) .add("keepAliveSeconds=" + keepAliveSeconds) .add("queueCapacity=" + queueCapacity) .add("lockTimeInMillis=" + lockTimeInMillis) .add("maxJobsPerAcquisition=" + maxJobsP...
repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\property\JobExecutionProperty.java
1
请在Spring Boot框架中完成以下Java代码
public class EmployeeRepository { private static final Map<String, Employee> EMPLOYEE_DATA; static { EMPLOYEE_DATA = new HashMap<>(); EMPLOYEE_DATA.put("1", new Employee("1", "Employee 1")); EMPLOYEE_DATA.put("2", new Employee("2", "Employee 2")); EMPLOYEE_DATA.put("3", new Emp...
return Mono.just(EMPLOYEE_DATA.get(id)); } public Flux<Employee> findAllEmployees() { return Flux.fromIterable(EMPLOYEE_DATA.values()); } public Mono<Employee> updateEmployee(Employee employee) { Employee existingEmployee = EMPLOYEE_DATA.get(employee.getId()); if (existingEmplo...
repos\tutorials-master\spring-reactive-modules\spring-reactive\src\main\java\com\baeldung\reactive\webflux\EmployeeRepository.java
2
请在Spring Boot框架中完成以下Java代码
public class ImageRestController { public static final String ENDPOINT = MetasfreshRestAPIConstants.ENDPOINT_API_V2 + "/images"; private final AdImageRepository adImageRepository; public ImageRestController( @NonNull final AdImageRepository adImageRepository) { this.adImageRepository = adImageRepository; } ...
.header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + adImage.getFilename() + "\"") .body(adImage.getScaledImageData(maxWidth, maxHeight)); } private static String computeETag(@NonNull final Instant lastModified, int maxWidth, int maxHeight) { return lastModified + "_" + Math.max(maxWidth, 0) + "_"...
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\image\ImageRestController.java
2
请在Spring Boot框架中完成以下Java代码
public AuthenticationManager authenticationManager(UserDetailsService userDetailsService) { // Before Spring Boot 4 // var authenticationProvider = new DaoAuthenticationProvider(); // authenticationProvider.setUserDetailsService(userDetailsService); // After Spring Boot 4 var au...
@Bean JwtDecoder jwtDecoder() throws JOSEException { return NimbusJwtDecoder .withPublicKey(rsaKey().toRSAPublicKey()) .build(); } @Bean public RSAKey rsaKey() { KeyPair keyPair = keyPair(); return new RSAKey .Builder(...
repos\master-spring-and-spring-boot-main\13-full-stack\02-rest-api\src\main\java\com\in28minutes\rest\webservices\restfulwebservices\jwt\JwtSecurityConfig.java
2
请在Spring Boot框架中完成以下Java代码
public Duration getLockPollRate() { return lockPollRate; } public void setLockPollRate(Duration lockPollRate) { this.lockPollRate = lockPollRate; } public Duration getSchemaLockWaitTime() { return schemaLockWaitTime; } public void setSchemaLockWaitTime(Duration schemaL...
} public void setHistoryCleaningAfter(Duration historyCleaningAfter) { this.historyCleaningAfter = historyCleaningAfter; } public int getHistoryCleaningBatchSize() { return historyCleaningBatchSize; } public void setHistoryCleaningBatchSize(int historyCleaningBatchSize) { ...
repos\flowable-engine-main\modules\flowable-spring-boot\flowable-spring-boot-starters\flowable-spring-boot-autoconfigure\src\main\java\org\flowable\spring\boot\FlowableProperties.java
2
请完成以下Java代码
public String getRefTableName() { return refTableName; } /** * * @return AD_Ref_Table.AD_Key.AD_Reference_ID */ public int getRefDisplayType() { return refDisplayType; } /** * * @return AD_Ref_Table.AD_Table_ID.EntityType */ public String getEntityType() { return entityType; }
/** * * @return AD_Ref_Table.AD_Key.IsKey */ public boolean isKey() { return isKey; } /** * * @return AD_Ref_Table.AD_Key.AD_Reference_Value_ID */ public int getKeyReferenceValueId() { return keyReferenceValueId; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\persistence\modelgen\TableReferenceInfo.java
1
请完成以下Java代码
public Author as(String alias) { return new Author(DSL.name(alias), this); } @Override public Author as(Name alias) { return new Author(alias, this); } /** * Rename this table */ @Override public Author rename(String name) { return new Author(DSL.name(name...
/** * Rename this table */ @Override public Author rename(Name name) { return new Author(name, null); } // ------------------------------------------------------------------------- // Row4 type methods // ------------------------------------------------------------------------...
repos\tutorials-master\persistence-modules\jooq\src\main\java\com\baeldung\jooq\model\tables\Author.java
1
请完成以下Java代码
public ReactorClientHttpRequestFactoryBuilder withReactorResourceFactory( ReactorResourceFactory reactorResourceFactory) { Assert.notNull(reactorResourceFactory, "'reactorResourceFactory' must not be null"); return new ReactorClientHttpRequestFactoryBuilder(getCustomizers(), this.httpClientBuilder.withReacto...
@Override protected ReactorClientHttpRequestFactory createClientHttpRequestFactory(HttpClientSettings settings) { HttpClient httpClient = this.httpClientBuilder.build(settings.withTimeouts(null, null)); ReactorClientHttpRequestFactory requestFactory = new ReactorClientHttpRequestFactory(httpClient); PropertyMapp...
repos\spring-boot-4.0.1\module\spring-boot-http-client\src\main\java\org\springframework\boot\http\client\ReactorClientHttpRequestFactoryBuilder.java
1
请完成以下Java代码
public String getName() { return name; } public void setName(final String name) { this.name = name; } public List<Foo> getFooList() { return fooList; } public void setFooList(final List<Foo> fooList) { this.fooList = fooList; } // @Override pu...
@Override public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Bar other = (Bar) obj; if (name == null) { if (other.name != ...
repos\tutorials-master\persistence-modules\spring-hibernate-5\src\main\java\com\baeldung\hibernate\cache\model\Bar.java
1
请在Spring Boot框架中完成以下Java代码
public class DerKurierClientFactory implements ShipperGatewayClientFactory { private final DerKurierShipperConfigRepository derKurierShipperConfigRepository; private final DerKurierDeliveryOrderService derKurierDeliveryOrderService; private final DerKurierDeliveryOrderRepository derKurierDeliveryOrderRepository; pr...
/** * Put JavaTimeModule into the rest template's jackson object mapper. * <b> * Note 1: there have to be better ways to achieve this, but i don't know them. * thx to https://stackoverflow.com/a/47176770/1012103 * <b> * Note 2: visible because this is the object mapper we run with; we want our unit tests to...
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.derkurier\src\main\java\de\metas\shipper\gateway\derkurier\DerKurierClientFactory.java
2
请完成以下Java代码
public final class ASIAvailableForSalesAttributesKeyFilter implements IQueryFilter<I_MD_Available_For_Sales> { public static ASIAvailableForSalesAttributesKeyFilter matchingAttributes(@NonNull final AttributesKeyPattern attributesKeyPattern) { return new ASIAvailableForSalesAttributesKeyFilter(attributesKeyPattern)...
return MoreObjects.toStringHelper(this).addValue(attributesKeyPattern).toString(); } @Override public boolean accept(@Nullable final I_MD_Available_For_Sales availableForSales) { // Guard against null, shall not happen if (availableForSales == null) { return false; } final AttributesKey expectedAttri...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java\de\metas\material\cockpit\availableforsales\ASIAvailableForSalesAttributesKeyFilter.java
1
请完成以下Java代码
protected boolean afterSave(boolean newRecord, boolean success) { if (!success) { return success; } // Create Update if (newRecord && getResult() != null) { final MRequestUpdate update = new MRequestUpdate(this); update.save(); } // sendNotifications(); // ChangeRequest - created in Req...
.build()); } } private UserId getOldSalesRepId() { final Object oldSalesRepIdObj = get_ValueOld(I_R_Request.COLUMNNAME_SalesRep_ID); if (oldSalesRepIdObj instanceof Integer) { final int repoId = ((Integer)oldSalesRepIdObj).intValue(); return UserId.ofRepoId(repoId); } else { return null; } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MRequest.java
1
请完成以下Java代码
public Duration getCleanInstancesEndedAfter() { return cleanInstancesEndedAfter; } public ProcessEngineConfiguration setCleanInstancesEndedAfter(Duration cleanInstancesEndedAfter) { this.cleanInstancesEndedAfter = cleanInstancesEndedAfter; return this; } public int getCleanInst...
public ProcessEngineConfiguration setHistoryCleaningManager(HistoryCleaningManager historyCleaningManager) { this.historyCleaningManager = historyCleaningManager; return this; } public boolean isAlwaysUseArraysForDmnMultiHitPolicies() { return alwaysUseArraysForDmnMultiHitPolicies; ...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\ProcessEngineConfiguration.java
1
请在Spring Boot框架中完成以下Java代码
public class BaseValueInject { @Value("normal") private String normal; // Inject ordinary string @Value("#{systemProperties['os.name']}") private String systemPropertiesName; //Inject operating system properties @Value("#{ T(java.lang.Math).random() * 100.0 }") private double randomNumber; /...
private Resource testUrl; // Inject URL resources @Override public String toString() { return "BaseValueInject{" + "normal='" + normal + '\'' + ", systemPropertiesName='" + systemPropertiesName + '\'' + ", randomNumber=" + randomNumber + ...
repos\springboot-demo-master\SpEL\src\main\java\com\et\spel\controller\BaseValueInject.java
2
请完成以下Java代码
public String getChatId() { return chatId; } public void setChatId(@Nullable String chatId) { this.chatId = chatId; } @Nullable public String getAuthToken() { return authToken; } public void setAuthToken(@Nullable String authToken) { this.authToken = authToken; } public boolean isDisableNotify() { ...
} public void setDisableNotify(boolean disableNotify) { this.disableNotify = disableNotify; } public String getParseMode() { return parseMode; } public void setParseMode(String parseMode) { this.parseMode = parseMode; } }
repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\notify\TelegramNotifier.java
1
请完成以下Java代码
public boolean deposit(int funds) { int[] stamps = new int[1]; int current = this.account.get(stamps); int newStamp = this.stamp.incrementAndGet(); // Thread is paused here to allow other threads to update the stamp and amount (for testing only) sleep(); return this.acc...
} public int getBalance() { return account.getReference(); } public int getStamp() { return account.getStamp(); } private static void sleep() { try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException ignored) { } } }
repos\tutorials-master\core-java-modules\core-java-concurrency-advanced-3\src\main\java\com\baeldung\atomicstampedreference\StampedAccount.java
1
请完成以下Java代码
public void updateById(UserDO entity) { // 生成 Update 条件 final Update update = new Update(); // 反射遍历 entity 对象,将非空字段设置到 Update 中 ReflectionUtils.doWithFields(entity.getClass(), new ReflectionUtils.FieldCallback() { @Override public void doWith(Field field) throws ...
return; } // 执行更新 mongoTemplate.updateFirst(new Query(Criteria.where("_id").is(entity.getId())), update, UserDO.class); } public void deleteById(Integer id) { mongoTemplate.remove(new Query(Criteria.where("_id").is(id)), UserDO.class); } public UserDO findById(Integer i...
repos\SpringBoot-Labs-master\lab-16-spring-data-mongo\lab-16-spring-data-mongodb\src\main\java\cn\iocoder\springboot\lab16\springdatamongodb\dao\UserDao.java
1
请完成以下Java代码
public class GroovyTypeDeclaration extends TypeDeclaration { private int modifiers; private final List<GroovyFieldDeclaration> fieldDeclarations = new ArrayList<>(); private final List<GroovyMethodDeclaration> methodDeclarations = new ArrayList<>(); GroovyTypeDeclaration(String name) { super(name); } /** ...
*/ public List<GroovyFieldDeclaration> getFieldDeclarations() { return this.fieldDeclarations; } /** * Adds the given method declaration. * @param methodDeclaration the method declaration */ public void addMethodDeclaration(GroovyMethodDeclaration methodDeclaration) { this.methodDeclarations.add(methodDe...
repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\language\groovy\GroovyTypeDeclaration.java
1
请完成以下Java代码
public class Person { private String firstName; private String lastName; private int age; public Person() { } public Person(String firstName, String lastName, int age) { this.firstName = firstName; this.lastName = lastName; this.age = age; } public String get...
} public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public String toString() { ...
repos\tutorials-master\spring-web-modules\spring-mvc-basics-3\src\main\java\com\baeldung\cachedrequest\Person.java
1
请在Spring Boot框架中完成以下Java代码
public void shipOrder(int orderId) { Optional<ShippableOrder> order = this.orderRepository.findShippableOrder(orderId); order.ifPresent(completedOrder -> { Parcel parcel = new Parcel(completedOrder.getOrderId(), completedOrder.getAddress(), completedOrder.getPackageItems()); if (...
@Override public Optional<Parcel> getParcelByOrderId(int orderId) { return Optional.ofNullable(this.shippedParcels.get(orderId)); } public void setOrderRepository(ShippingOrderRepository orderRepository) { this.orderRepository = orderRepository; } @Override public EventBus getE...
repos\tutorials-master\patterns-modules\ddd-contexts\ddd-contexts-shippingcontext\src\main\java\com\baeldung\dddcontexts\shippingcontext\service\ParcelShippingService.java
2
请完成以下Java代码
public void setDateFrom (Timestamp DateFrom) { set_Value (COLUMNNAME_DateFrom, DateFrom); } /** Get Date From. @return Starting date for a range */ public Timestamp getDateFrom () { return (Timestamp)get_Value(COLUMNNAME_DateFrom); } /** Set Date To. @param DateTo End date of a date range */ ...
/** Set Comment/Help. @param Help Comment or Hint */ public void setHelp (String Help) { set_Value (COLUMNNAME_Help, Help); } /** Get Comment/Help. @return Comment or Hint */ public String getHelp () { return (String)get_Value(COLUMNNAME_Help); } /** Set Name. @param Name Alphanumeric i...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_GL_Fund.java
1
请完成以下Java代码
public void setProjInvoiceRule (final java.lang.String ProjInvoiceRule) { set_Value (COLUMNNAME_ProjInvoiceRule, ProjInvoiceRule); } @Override public java.lang.String getProjInvoiceRule() { return get_ValueAsString(COLUMNNAME_ProjInvoiceRule); } @Override public org.compiere.model.I_R_Status getR_Project...
{ if (SalesRep_ID < 1) set_Value (COLUMNNAME_SalesRep_ID, null); else set_Value (COLUMNNAME_SalesRep_ID, SalesRep_ID); } @Override public int getSalesRep_ID() { return get_ValueAsInt(COLUMNNAME_SalesRep_ID); } @Override public void setstartdatetime (final @Nullable java.sql.Timestamp startdateti...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Project.java
1
请完成以下Java代码
public boolean hasAttribute(String key) { return(this.containsKey(key)); } /** Perform the filtering operation. */ public String process(String to_process) { if ( to_process == null || to_process.length() == 0 ) return ""; StringBuffer bs = new Strin...
for (char c = sci.first(); c != CharacterIterator.DONE; c = sci.next()) { tmp = String.valueOf(c); if (hasAttribute(tmp)) tmp = (String) this.get(tmp); int ii = c; if (ii > 255) tmp = "&#" + ii + ";"; bs.append(tmp); } return(bs...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\filter\CharacterFilter.java
1
请完成以下Java代码
public static void main(String[] args) { SpringApplication.run(MainApplication.class, args); } // Spring runs CommandLineRunner bean when Spring Boot App starts @Bean public CommandLineRunner demo(BookRepository bookRepository) { return (args) -> { Book b1 = new Book("Book ...
log.info("\n"); }); // find book by published date after log.info("Book found with findByPublishedDateAfter(), after 2023/7/1"); log.info("--------------------------------------------"); bookRepository.findByPublishedDateAfter(LocalDate.of(2023, 7, 1)).forEac...
repos\spring-boot-master\spring-data-jpa\src\main\java\com\mkyong\MainApplication.java
1
请在Spring Boot框架中完成以下Java代码
public class EmployeeService_Service extends Service { private final static URL EMPLOYEESERVICE_WSDL_LOCATION; private final static WebServiceException EMPLOYEESERVICE_EXCEPTION; private final static QName EMPLOYEESERVICE_QNAME = new QName("http://bottomup.server.jaxws.baeldung.com/", "EmployeeService"...
*/ @WebEndpoint(name = "EmployeeServiceImplPort") public EmployeeService getEmployeeServiceImplPort() { return super.getPort(new QName("http://bottomup.server.jaxws.baeldung.com/", "EmployeeServiceImplPort"), EmployeeService.class); } /** * * @param features * A list of {@li...
repos\tutorials-master\web-modules\jee-7\src\main\java\com\baeldung\jaxws\client\EmployeeService_Service.java
2
请完成以下Java代码
public static MenuResultItemSource forRootNode(final MTreeNode root) { final Enumeration<?> nodesEnum = root.preorderEnumeration(); final List<MenuResultItem> items = new ArrayList<>(); while (nodesEnum.hasMoreElements()) { final MTreeNode node = (MTreeNode)nodesEnum.nextElement(); if (node == roo...
public Component getListCellRendererComponent(final JList<? extends ResultItem> list, final ResultItem value, final int index, final boolean isSelected, final boolean cellHasFocus) { final String valueAsText; final Icon icon; boolean enabled = true; if (value == null) { // shall not happen valu...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\tree\TreeSearchAutoCompleter.java
1
请完成以下Java代码
public void setM_Securpharm_Productdata_Result_ID (int M_Securpharm_Productdata_Result_ID) { if (M_Securpharm_Productdata_Result_ID < 1) set_Value (COLUMNNAME_M_Securpharm_Productdata_Result_ID, null); else set_Value (COLUMNNAME_M_Securpharm_Productdata_Result_ID, Integer.valueOf(M_Securpharm_Productdata_R...
/** Set TransaktionsID Server. @param TransactionIDServer TransaktionsID Server */ @Override public void setTransactionIDServer (java.lang.String TransactionIDServer) { set_Value (COLUMNNAME_TransactionIDServer, TransactionIDServer); } /** Get TransaktionsID Server. @return TransaktionsID Server */ @Ov...
repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.securpharm\src\main\java-gen\de\metas\vertical\pharma\securpharm\model\X_M_Securpharm_Action_Result.java
1
请完成以下Java代码
public Builder environment(String key, String value) { this.environment.put(key, value); return this; } public Builder environment(Map<String, String> environment) { this.environment.putAll(environment); return this; } public Builder ports(Collection<Integer> ports) { this.ports.addAll(ports); ...
public Builder labels(Map<String, String> label) { this.labels.putAll(label); return this; } /** * Builds the {@link ComposeService} instance. * @return the built instance */ public ComposeService build() { return new ComposeService(this); } } }
repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\container\docker\compose\ComposeService.java
1
请在Spring Boot框架中完成以下Java代码
public class FilterRegistrationConfig { private final ILanguageDAO languageDAO = Services.get(ILanguageDAO.class); // NOTE: we are using standard spring CORS filter // @Bean // public FilterRegistrationBean<CORSFilter> corsFilter() // { // final FilterRegistrationBean<CORSFilter> registrationBean = new FilterRe...
final FilterRegistrationBean<UserAuthTokenFilter> registrationBean = new FilterRegistrationBean<>(); registrationBean.setFilter(new UserAuthTokenFilter(userAuthTokenService, configuration, languageDAO)); registrationBean.addUrlPatterns(MetasfreshRestAPIConstants.URL_PATTERN_API); registrationBean.setOrder(2); r...
repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\util\web\filter\FilterRegistrationConfig.java
2
请在Spring Boot框架中完成以下Java代码
public CommonResult<PmsProductCategory> getItem(@PathVariable Long id) { PmsProductCategory productCategory = productCategoryService.getItem(id); return CommonResult.success(productCategory); } @ApiOperation("删除商品分类") @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) ...
} } @ApiOperation("修改显示状态") @RequestMapping(value = "/update/showStatus", method = RequestMethod.POST) @ResponseBody public CommonResult updateShowStatus(@RequestParam("ids") List<Long> ids, @RequestParam("showStatus") Integer showStatus) { int count = productCategoryService.updateShowStatu...
repos\mall-master\mall-admin\src\main\java\com\macro\mall\controller\PmsProductCategoryController.java
2
请完成以下Java代码
private ProductId getProductIdToPack() { if (_productIdToPack == null) { final PackageableRow packageableRow = getSingleSelectedPackageableRow(); _productIdToPack = packageableRow.getProductId(); } return _productIdToPack; } private void pickCUs() { final HuId splitCUId = Services.get(ITrxManager.c...
private IAllocationRequest createSplitAllocationRequest(final IHUContext huContext) { final ProductId productId = getProductId(); final I_C_UOM uom = productBL.getStockUOM(productId); return AllocationUtils.builder() .setHUContext(huContext) .setProduct(productId) .setQuantity(getQtyCUsPerTU(), uom)...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\husToPick\process\WEBUI_HUsToPick_PickCU.java
1
请完成以下Java代码
public JdkDto getJdk() { return jdk; } public void setJdk(JdkDto jdk) { this.jdk = jdk; } public Set<String> getCamundaIntegration() { return camundaIntegration; } public void setCamundaIntegration(Set<String> camundaIntegration) { this.camundaIntegration = camundaIntegration; } publ...
DatabaseDto.fromEngineDto(other.getDatabase()), ApplicationServerDto.fromEngineDto(other.getApplicationServer()), licenseKey != null ? LicenseKeyDataDto.fromEngineDto(licenseKey) : null, JdkDto.fromEngineDto(other.getJdk())); dto.dataCollectionStartDate = other.getDataCollectionStartDate();...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\telemetry\InternalsDto.java
1
请完成以下Java代码
protected boolean isEnded(HistoricBatchEntity instance) { return instance.getEndTime() != null; } protected boolean isStrategyStart(CommandContext commandContext) { return HISTORY_REMOVAL_TIME_STRATEGY_START.equals(getHistoryRemovalTimeStrategy(commandContext)); } protected boolean isStrategyEnd(Comma...
} public JobDeclaration<BatchJobContext, MessageEntity> getJobDeclaration() { return JOB_DECLARATION; } protected SetRemovalTimeBatchConfiguration createJobConfiguration(SetRemovalTimeBatchConfiguration configuration, List<String> batchIds) { return new SetRemovalTimeBatchConfiguration(batchIds) ....
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\removaltime\BatchSetRemovalTimeJobHandler.java
1
请完成以下Java代码
public class LinkThrowIconType extends IconType { @Override public Integer getWidth() { return 17; } @Override public Integer getHeight() { return 15; } @Override public String getAnchorValue() { return null; } @Override public String getFillValue(...
pathTag.setAttributeNS(null, "d", this.getDValue()); pathTag.setAttributeNS(null, "style", this.getStyleValue()); pathTag.setAttributeNS(null, "fill", this.getFillValue()); pathTag.setAttributeNS(null, "stroke", this.getStrokeValue()); gTag.appendChild(pathTag); svgGenerator.get...
repos\Activiti-develop\activiti-core\activiti-image-generator\src\main\java\org\activiti\image\impl\icon\LinkThrowIconType.java
1
请完成以下Java代码
public I_I_User retrieveImportRecord(final Properties ctx, final ResultSet rs) throws SQLException { final PO po = TableModelLoader.instance.getPO(ctx, I_I_User.Table_Name, rs, ITrx.TRXNAME_ThreadInherited); return InterfaceWrapperHelper.create(po, I_I_User.class); } /* * @param isInsertOnly ignored. This imp...
user.setFirstname(importRecord.getFirstname()); user.setLastname(importRecord.getLastname()); // set value after we set first name and last name user.setValue(importRecord.getUserValue()); user.setEMail(importRecord.getEMail()); user.setIsNewsletter(importRecord.isNewsletter()); user.setPhone(importRecord....
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\user\impexp\ADUserImportProcess.java
1
请完成以下Java代码
public class DynamicDatasourceInterceptor implements HandlerInterceptor { /** * 在请求处理之前进行调用(Controller方法调用之前) */ @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { String requestURI = request.getRequestURI(); log.info("经过...
* 请求处理之后进行调用,但是在视图被渲染之前(Controller方法调用之后) */ @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) { } /** * 在整个请求结束之后被调用,也就是在DispatcherServlet 渲染了对应的视图之后执行(主要是用于进行资源清理工作) */ @Override public void af...
repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\mybatis\interceptor\DynamicDatasourceInterceptor.java
1
请完成以下Java代码
public class OrderItem { private int productId; private int quantity; private float unitPrice; private float unitWeight; public OrderItem(int productId, int quantity, float unitPrice, float unitWeight) { this.productId = productId; this.quantity = quantity; this.unitPrice = ...
} public void setUnitPrice(float unitPrice) { this.unitPrice = unitPrice; } public float getUnitWeight() { return unitWeight; } public float getUnitPrice() { return unitPrice; } public void setUnitWeight(float unitWeight) { this.unitWeight = unitWeight; ...
repos\tutorials-master\patterns-modules\ddd-contexts\ddd-contexts-ordercontext\src\main\java\com\baeldung\dddcontexts\ordercontext\model\OrderItem.java
1
请完成以下Java代码
public String toString() { return getAsString(); } @NonNull @JsonValue public String getAsString() { return attributesKeyString; } public boolean isNone() { return NONE.equals(this); } public boolean isAll() { return ALL.equals(this); } public boolean isOther() { return OTHER.equals(this); ...
public boolean contains(@NonNull final AttributesKey attributesKey) { return parts.containsAll(attributesKey.parts); } public AttributesKey getIntersection(@NonNull final AttributesKey attributesKey) { final HashSet<AttributesKeyPart> ownMutableParts = new HashSet<>(parts); ownMutableParts.retainAll(attribut...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\event\src\main\java\de\metas\material\event\commons\AttributesKey.java
1
请完成以下Java代码
public String getPaymentRule () { return (String)get_Value(COLUMNNAME_PaymentRule); } /** Set Processed. @param Processed The document has been processed */ @Override public void setProcessed (boolean Processed) { set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed)); } /** Get Processed. ...
{ Object oo = get_Value(COLUMNNAME_Processing); if (oo != null) { if (oo instanceof Boolean) { return ((Boolean)oo).booleanValue(); } return "Y".equals(oo); } return false; } /** Set Search Key. @param Value Search key for the record in the format required - must be unique */ @O...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_HR_Payroll.java
1
请完成以下Java代码
final class AvailableForSaleResultBuilder { public static AvailableForSaleResultBuilder createEmpty() { return new AvailableForSaleResultBuilder(ImmutableList.of(AvailableForSaleResultBucket.newAcceptingAny())); } @NonNull public static AvailableForSaleResultBuilder createEmptyWithPredefinedBuckets(@NonNull fin...
public AvailableForSalesLookupResult build() { final ImmutableList<AvailableForSalesLookupBucketResult> groups = buckets.stream() .flatMap(AvailableForSaleResultBucket::buildAndStreamGroups) .collect(ImmutableList.toImmutableList()); return AvailableForSalesLookupResult.builder().availableForSalesResults(...
repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java\de\metas\material\cockpit\availableforsales\AvailableForSaleResultBuilder.java
1
请完成以下Java代码
public String toString() { return MoreObjects.toStringHelper(this) .add("count", currenciesById.size()) .toString(); } @NonNull public Currency getById(@NonNull final CurrencyId id) { final Currency currency = currenciesById.get(id); if (currency == null) { throw new AdempiereException("@NotFou...
public Currency getByCurrencyCode(@NonNull final CurrencyCode currencyCode) { final Currency currency = currenciesByCode.get(currencyCode); if (currency == null) { throw new AdempiereException("@NotFound@ @ISO_Code@: " + currencyCode); } return currency; } public Optional<Currency> getByCurrencyCodeIfE...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\currency\impl\CurrenciesMap.java
1
请完成以下Java代码
public String getTenantId() { return tenantId; } @Override public String toString() { return this.getClass().getSimpleName() + "[id=" + id + ", eventName=" + eventName + ", name=" + name + ", createTime=" + createTime + ", lastUpdated=" + lastUpdated + ", e...
+ ", taskDefinitionKey=" + taskDefinitionKey + ", assignee=" + assignee + ", owner=" + owner + ", description=" + description + ", dueDate=" + dueDate + ", followUpDate=" + followUpDate + ", priority=" + priority + ", deleteReason=" + deleteReason + ", cas...
repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\event\TaskEvent.java
1
请在Spring Boot框架中完成以下Java代码
public class MobileUIPickingUserProfileService { @NonNull private final MobileUIPickingUserProfileRepository profileRepository; @NonNull private final PickingConfigRepositoryV2 pickingConfigRepositoryV2; @NonNull public static MobileUIPickingUserProfileService newInstanceForUnitTesting() { Adempiere.assertUnitT...
return profileRepository.getPickingJobOptions(customerId); } @NonNull public PickingJobAggregationType getAggregationType(@Nullable final BPartnerId customerId) { return profileRepository.getAggregationType(customerId); } public boolean isConsiderAttributes() { return pickingConfigRepositoryV2.getPickingCo...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\config\mobileui\MobileUIPickingUserProfileService.java
2
请完成以下Java代码
public List<HistoricEntityLink> getHistoricEntityLinkParentsForProcessInstance(String processInstanceId) { return commandExecutor.execute(new GetHistoricEntityLinkParentsForProcessInstanceCmd(processInstanceId)); } @Override public List<HistoricEntityLink> getHistoricEntityLinkParentsForTask(String...
public HistoricTaskLogEntryBuilder createHistoricTaskLogEntryBuilder() { return new HistoricTaskLogEntryBuilderImpl(commandExecutor, configuration.getTaskServiceConfiguration()); } @Override public HistoricTaskLogEntryQuery createHistoricTaskLogEntryQuery() { return new HistoricTaskLogEntry...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\HistoryServiceImpl.java
1
请在Spring Boot框架中完成以下Java代码
public Set<PPOrderAndCostCollectorId> retainExistingPPCostCollectorIds( @NonNull final ProjectId projectId, @NonNull final Set<PPOrderAndCostCollectorId> orderAndCostCollectorIds) { if (orderAndCostCollectorIds.isEmpty()) { return ImmutableSet.of(); } final Set<PPCostCollectorId> costCollectorIds = o...
.addInArrayFilter(I_C_Project_Repair_CostCollector.COLUMNNAME_M_Product_ID, productId) .create() .anyMatch(); } public void deleteByIds(@NonNull final Collection<ServiceRepairProjectCostCollectorId> ids) { if (ids.isEmpty()) { return; } queryBL.createQueryBuilder(I_C_Project_Repair_CostCollector...
repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java\de\metas\servicerepair\project\repository\ServiceRepairProjectCostCollectorRepository.java
2
请完成以下Java代码
static EnvironmentPostProcessorsFactory fromSpringFactories(@Nullable ClassLoader classLoader) { return new SpringFactoriesEnvironmentPostProcessorsFactory( SpringFactoriesLoader.forDefaultResourceLocation(classLoader)); } /** * Return a {@link EnvironmentPostProcessorsFactory} that reflectively creates post...
return of(null, classNames); } /** * Return a {@link EnvironmentPostProcessorsFactory} that reflectively creates post * processors from the given class names. * @param classLoader the source class loader * @param classNames the post processor class names * @return an {@link EnvironmentPostProcessorsFactory...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\support\EnvironmentPostProcessorsFactory.java
1
请完成以下Java代码
public static class KeyValuePair { private String key; private Object value; public KeyValuePair() { } public KeyValuePair(String key, Object value) { this.key = key; this.value = value; } public String getKey() { return key...
} public void setKey(String key) { this.key = key; } public Object getValue() { return value; } public void setValue(Object value) { this.value = value; } } }
repos\tutorials-master\jackson-modules\jackson-conversions-3\src\main\java\com\baeldung\jackson\specifictype\dtos\PersonDTO.java
1
请完成以下Java代码
public Object fixedAmount(final FixedAmountCostCalculationMethodParams params) { record.setCostCalculation_FixedAmount(params.getFixedAmount().toBigDecimal()); return null; } @Override public Object percentageOfAmount(final PercentageCostCalculationMethodParams params) { reco...
record.setQtyOrdered(from.getQtyOrdered().toBigDecimal()); record.setC_Currency_ID(from.getCurrencyId().getRepoId()); record.setLineNetAmt(from.getOrderLineNetAmt().toBigDecimal()); } public void changeByOrderLineId( @NonNull final OrderLineId orderLineId, @NonNull Consumer<OrderCost> consumer) { final ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\OrderCostRepositorySession.java
1
请完成以下Java代码
public String getTopic() { return topic; } public String getMessage() { return message; } public boolean isRetain() { return retain; } public MqttQoS getQos() { return qos; } public static MqttLastWill.Builder builder(){ return new MqttLastWill...
return new MqttLastWill(topic, message, retain, qos); } } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MqttLastWill that = (MqttLastWill) o; if (retain != that.retain) return fals...
repos\thingsboard-master\netty-mqtt\src\main\java\org\thingsboard\mqtt\MqttLastWill.java
1
请完成以下Java代码
public FinancialInstrumentQuantityChoice getQty() { return qty; } /** * Sets the value of the qty property. * * @param value * allowed object is * {@link FinancialInstrumentQuantityChoice } * */ public void setQty(FinancialInstrumentQuantityChoice va...
public void setOrgnlAndCurFaceAmt(OriginalAndCurrentQuantities1 value) { this.orgnlAndCurFaceAmt = value; } /** * Gets the value of the prtry property. * * @return * possible object is * {@link ProprietaryQuantity1 } * */ public ProprietaryQuantity1 ...
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\TransactionQuantities2Choice.java
1
请完成以下Java代码
public Object generateSeedValue(final IAttributeSet attributeSet, final I_M_Attribute attribute, final Object valueInitialDefault) { // we don't support a value different from null Check.assumeNull(valueInitialDefault, "valueInitialDefault null"); return BigDecimal.ZERO; } @Override public String getAttribu...
public BigDecimal generateNumericValue(final Properties ctx, final IAttributeSet attributeSet, final I_M_Attribute attribute) { return BigDecimal.ZERO; } @Override protected boolean isExecuteCallout(final IAttributeValueContext attributeValueContext, final IAttributeSet attributeSet, final I_M_Attribute at...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\org\adempiere\mm\attributes\spi\impl\WeightTareAdjustAttributeValueCallout.java
1
请完成以下Java代码
public void setIsUseBPartnerAddress (boolean IsUseBPartnerAddress) { set_Value (COLUMNNAME_IsUseBPartnerAddress, Boolean.valueOf(IsUseBPartnerAddress)); } /** Get Benutze abw. Adresse. @return Benutze abw. Adresse */ @Override public boolean isUseBPartnerAddress () { Object oo = get_Value(COLUMNNAME_IsU...
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Process Now. @param Processing Process Now */ @Override public void setProcessing (boolean Processing) { set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing)); } /** Get...
repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java-gen\de\metas\dunning\model\X_C_DunningDoc.java
1
请完成以下Java代码
protected void applySortBy(HistoricTaskInstanceQuery query, String sortBy, Map<String, Object> parameters, ProcessEngine engine) { if (sortBy.equals(SORT_BY_TASK_ID)) { query.orderByTaskId(); } else if (sortBy.equals(SORT_BY_ACT_INSTANCE_ID)) { query.orderByHistoricActivityInstanceId(); } else i...
} else if (sortBy.equals(SORT_BY_PRIORITY)) { query.orderByTaskPriority(); } else if (sortBy.equals(SORT_BY_CASE_DEF_ID)) { query.orderByCaseDefinitionId(); } else if (sortBy.equals(SORT_BY_CASE_INST_ID)) { query.orderByCaseInstanceId(); } else if (sortBy.equals(SORT_BY_CASE_EXEC_ID)) { ...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\HistoricTaskInstanceQueryDto.java
1
请在Spring Boot框架中完成以下Java代码
public class SalesRegionRepository { private final IQueryBL queryBL = Services.get(IQueryBL.class); private final CCache<Integer, SalesRegionsMap> cache = CCache.<Integer, SalesRegionsMap>builder() .tableName(I_C_SalesRegion.Table_Name) .build(); public SalesRegion getById(final SalesRegionId salesRegionId) ...
{ return getMap().stream() .filter(salesRegion -> salesRegion.isActive() && UserId.equals(salesRegion.getSalesRepId(), salesRepId)) .max(Comparator.comparing(SalesRegion::getId)); } // // // private static class SalesRegionsMap { private final ImmutableMap<SalesRegionId, SalesRegion> byId; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\sales_region\SalesRegionRepository.java
2
请完成以下Java代码
public final class VATIdentifier { @NonNull private final String value; private VATIdentifier(@NonNull final String value) { final String valueNorm = StringUtils.trimBlankToNull(value); if (valueNorm == null) { throw new AdempiereException("Invalid VAT ID"); } this.value = valueNorm; } @NonNull pu...
return valueNorm != null ? of(valueNorm) : null; } @Override @Deprecated public String toString() {return getAsString();} @NonNull public String getAsString() {return value;} @Nullable public static String toString(@Nullable final VATIdentifier vatId) { return vatId != null ? vatId.getAsString() : null; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\tax\api\VATIdentifier.java
1
请在Spring Boot框架中完成以下Java代码
protected void executeInternal(JobExecutionContext context) throws JobExecutionException { try { Object obj = ctx.getBean(targetObject); Method m = null; try { m = obj.getClass().getMethod(targetMethod); //调用被代理对象的方法 m.invoke(ob...
} } public void setApplicationContext(ApplicationContext applicationContext) { this.ctx = applicationContext; } public void setTargetObject(String targetObject) { this.targetObject = targetObject; } public void setTargetMethod(String targetMethod) { this.targetMethod =...
repos\springBoot-master\springboot-Quartz\src\main\java\com\abel\quartz\config\InvokingJobDetailFactory.java
2
请完成以下Java代码
public int getC_OLCand_ID() { return get_ValueAsInt(COLUMNNAME_C_OLCand_ID); } /** * DocStatus AD_Reference_ID=131 * Reference name: _Document Status */ public static final int DOCSTATUS_AD_Reference_ID=131; /** Drafted = DR */ public static final String DOCSTATUS_Drafted = "DR"; /** Completed = CO */...
/** Reversed = RE */ public static final String DOCSTATUS_Reversed = "RE"; /** Closed = CL */ public static final String DOCSTATUS_Closed = "CL"; /** Unknown = ?? */ public static final String DOCSTATUS_Unknown = "??"; /** InProgress = IP */ public static final String DOCSTATUS_InProgress = "IP"; /** WaitingPay...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_Contract_Term_Alloc.java
1
请完成以下Java代码
public abstract class ComputerBuilder { protected Map<String, String> computerParts = new HashMap<>(); protected List<String> motherboardSetupStatus = new ArrayList<>(); public final Computer buildComputer() { addMotherboard(); setupMotherboard(); addProcessor(); return...
public abstract void addProcessor(); public List<String> getMotherboardSetupStatus() { return motherboardSetupStatus; } public Map<String, String> getComputerParts() { return computerParts; } private Computer getComputer() { return new Computer(computerParts); ...
repos\tutorials-master\patterns-modules\design-patterns-behavioral-2\src\main\java\com\baeldung\templatemethod\model\ComputerBuilder.java
1
请完成以下Java代码
public class SpringTransactionInterceptor extends AbstractCommandInterceptor { private static final Logger LOGGER = LoggerFactory.getLogger(SpringTransactionInterceptor.class); protected PlatformTransactionManager transactionManager; public SpringTransactionInterceptor(PlatformTransactionManager transacti...
} else { TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager); transactionTemplate.setPropagationBehavior(transactionPropagation); return transactionTemplate.execute(status -> next.execute(config, command, commandExecutor)); } } pri...
repos\flowable-engine-main\modules\flowable-spring-common\src\main\java\org\flowable\common\spring\SpringTransactionInterceptor.java
1
请完成以下Java代码
public I_M_HU_PI_Item_Product getDefaultForProduct(@NonNull final ProductId productId, @NonNull final ZonedDateTime dateTime) { return huPIItemProductDAO.retrieveDefaultForProduct(productId, dateTime); } @NonNull public I_M_HU_PI_Item_Product extractHUPIItemProduct(final I_C_Order order, final I_C_OrderLine orde...
} } @Override public int getRequiredLUCount(final @NonNull Quantity qty, final I_M_HU_LUTU_Configuration lutuConfigurationInStockUOM) { if (lutuConfigurationInStockUOM.isInfiniteQtyTU() || lutuConfigurationInStockUOM.isInfiniteQtyCU()) { return 1; } else { // Note need to use the StockQty because l...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HUPIItemProductBL.java
1
请完成以下Java代码
public WebuiImageId uploadImage(@RequestParam("file") final MultipartFile file) throws IOException { userSession.assertLoggedIn(); return imageService.uploadImage(file); } @GetMapping("/{imageId}") @ResponseBody public ResponseEntity<byte[]> getImage( @PathVariable("imageId") final int imageIdInt, @Requ...
private WebuiImage getWebuiImage(final WebuiImageId imageId, final int maxWidth, final int maxHeight) { final WebuiImage image = imageService.getWebuiImage(imageId, maxWidth, maxHeight); assertUserHasAccess(image); return image; } private void assertUserHasAccess(final WebuiImage image) { final BooleanWith...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\upload\ImageRestController.java
1
请完成以下Java代码
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application; } @Profile("insecure") @Configuration(proxyBeanMethods = false) public static class SecurityPermitAllConfig { private final AdminServerProperties adminServer; public SecurityPermitAllConfig(AdminServerP...
http.authorizeHttpRequests((authorizeRequests) -> authorizeRequests .requestMatchers(PathPatternRequestMatcher.withDefaults().matcher(this.adminServer.path("/assets/**"))) .permitAll() .requestMatchers(PathPatternRequestMatcher.withDefaults().matcher(this.adminServer.path("/login"))) .permitAll() .a...
repos\spring-boot-admin-master\spring-boot-admin-samples\spring-boot-admin-sample-war\src\main\java\de\codecentric\boot\admin\sample\SpringBootAdminWarApplication.java
1
请完成以下Java代码
public Author getAuthor() { return author; } public void setAuthor(Author author) { this.author = author; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (getClass() != obj.getClass()) {
return false; } return id != null && id.equals(((Book) obj).id); } @Override public int hashCode() { return 2021; } @Override public String toString() { return "Book{" + "id=" + id + ", title=" + title + ", isbn=" + isbn + '}'; } }
repos\Hibernate-SpringBoot-master\HibernateSpringBootAudit\src\main\java\com\bookstore\entity\Book.java
1
请在Spring Boot框架中完成以下Java代码
public void updateUser(User user) { logger.info("更新用户start..."); userMapper.updateById(user); int userId = user.getId(); // 缓存存在,删除缓存 String key = "user_" + userId; boolean hasKey = redisTemplate.hasKey(key); if (hasKey) { redisTemplate.delete(key); ...
* 如果缓存中存在,删除 */ public void deleteById(int id) { logger.info("删除用户start..."); userMapper.deleteById(id); // 缓存存在,删除缓存 String key = "user_" + id; boolean hasKey = redisTemplate.hasKey(key); if (hasKey) { redisTemplate.delete(key); logger.i...
repos\SpringBootBucket-master\springboot-redis\src\main\java\com\xncoding\pos\service\UserService.java
2
请完成以下Java代码
class PetOwner { @Id Long Id; String name; List<Dog> dogs; List<Cat> cats; List<Fish> fish; public PetOwner(String name, List<Cat> cats, List<Dog> dogs, List<Fish> fish) { this.name = name; this.cats = cats; this.dogs = dogs; this.fish = fish; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PetOwner petOwner = (PetOwner) o; return Objects.equals(Id, petOwner.Id) && Objects.equals(name, petOwner.name) && Objects.equals(dogs, petOwner.dogs) && Objects.equals(c...
repos\spring-data-examples-main\jdbc\singlequeryloading\src\main\java\example\springdata\jdbc\singlequeryloading\PetOwner.java
1
请完成以下Java代码
public void setM_Product_ID (final int M_Product_ID) { if (M_Product_ID < 1) set_Value (COLUMNNAME_M_Product_ID, null); else set_Value (COLUMNNAME_M_Product_ID, M_Product_ID); } @Override public int getM_Product_ID() { return get_ValueAsInt(COLUMNNAME_M_Product_ID); } @Override public void setP...
} @Override public boolean isProcessed() { return get_ValueAsBoolean(COLUMNNAME_Processed); } @Override public void setQM_Analysis_Report_ID (final int QM_Analysis_Report_ID) { if (QM_Analysis_Report_ID < 1) set_ValueNoCheck (COLUMNNAME_QM_Analysis_Report_ID, null); else set_ValueNoCheck (COLUMN...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_QM_Analysis_Report.java
1
请完成以下Java代码
public Incoterms getDefaultIncoterms(final @NotNull OrgId orgId) { return getIncotermsMap().getDefaultByOrgId(orgId); } @NotNull public Incoterms getById(@NotNull final IncotermsId id) { return getIncotermsMap().getById(id); } @NotNull public Incoterms getByValue(@NotNull final String value, @NotNull fina...
{ private final ImmutableMap<IncotermsId, Incoterms> byId; private final ImmutableMap<OrgId, Incoterms> defaultByOrgId; private final ImmutableMap<ValueAndOrgId, Incoterms> byValueAndOrgId; IncotermsMap(final List<Incoterms> list) { this.byId = Maps.uniqueIndex(list, Incoterms::getId); this.defaultByOr...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\incoterms\IncotermsRepository.java
1
请完成以下Java代码
public PaymentRow build() { return new PaymentRow(this); } public Builder setOrgId(final OrgId orgId) { this.orgId = orgId; return this; } public Builder setDocTypeName(final String docTypeName) { this.docTypeName = docTypeName; return this; } public Builder setC_Payment_ID(final int...
} public Builder setCurrencyISOCode(@Nullable final CurrencyCode currencyISOCode) { this.currencyISOCode = currencyISOCode; return this; } public Builder setPayAmt(final BigDecimal payAmt) { this.payAmt = payAmt; return this; } public Builder setPayAmtConv(final BigDecimal payAmtConv) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\PaymentRow.java
1
请在Spring Boot框架中完成以下Java代码
public class AlipayUtils { /** * 生成订单号 * @return String */ public String getOrderCode() { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); int a = (int)(Math.random() * 9000.0D) + 1000; System.out.println(a); Date date = new Date(); Stri...
// 获取支付宝POST过来反馈信息 Map<String,String> params = new HashMap<>(1); Map<String, String[]> requestParams = request.getParameterMap(); for (Object o : requestParams.keySet()) { String name = (String) o; String[] values = requestParams.get(name); String valueStr = "...
repos\eladmin-master\eladmin-tools\src\main\java\me\zhengjie\utils\AlipayUtils.java
2
请完成以下Java代码
public String getValue(@NonNull final String attributeValue) { switch (attributeValue) { case DeliveryMappingConstants.ATTRIBUTE_VALUE_PICKUP_DATE_AND_TIME_START: return getPickupDateAndTimeStart(); case DeliveryMappingConstants.ATTRIBUTE_VALUE_PICKUP_DATE_AND_TIME_END: return getPickupDateAndTimeEnd...
return getPickupAddress().getCompanyName1(); case DeliveryMappingConstants.ATTRIBUTE_VALUE_SENDER_COMPANY_NAME_2: return getPickupAddress().getCompanyName2(); case DeliveryMappingConstants.ATTRIBUTE_VALUE_SENDER_DEPARTMENT: return getPickupAddress().getCompanyDepartment(); case DeliveryMappingConstants...
repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-delivery\src\main\java\de\metas\common\delivery\v1\json\request\JsonDeliveryRequest.java
1
请完成以下Java代码
protected org.compiere.model.POInfo initPO(final Properties ctx) { return org.compiere.model.POInfo.getPOInfo(Table_Name); } @Override public void setC_ScannableCode_Format_ID (final int C_ScannableCode_Format_ID) { if (C_ScannableCode_Format_ID < 1) set_ValueNoCheck (COLUMNNAME_C_ScannableCode_Format_ID,...
} @Override public java.lang.String getDescription() { return get_ValueAsString(COLUMNNAME_Description); } @Override public void setName (final java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_ValueAsString(COLUMNNAME_Name); } ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ScannableCode_Format.java
1
请完成以下Java代码
public void createIfMissing(@NonNull final InputDataSourceCreateRequest request) { final I_AD_InputDataSource inputDataSource = retrieveInputDataSource( Env.getCtx(), request.getInternalName(), false, // throwEx ITrx.TRXNAME_None); if (inputDataSource == null) { final I_AD_InputDataSource newI...
} if (query.getExternalId() != null) { queryBuilder.addEqualsFilter(I_AD_InputDataSource.COLUMNNAME_ExternalId, query.getExternalId().getValue()); } if (!isEmpty(query.getValue(), true)) { queryBuilder.addEqualsFilter(I_AD_InputDataSource.COLUMNNAME_Value, query.getValue()); } if (query.getInputD...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\impex\api\impl\InputDataSourceDAO.java
1
请完成以下Java代码
static Frame read(ConnectionInputStream inputStream) throws IOException { int firstByte = inputStream.checkedRead(); Assert.state((firstByte & 0x80) != 0, "Fragmented frames are not supported"); int maskAndLength = inputStream.checkedRead(); boolean hasMask = (maskAndLength & 0x80) != 0; int length = (maskAnd...
/** * Pong frame. */ PONG(0x0A); private final int code; Type(int code) { this.code = code; } static Type forCode(int code) { for (Type type : values()) { if (type.code == code) { return type; } } throw new IllegalStateException("Unknown code " + code); } } }
repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\livereload\Frame.java
1
请完成以下Java代码
static public MPrintTableFormat get(final Properties ctx, final int AD_PrintTableFormat_ID, final int AD_PrintFont_ID) { return get(ctx, AD_PrintTableFormat_ID, MPrintFont.get(AD_PrintFont_ID).getFont()); } // get /** * Get Default Table Format. * * @param ctx context * @return Default Table Format (need ...
{ URL url; try { url = new URL(getImageURL()); Toolkit tk = Toolkit.getDefaultToolkit(); m_image = tk.getImage(url); } catch (MalformedURLException e) { log.warn("Malformed URL - " + getImageURL(), e); } } return m_image; } // getImage /** * Get the Image * * @return im...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\MPrintTableFormat.java
1
请完成以下Java代码
public void setIsShowAllParams (boolean IsShowAllParams) { set_Value (COLUMNNAME_IsShowAllParams, Boolean.valueOf(IsShowAllParams)); } /** Get Display All Parameters. @return Display All Parameters */ @Override public boolean isShowAllParams () { Object oo = get_Value(COLUMNNAME_IsShowAllParams); if (...
@param Name Alphanumeric identifier of the entity */ @Override public void setName (java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ @Override public java.lang.String getName () { return (java.lang.String)get_Value(COLU...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UserQuery.java
1
请在Spring Boot框架中完成以下Java代码
public class ArticleCommentsRestController { private static final Logger log = LoggerFactory.getLogger(ArticleCommentsRestController.class); private final KafkaTemplate<String, ArticleCommentAddedEvent> articleCommentsKafkaTemplate; public ArticleCommentsRestController( @Qualifier("articleComment...
var event = new ArticleCommentAddedEvent(articleSlug, dto.articleAuthor(), dto.comment(), dto.commentAuthor()); articleCommentsKafkaTemplate.send("baeldung.article-comment.added", articleSlug, event); return new Response("Success", articleSlug); } record Response(String status, String articleS...
repos\tutorials-master\spring-kafka-4\src\main\java\com\baeldung\kafka\monitoring\ArticleCommentsRestController.java
2
请在Spring Boot框架中完成以下Java代码
public JwtTokenStore jwtTokenStore() { return new JwtTokenStore(jwtAccessTokenConverter()); } @Override public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { endpoints.authenticationManager(authenticationManager) .tokenStore(jwtTokenStore()) ...
// .checkTokenAccess("isAuthenticated()"); // oauthServer.tokenKeyAccess("permitAll()") // .checkTokenAccess("permitAll()"); } @Override public void configure(ClientDetailsServiceConfigurer clients) throws Exception { clients.inMemory() .withClie...
repos\SpringBoot-Labs-master\lab-68-spring-security-oauth\lab-68-demo11-authorization-server-by-jwt-store\src\main\java\cn\iocoder\springboot\lab68\authorizationserverdemo\config\OAuth2AuthorizationServerConfig.java
2
请完成以下Java代码
public static KPIDataContext ofUserSession(@NonNull final UserSession userSession) { return builderFromUserSession(userSession).build(); } public static KPIDataContextBuilder builderFromUserSession(@NonNull final UserSession userSession) { return builder() .userId(userSession.getLoggedUserId()) .roleId...
|| Env.CTXNAME_AD_User_ID.equals(requiredParamName)) { userId_new = this.userId; } else if (CTXNAME_AD_Role_ID.getName().equals(requiredParamName) || Env.CTXNAME_AD_Role_ID.equals(requiredParamName)) { roleId_new = this.roleId; } else if (CTXNAME_AD_Client_ID.getName().equals(requiredPara...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\kpi\data\KPIDataContext.java
1
请完成以下Java代码
public CredProtect getInput() { return this.input; } public static class CredProtect implements Serializable { @Serial private static final long serialVersionUID = 109597301115842688L; private final ProtectionPolicy credProtectionPolicy; private final boolean enforceCredentialProtectionPolicy; public...
return this.enforceCredentialProtectionPolicy; } public ProtectionPolicy getCredProtectionPolicy() { return this.credProtectionPolicy; } public enum ProtectionPolicy { USER_VERIFICATION_OPTIONAL, USER_VERIFICATION_OPTIONAL_WITH_CREDENTIAL_ID_LIST, USER_VERIFICATION_REQUIRED } } }
repos\spring-security-main\webauthn\src\main\java\org\springframework\security\web\webauthn\api\CredProtectAuthenticationExtensionsClientInput.java
1
请完成以下Java代码
protected static ProcessPreconditionsResolution acceptIfEligibleOrder(final IProcessPreconditionsContext context) { if (!context.isSingleSelection()) { return ProcessPreconditionsResolution.rejectWithInternalReason("one and only one order shall be selected"); } // Only draft orders final I_C_Order order ...
} protected final ProcessPreconditionsResolution acceptIfOrderLinesNotInGroup(final IProcessPreconditionsContext context) { final Set<OrderLineId> orderLineIds = getSelectedOrderLineIds(context); if (orderLineIds.isEmpty()) { return ProcessPreconditionsResolution.rejectWithInternalReason("Select some order ...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\process\OrderCompensationGroupProcess.java
1
请完成以下Java代码
class NestedUrlConnectionResources implements Runnable { private final NestedLocation location; private volatile ZipContent zipContent; private volatile long size = -1; private volatile InputStream inputStream; NestedUrlConnectionResources(NestedLocation location) { this.location = location; } NestedLoca...
} long getContentLength() { return this.size; } @Override public void run() { releaseAll(); } private void releaseAll() { synchronized (this) { if (this.zipContent != null) { IOException exceptionChain = null; try { this.inputStream.close(); } catch (IOException ex) { excepti...
repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\net\protocol\nested\NestedUrlConnectionResources.java
1
请完成以下Java代码
final class ProductInfoSupplier { private final IProductDAO productsRepo; private final IUOMDAO uomsRepo; private final Map<ProductId, ProductInfo> productInfos = new HashMap<>(); @Builder private ProductInfoSupplier(final IProductDAO productsRepo, final IUOMDAO uomsRepo) { this.productsRepo = productsRepo; ...
packageSizeUOM = null; } final String stockUOM = uomsRepo.getName(UomId.ofRepoId(productRecord.getC_UOM_ID())).translate(Env.getAD_Language()); final ITranslatableString productName = InterfaceWrapperHelper.getModelTranslationMap(productRecord) .getColumnTrl(I_M_Product.COLUMNNAME_Name, productRecord.getNam...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\productsToPick\rows\factory\ProductInfoSupplier.java
1
请在Spring Boot框架中完成以下Java代码
private <T extends DeliveryMethodNotificationTemplate> T processTemplate(T template, Map<String, String> additionalTemplateContext) { Map<String, String> templateContext = new HashMap<>(); if (request.getInfo() != null) { templateContext.putAll(request.getInfo().getTemplateData()); }...
} }); return template; } private Map<String, String> createTemplateContextForRecipient(NotificationRecipient recipient) { return Map.of( "recipientTitle", recipient.getTitle(), "recipientEmail", Strings.nullToEmpty(recipient.getEmail()), "...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\notification\NotificationProcessingContext.java
2