instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | private static class PickFromHUsList
{
private final ArrayList<PickFromHU> list = new ArrayList<>();
PickFromHUsList() {}
public void add(@NonNull final PickFromHU pickFromHU) {list.add(pickFromHU);}
public List<I_M_HU> toHUsList() {return list.stream().map(PickFromHU::toM_HU).collect(ImmutableList.toImmuta... | //
@Value(staticConstructor = "of")
@EqualsAndHashCode(doNotUseGetters = true)
private static class HuPackingInstructionsIdAndCaptionAndCapacity
{
@NonNull HuPackingInstructionsId huPackingInstructionsId;
@NonNull String caption;
@Nullable Capacity capacity;
@Nullable
public Capacity getCapacityOrNull() ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\candidate\commands\PackToHUsProducer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InsuranceContractSalesContracts insuranceContractSalesContracts = (InsuranceContractSalesContracts) o;
return Objects.equals(this.name, insurance... | StringBuilder sb = new StringBuilder();
sb.append("class InsuranceContractSalesContracts {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" careType: ").append(toIndentedString(careType)).append("\n");
sb.append("}");
return sb.toString();
}
/**
*... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\model\InsuranceContractSalesContracts.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public List<IdentityLinkEntity> deleteScopeDefinitionIdentityLink(String scopeDefinitionId, String scopeType, String userId, String groupId) {
return getIdentityLinkEntityManager().deleteScopeDefinitionIdentityLink(scopeDefinitionId, scopeType, userId, groupId);
}
@Override
public void deleteId... | public void deleteIdentityLinksByScopeIdAndType(String scopeId, String scopeType) {
getIdentityLinkEntityManager().deleteIdentityLinksByScopeIdAndScopeType(scopeId, scopeType);
}
@Override
public void deleteIdentityLinksByProcessInstanceId(String processInstanceId) {
getIdentityLinkEnti... | repos\flowable-engine-main\modules\flowable-identitylink-service\src\main\java\org\flowable\identitylink\service\impl\IdentityLinkServiceImpl.java | 2 |
请完成以下Java代码 | public java.lang.String getRequestURI()
{
return get_ValueAsString(COLUMNNAME_RequestURI);
}
/**
* Status AD_Reference_ID=541316
* Reference name: StatusList
*/
public static final int STATUS_AD_Reference_ID=541316;
/** Empfangen = Empfangen */
public static final String STATUS_Empfangen = "Empfangen";... | @Override
public void setTime (final java.sql.Timestamp Time)
{
set_Value (COLUMNNAME_Time, Time);
}
@Override
public java.sql.Timestamp getTime()
{
return get_ValueAsTimestamp(COLUMNNAME_Time);
}
@Override
public void setUI_Trace_ExternalId (final @Nullable java.lang.String UI_Trace_ExternalId)
{
se... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_API_Request_Audit.java | 1 |
请完成以下Java代码 | public boolean existsByTenantAndKeyAndStatusOneOf(TenantId tenantId, String key, JobStatus... statuses) {
return jobRepository.existsByTenantIdAndKeyAndStatusIn(tenantId.getId(), key, Arrays.stream(statuses).toList());
}
@Override
public boolean existsByTenantIdAndTypeAndStatusOneOf(TenantId tenant... | public int removeByEntityId(TenantId tenantId, EntityId entityId) {
return jobRepository.deleteByEntityId(entityId.getId());
}
@Override
public EntityType getEntityType() {
return EntityType.JOB;
}
@Override
protected Class<JobEntity> getEntityClass() {
return JobEntity... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\job\JpaJobDao.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PackagingDetailsType getPackagingDetails() {
return packagingDetails;
}
/**
* Sets the value of the packagingDetails property.
*
* @param value
* allowed object is
* {@link PackagingDetailsType }
*
*/
public void setPackagingDetails(PackagingD... | *
* <p>
* Objects of the following type(s) are allowed in the list
* {@link PlanningQuantityType }
*
*
*/
public List<PlanningQuantityType> getPlanningQuantity() {
if (planningQuantity == null) {
planningQuantity = new ArrayList<PlanningQuantityType>();
}... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ForecastListLineItemType.java | 2 |
请完成以下Java代码 | public ResponseEntity<PageResult<AppDto>> queryApp(AppQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(appService.queryAll(criteria,pageable),HttpStatus.OK);
}
@Log("新增应用")
@ApiOperation(value = "新增应用")
@PostMapping
@PreAuthorize("@el.check('app:add')")
public Res... | @PutMapping
@PreAuthorize("@el.check('app:edit')")
public ResponseEntity<Object> updateApp(@Validated @RequestBody App resources){
appService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除应用")
@ApiOperation(value = "删除应用")
@DeleteMapping
@P... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\maint\rest\AppController.java | 1 |
请完成以下Java代码 | public static Image getImage2(final String fileNameWithoutExtension)
{
final ImageIcon imageIcon = getImageIcon2(fileNameWithoutExtension);
if(imageIcon == null)
{
return null;
}
return imageIcon.getImage();
}
/**
* Loads {@link Image} of given <code>url</code> and apply theme's RGB filter if any.
... | {
if (url == null)
{
return Optional.absent();
}
final Toolkit toolkit = Toolkit.getDefaultToolkit();
Image image = toolkit.getImage(url);
if (image == null)
{
return Optional.absent();
}
return Optional.fromNullable(image);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\images\Images.java | 1 |
请完成以下Java代码 | public void setIsProcessing (final boolean IsProcessing)
{
set_Value (COLUMNNAME_IsProcessing, IsProcessing);
}
@Override
public boolean isProcessing()
{
return get_ValueAsBoolean(COLUMNNAME_IsProcessing);
}
@Override
public void setLastEnqueued (final @Nullable java.sql.Timestamp LastEnqueued)
{
set_... | @Override
public void setParent_Async_Batch(final de.metas.async.model.I_C_Async_Batch Parent_Async_Batch)
{
set_ValueFromPO(COLUMNNAME_Parent_Async_Batch_ID, de.metas.async.model.I_C_Async_Batch.class, Parent_Async_Batch);
}
@Override
public void setParent_Async_Batch_ID (final int Parent_Async_Batch_ID)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java-gen\de\metas\async\model\X_C_Async_Batch.java | 1 |
请完成以下Java代码 | public void setCategoryType (String CategoryType)
{
set_Value (COLUMNNAME_CategoryType, CategoryType);
}
/** Get Category Type.
@return Source of the Journal with this category
*/
public String getCategoryType ()
{
return (String)get_Value(COLUMNNAME_CategoryType);
}
/** Set Description.
@param De... | /** Get Default.
@return Default value
*/
public boolean isDefault ()
{
Object oo = get_Value(COLUMNNAME_IsDefault);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_GL_Category.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class BPartnerEmailParams implements IEmailParameters
{
private static final Logger logger = LogManager.getLogger(BPartnerEmailParams.class);
private final String attachmentPrefix;
private final static MADBoilerPlate DEFAULT_TEXT_PRESET = null;
private final String exportFilePrefix;
private final I_... | @Override
public String getAttachmentPrefix(final String defaultValue)
{
return attachmentPrefix;
}
/**
* @return <code>null</code>
*/
@Override
public MADBoilerPlate getDefaultTextPreset()
{
return DEFAULT_TEXT_PRESET;
}
/**
* @return the title of the process
*/
@Override
public String getExpo... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\compiere\report\email\service\impl\BPartnerEmailParams.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class QueuePackageProcessorId implements RepoIdAware
{
int repoId;
@JsonCreator
public static QueuePackageProcessorId ofRepoId(final int repoId)
{
return new QueuePackageProcessorId(repoId);
}
@Nullable
public static QueuePackageProcessorId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? new... | {
return queuePackageProcessorId != null ? queuePackageProcessorId.getRepoId() : -1;
}
private QueuePackageProcessorId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, I_C_Queue_PackageProcessor.COLUMNNAME_C_Queue_PackageProcessor_ID);
}
@Override
@JsonValue
public int getRepoId()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\QueuePackageProcessorId.java | 2 |
请完成以下Java代码 | public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgumentResolver {
private final List<HandlerMethodArgumentResolver> argumentResolvers = new ArrayList<>();
private final Map<MethodParameter, HandlerMethodArgumentResolver> argumentResolverCache =
new ConcurrentHashMap<>(256);
/**
... | * {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
* and invoke the one that supports it.
* @throws IllegalArgumentException if no suitable argument resolver is found
*/
@Override
public @Nullable Object resolveArgument(MethodParameter parameter, DataFetchingEnvironment environment) throws E... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\data\method\HandlerMethodArgumentResolverComposite.java | 1 |
请完成以下Java代码 | public boolean isStrictMode() {
return strictMode;
}
public DmnEngineConfiguration setStrictMode(boolean strictMode) {
this.strictMode = strictMode;
return this;
}
@Override
public DmnEngineConfiguration setClock(Clock clock) {
this.clock = clock;
return thi... | this.decisionRequirementsDiagramGenerator = decisionRequirementsDiagramGenerator;
return this;
}
public boolean isCreateDiagramOnDeploy() {
return isCreateDiagramOnDeploy;
}
public DmnEngineConfiguration setCreateDiagramOnDeploy(boolean isCreateDiagramOnDeploy) {
this.isCreateD... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\DmnEngineConfiguration.java | 1 |
请完成以下Java代码 | public int getC_Year_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Year_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set End Date.
@param EndDate
Last effective date (inclusive)
*/
public void setEndDate (Timestamp EndDate)
{
set_Value (COLUMNNAME_EndDate, EndDate);
}
... | }
/** Get Period Type.
@return Period Type
*/
public String getPeriodType ()
{
return (String)get_Value(COLUMNNAME_PeriodType);
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Period.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class BookstoreService {
private final AuthorRepository authorRepository;
public BookstoreService(AuthorRepository authorRepository) {
this.authorRepository = authorRepository;
}
public List<Author> fetchFirst5() {
return authorRepository.findFirst5By();
}
public L... | return authorRepository.findFirst5ByAgeOrderByNameDesc(age);
}
public List<Author> fetchFirst5ByGenreOrderByAgeAsc(String genre) {
return authorRepository.findFirst5ByGenreOrderByAgeAsc(genre);
}
public List<Author> fetchFirst5ByAgeGreaterThanEqualOrderByNameAsc(int age) {
return autho... | repos\Hibernate-SpringBoot-master\HibernateSpringBootLimitResultSizeViaQueryCreator\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | public class M_Material_Tracking
{
@Init
public void setupCallouts()
{
CopyRecordFactory.enableForTableName(I_M_Material_Tracking.Table_Name);
// Setup callout M_Material_Tracking
final IProgramaticCalloutProvider calloutProvider = Services.get(IProgramaticCalloutProvider.class);
calloutProvider.registerAnn... | {
final AttributeValueId attributeValueId = AttributeValueId.ofRepoId(materialTracking.getM_AttributeValue_ID());
final IMaterialTrackingAttributeBL materialTrackingAttributeBL = Services.get(IMaterialTrackingAttributeBL.class);
final String attributeValue_Value = materialTrackingAttributeBL.getMaterialTrackingI... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\model\validator\M_Material_Tracking.java | 1 |
请完成以下Java代码 | public Set<Class> findAllClassesUsingClassLoader(String packageName) {
InputStream stream = ClassLoader.getSystemClassLoader()
.getResourceAsStream(packageName.replaceAll("[.]", "/"));
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
return reader.lines()
... | return reflections.getSubTypesOf(Object.class)
.stream()
.collect(Collectors.toSet());
}
public Set<Class> findAllClassesUsingGoogleGuice(String packageName) throws IOException {
return ClassPath.from(ClassLoader.getSystemClassLoader())
.getAllClasses()
.... | repos\tutorials-master\core-java-modules\core-java-reflection\src\main\java\com\baeldung\reflection\access\packages\AccessingAllClassesInPackage.java | 1 |
请完成以下Java代码 | public int getSeatingCapacity() {
return seatingCapacity;
}
public void setSeatingCapacity(int seatingCapacity) {
this.seatingCapacity = seatingCapacity;
}
public double getTopSpeed() {
return topSpeed;
}
public void setTopSpeed(doub... | private double payloadCapacity;
@JsonCreator
public Truck(@JsonProperty("make") String make, @JsonProperty("model") String model, @JsonProperty("payload") double payloadCapacity) {
super(make, model);
this.payloadCapacity = payloadCapacity;
}
public double getPa... | repos\tutorials-master\jackson-modules\jackson-core\src\main\java\com\baeldung\jackson\inheritance\SubTypeConstructorStructure.java | 1 |
请完成以下Java代码 | public void setPOL_ID (final int POL_ID)
{
if (POL_ID < 1)
set_Value (COLUMNNAME_POL_ID, null);
else
set_Value (COLUMNNAME_POL_ID, POL_ID);
}
@Override
public int getPOL_ID()
{
return get_ValueAsInt(COLUMNNAME_POL_ID);
}
@Override
public void setProcessed (final boolean Processed)
{
set_Valu... | @Override
public void setShipper_BPartner_ID (final int Shipper_BPartner_ID)
{
if (Shipper_BPartner_ID < 1)
set_Value (COLUMNNAME_Shipper_BPartner_ID, null);
else
set_Value (COLUMNNAME_Shipper_BPartner_ID, Shipper_BPartner_ID);
}
@Override
public int getShipper_BPartner_ID()
{
return get_ValueAsIn... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\shipping\model\X_M_ShipperTransportation.java | 1 |
请完成以下Java代码 | public class ServiceAuthenticationDetailsSource
implements AuthenticationDetailsSource<HttpServletRequest, ServiceAuthenticationDetails> {
private final Pattern artifactPattern;
private ServiceProperties serviceProperties;
/**
* Creates an implementation that uses the specified ServiceProperties and the defau... | * @param context the {@code HttpServletRequest} object.
* @return the {@code ServiceAuthenticationDetails} containing information about the
* current request
*/
@Override
public ServiceAuthenticationDetails buildDetails(HttpServletRequest context) {
try {
return new DefaultServiceAuthenticationDetails(this... | repos\spring-security-main\cas\src\main\java\org\springframework\security\cas\web\authentication\ServiceAuthenticationDetailsSource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getExecutionId() {
return executionId;
}
public void setExecutionId(String executionId) {
this.executionId = executionId;
}
public String getProcessInstanceId() {
return processInstanceId;
}
public void setProcessInstanceId(String processInstanceId) {
... | this.subScopeId = subScopeId;
}
public String getScopeType() {
return scopeType;
}
public void setScopeType(String scopeType) {
this.scopeType = scopeType;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.creat... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\caze\EventSubscriptionResponse.java | 2 |
请完成以下Java代码 | final String constructFirstPageUri(final UriComponentsBuilder uriBuilder, final int size) {
return uriBuilder.replaceQueryParam(PAGE, 0)
.replaceQueryParam("size", size)
.build()
.encode()
.toUriString();
}
final String constructLastPageUri(final UriCompo... | }
final boolean hasFirstPage(final int page) {
return hasPreviousPage(page);
}
final boolean hasLastPage(final int page, final int totalPages) {
return (totalPages > 1) && hasNextPage(page, totalPages);
}
// template
protected void plural(final UriComponentsBuilder uriBuilder... | repos\tutorials-master\spring-web-modules\spring-boot-rest\src\main\java\com\baeldung\web\hateoas\listener\PaginatedResultsRetrievedDiscoverabilityListener.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:mysql://localhost:3306/bookstoredb?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.h... | erties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.datasource.initialization-mode=always
spring.datasource.platform=mysql
spring.jpa.open-in-view=false | repos\Hibernate-SpringBoot-master\HibernateSpringBootPesimisticForceIncrement\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public Optional<Object> get_ValueIfExists(final @NonNull String variableName, final @NonNull Class<?> targetType)
{
if (excludeVariableName.equals(variableName))
{
return Optional.empty();
}
return parent.get_ValueIfExists(variableName, targetType);
}
}
@ToString
private static class RangeAwareP... | @Override
public Boolean get_ValueAsBoolean(final String variableName, final Boolean defaultValue_IGNORED)
{
return params.getParameterAsBool(variableName);
}
@Override
public Date get_ValueAsDate(final String variableName, final Date defaultValue)
{
final Timestamp value = params.getParameterAsTimes... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\util\Evaluatees.java | 1 |
请完成以下Java代码 | public void setCM_ChatType_ID (int CM_ChatType_ID)
{
if (CM_ChatType_ID < 1)
set_ValueNoCheck (COLUMNNAME_CM_ChatType_ID, null);
else
set_ValueNoCheck (COLUMNNAME_CM_ChatType_ID, Integer.valueOf(CM_ChatType_ID));
}
/** Get Chat Type.
@return Type of discussion / chat
*/
public int getCM_ChatType_I... | /** Get Self-Service.
@return This is a Self-Service entry or this entry can be changed via Self-Service
*/
public boolean isSelfService ()
{
Object oo = get_Value(COLUMNNAME_IsSelfService);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_ChatTypeUpdate.java | 1 |
请完成以下Java代码 | public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNam... | */
public void setSubstitute_ID (int Substitute_ID)
{
if (Substitute_ID < 1)
set_ValueNoCheck (COLUMNNAME_Substitute_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Substitute_ID, Integer.valueOf(Substitute_ID));
}
/** Get Substitute.
@return Entity which can be used in place of this entity
*/
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Substitute.java | 1 |
请完成以下Java代码 | public String getJobHandlerType() {
return jobHandlerType;
}
public void setJobHandlerType(String jobHandlerType) {
this.jobHandlerType = jobHandlerType;
}
@Override
public String getJobHandlerConfiguration() {
return jobHandlerConfiguration;
}
public void setJobHa... | this.endDate = endDate;
}
@Override
public String getExceptionMessage() {
return exceptionMessage;
}
public void setExceptionMessage(String exceptionMessage) {
this.exceptionMessage = StringUtils.abbreviate(exceptionMessage, MAX_EXCEPTION_MESSAGE_LENGTH);
}
@Override
p... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\AbstractJobEntity.java | 1 |
请完成以下Java代码 | public ImmutableList<String> getDetailGroupKeysForType(@NonNull final String attributeType, @NonNull final Function<String, String> valueProvider)
{
return streamEligibleConfigs(attributeType, valueProvider)
.map(JsonMappingConfig::getGroupKey)
.filter(Check::isNotBlank)
.distinct()
.collect(Immutabl... | .map(config -> new AbstractMap.SimpleImmutableEntry<>(
Integer.parseInt(config.getAttributeKey()),
valueProvider.apply(config.getAttributeValue())))
.filter(entry -> Check.isNotBlank(entry.getValue()))
.collect(Collectors.groupingBy(Map.Entry::getKey,
Collectors.mapping(Map.Entry::getValue, Co... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.client.nshift\src\main\java\de\metas\shipper\client\nshift\NShiftMappingConfigs.java | 1 |
请完成以下Java代码 | public void addChild(final Node<T> child)
{
this.children.add(child);
}
public boolean isLeaf()
{
return getChildren().isEmpty();
}
/**
* Creates and returns an ordered list with {@code this} and all
* the nodes found below it on the same branch in the tree.
*
* e.g given the following tree:
* -... | return upStream;
}
/**
* Tries to found a node among the ones found below {@code this} on the same branch
* in the tree with {@code value} equal to the given one.
*
* e.g given the following tree:
* ----1----
* ---/-\---
* --2---3--
* --|---|--
* --4---5--
* /-|-\----
* 6-7-8----
*
* if ... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\Node.java | 1 |
请完成以下Java代码 | public Optional<NotificationGroup> getNotificationGroupByName(final NotificationGroupName notificationGroupName) {return getMap().getByName(notificationGroupName);}
@Override
public Set<NotificationGroupName> getActiveNames() {return getMap().getNames();}
private NotificationGroupMap getMap() {return notificationG... | .collect(NotificationGroupMap.collect());
}
private static Recipient extractRecipient(final I_AD_NotificationGroup_CC record)
{
return Recipient.user(UserId.ofRepoId(record.getAD_User_ID()));
}
private static NotificationGroup toNotificationGroup(final I_AD_NotificationGroup record, Map<NotificationGroupId, No... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\notification\impl\NotificationGroupRepository.java | 1 |
请完成以下Java代码 | public void beforeSave(final I_SAP_GLJournal record, final ModelChangeType timing)
{
if (InterfaceWrapperHelper.isUIAction(record))
{
if (isConversionCtxChanged(record, timing))
{
glJournalService.updateWhileSaving(
record,
glJournal -> glJournal.updateLineAcctAmounts(glJournalService.getCurr... | }
}
@DocValidate(timings = ModelValidator.TIMING_AFTER_COMPLETE)
public void afterComplete(final I_SAP_GLJournal record)
{
glJournalService.fireAfterComplete(record);
}
@DocValidate(timings = ModelValidator.TIMING_AFTER_REACTIVATE)
public void beforeReactivate(final I_SAP_GLJournal record)
{
glJournalServ... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\gljournal_sap\interceptor\SAP_GLJournal.java | 1 |
请完成以下Java代码 | private void putInstance(@NonNull final HUReportProcessInstance instance)
{
instances.cleanUp();
instances.put(instance.getInstanceId(), instance.copyReadonly());
}
private HUReportProcessInstance getInstance(final DocumentId instanceId)
{
final HUReportProcessInstance instance = instances.getIfPresent(insta... | }
private DocumentId nextPInstanceId()
{
return DocumentId.ofString(UUID.randomUUID().toString());
}
private static final class IndexedWebuiHUProcessDescriptors
{
private final ImmutableMap<ProcessId, WebuiHUProcessDescriptor> descriptorsByProcessId;
private IndexedWebuiHUProcessDescriptors(final List<Web... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\report\HUReportProcessInstancesRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | DataSource dataSource() {
return new DataSource() {
@Override
public Connection getConnection() throws SQLException {
return null;
}
@Override
public Connection getConnection(String username, String password) throws SQLException {
... | @Override
public <T> T unwrap(Class<T> iface) throws SQLException {
return null;
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
}
@Override
public Logger get... | repos\tutorials-master\libraries\src\main\java\com\baeldung\activej\config\PersonModule.java | 2 |
请完成以下Java代码 | private static void getExistingPairs(int[] input, int sum) {
List<Integer> pairs = new ArrayList<>();
System.out.println("~ All existing pairs ~");
/* Traditional FOR loop */
// Call method
pairs = ExistingPairs.findPairsWithForLoop(input, sum);
// Create a pretty printi... | private static void getDifferentPairs(int[] input, int sum) {
List<Integer> pairs = new ArrayList<>();
System.out.println("~ All different pairs ~");
/* Traditional FOR loop */
// Call method
pairs = DifferentPairs.findPairsWithForLoop(input, sum);
// Create a pretty pri... | repos\tutorials-master\core-java-modules\core-java-numbers-9\src\main\java\com\baeldung\pairsaddupnumber\FindPairs.java | 1 |
请完成以下Java代码 | public void deleteHistoricDetailsByTaskId(String taskId) {
if (getHistoryManager().isHistoryLevelAtLeast(HistoryLevel.FULL)) {
List<HistoricDetailEntity> details = historicDetailDataManager.findHistoricDetailsByTaskId(taskId);
for (HistoricDetail detail : details) {
delet... | }
@Override
public long findHistoricDetailCountByNativeQuery(Map<String, Object> parameterMap) {
return historicDetailDataManager.findHistoricDetailCountByNativeQuery(parameterMap);
}
public HistoricDetailDataManager getHistoricDetailDataManager() {
return historicDetailDataManager;
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricDetailEntityManagerImpl.java | 1 |
请完成以下Java代码 | public class MAccessProfile extends X_CM_AccessProfile
{
/**
*
*/
private static final long serialVersionUID = -7399451749843773853L;
/**
* Access to Container
* @param ctx context
* @param CM_Container_ID
* @param AD_User_ID user to check
* @return true if access to container
*/
public static bo... | */
public MAccessProfile (Properties ctx, int CM_AccessProfile_ID,
String trxName)
{
super (ctx, CM_AccessProfile_ID, trxName);
} // MAccessProfile
/**
* Load Constructor
* @param ctx context
* @param rs result set
* @param trxName transaction
*/
public MAccessProfile (Properties ctx, ResultSet rs,... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MAccessProfile.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication()
.passwordEncoder(passwordEncoder())
.dataSource(dataSource);
}
@... | .anyRequest().authenticated()
.and()
.formLogin()
.and()
.logout()
.logoutUrl("/logout.do")
.invalidateHttpSession(true)
.clearAuthentication(true);
}
@Override
public void configure(WebSecurity web) throws Exception {
web... | repos\tutorials-master\spring-web-modules\spring-mvc-views\src\main\java\com\baeldung\themes\config\SecurityConfig.java | 2 |
请完成以下Java代码 | private StockDataAggregateItem recordRowToStockDataItem(@NonNull final I_T_MD_Stock_WarehouseAndProduct record)
{
return StockDataAggregateItem.builder()
.productCategoryId(record.getM_Product_Category_ID())
.productId(record.getM_Product_ID())
.productValue(record.getProductValue())
.warehouseId(rec... | {
queryBuilder.addInArrayFilter(I_MD_Stock.COLUMNNAME_M_Warehouse_ID, query.getWarehouseIds());
}
//
// Storage Attributes Key
{
final AttributesKeyQueryHelper<I_MD_Stock> helper = AttributesKeyQueryHelper.createFor(I_MD_Stock.COLUMN_AttributesKey);
final IQueryFilter<I_MD_Stock> attributesKeysFilter ... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java\de\metas\material\cockpit\stock\StockRepository.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void create(@NonNull final OrderPayScheduleCreateRequest request)
{
final SeqNoProvider seqNoProvider = SeqNoProvider.ofInt(10);
request.getLines()
.forEach(line -> createLine(line, request.getOrderId(), seqNoProvider.getAndIncrement()));
}
private static void createLine(@NonNull final OrderPaySchedu... | public Optional<OrderPaySchedule> getByOrderId(@NonNull final OrderId orderId)
{
return newLoaderAndSaver().loadByOrderId(orderId);
}
public void deleteByOrderId(@NonNull final OrderId orderId)
{
queryBL.createQueryBuilder(I_C_OrderPaySchedule.class)
.addEqualsFilter(I_C_OrderPaySchedule.COLUMNNAME_C_Order... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\paymentschedule\repository\OrderPayScheduleRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void deleteIdentityLink(@ApiParam(name = "caseInstanceId") @PathVariable("caseInstanceId") String caseInstanceId, @ApiParam(name = "identityId") @PathVariable("identityId") String identityId,
@ApiParam(name = "type") @PathVariable("type") String type) {
CaseInstance caseInstance = getCaseIns... | throw new FlowableIllegalArgumentException("Type is required.");
}
}
protected IdentityLink getIdentityLink(String identityId, String type, String caseInstanceId) {
// Perhaps it would be better to offer getting a single identity link
// from the API
List<IdentityLink> allLinks ... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\runtime\caze\CaseInstanceIdentityLinkResource.java | 2 |
请完成以下Java代码 | public <ModelType> ModelType retrieveModel(final Properties ctx, final String tableName, final Class<?> modelClass, final ResultSet rs, final String trxName)
{
final PO po = getPO(ctx, tableName, rs, trxName);
//
// Case: we have a modelClass specified
if (modelClass != null)
{
final Class<? extends PO> ... | //
// Case: no "clazz" and no "modelClass"
else
{
if (log.isDebugEnabled())
{
final AdempiereException ex = new AdempiereException("Query does not have a modelClass defined and no 'clazz' was specified as parameter."
+ "We need to avoid this case, but for now we are trying to do a force casting"
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\persistence\TableModelLoader.java | 1 |
请完成以下Java代码 | public Void call() throws Exception {
((SignallableActivityBehavior) activityBehaviorInstance).signal(execution, signalName, signalData);
return null;
}
});
}
@Override
public void performExecution(final ActivityExecution execution) throws Exception {
Callable<Void> callable = new Cal... | executeWithErrorPropagation(execution, callable);
}
protected ActivityBehavior getActivityBehaviorInstance(ActivityExecution execution, Object delegateInstance) {
if (delegateInstance instanceof ActivityBehavior) {
return new CustomActivityBehavior((ActivityBehavior) delegateInstance);
} else if (de... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\bpmn\behavior\ServiceTaskDelegateExpressionActivityBehavior.java | 1 |
请完成以下Java代码 | public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof CustomerSlim)) {
return false;
}
CustomerSlim other = (CustomerSlim) obj;
return Objects.equals(address, other.address) && id == other.id && Objects.equals(n... | CustomerSlim[] feedback = new CustomerSlim[customers.length];
for (int i = 0; i < customers.length; i++) {
Customer aCustomer = customers[i];
CustomerSlim newOne = new CustomerSlim();
newOne.setId(aCustomer.getId());
newOne.setName(aCustomer.getFirstName() + " "... | repos\tutorials-master\json-modules\json-2\src\main\java\com\baeldung\jsonoptimization\CustomerSlim.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public SmsTwoFaAccountConfig generateNewAccountConfig(User user, SmsTwoFaProviderConfig providerConfig) {
return new SmsTwoFaAccountConfig();
}
@Override
protected void sendVerificationCode(SecurityUser user, String verificationCode, SmsTwoFaProviderConfig providerConfig, SmsTwoFaAccountConfig acco... | @Override
public void check(TenantId tenantId) throws ThingsboardException {
if (!smsService.isConfigured(tenantId)) {
throw new ThingsboardException("SMS service is not configured", ThingsboardErrorCode.BAD_REQUEST_PARAMS);
}
}
@Override
public TwoFaProviderType getType() ... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\auth\mfa\provider\impl\SmsTwoFaProvider.java | 2 |
请完成以下Java代码 | public void setCalY(int calY)
{
this.calY = calY;
}
public String getPrintService()
{
return printService;
}
/**
* @param printService the printService to set
*/
public void setPrintService(String printService)
{
this.printService = printService;
}
public String getTray()
{
return tray;
}
/... | result = prime * result + trayNumber;
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PrintPackageInfo other = (PrintPackageInfo)obj;
if (calX != other.calX)
return fa... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing.common\de.metas.printing.api\src\main\java\de\metas\printing\esb\api\PrintPackageInfo.java | 1 |
请完成以下Java代码 | public class AtomicOperationCaseExecutionDisable extends AbstractCmmnEventAtomicOperation {
public String getCanonicalName() {
return "case-execution-disable";
}
protected String getEventName() {
return DISABLE;
}
protected CmmnExecution eventNotificationsStarted(CmmnExecution execution) {
Cmmn... | return execution;
}
protected void preTransitionNotification(CmmnExecution execution) {
CmmnExecution parent = execution.getParent();
if (parent != null) {
CmmnActivityBehavior behavior = getActivityBehavior(parent);
if (behavior instanceof CmmnCompositeActivityBehavior) {
CmmnComposite... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\operation\AtomicOperationCaseExecutionDisable.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getTaskDefinitionKey() {
return taskDefinitionKey;
}
public void setTaskDefinitionKey(String taskDefinitionKey) {
this.taskDefinitionKey = taskDefinitionKey;
}
public String getFormKey() {
return formKey;
}
public void setFormKey(String formKey) {
... | public void setScopeDefinitionId(String scopeDefinitionId) {
this.scopeDefinitionId = scopeDefinitionId;
}
public String getScopeId() {
return scopeId;
}
public void setScopeId(String scopeId) {
this.scopeId = scopeId;
}
public String getSubScopeId() {
return s... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\history\HistoricTaskInstanceResponse.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void saveData(RpAccountCheckBatch rpAccountCheckBatch) {
rpAccountCheckBatchDao.insert(rpAccountCheckBatch);
}
@Override
public void updateData(RpAccountCheckBatch rpAccountCheckBatch) {
rpAccountCheckBatchDao.update(rpAccountCheckBatch);
}
@Override
public RpAccountCheckBatch getDataById(String id) ... | public PageBean listPage(PageParam pageParam, Map<String, Object> paramMap) {
return rpAccountCheckBatchDao.listPage(pageParam, paramMap);
}
/**
* 根据条件查询实体
*
* @param paramMap
*/
public List<RpAccountCheckBatch> listBy(Map<String, Object> paramMap) {
return rpAccountCheckBatchDao.listBy(paramMap);
}
... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\service\impl\RpAccountCheckBatchServiceImpl.java | 2 |
请完成以下Java代码 | public String getMisfireStrategy() {
return misfireStrategy;
}
public void setMisfireStrategy(String misfireStrategy) {
this.misfireStrategy = misfireStrategy;
}
public String getExecutorRouteStrategy() {
return executorRouteStrategy;
}
public void setExecutorRouteStrategy(String executorRouteStrategy) {... | public String getGlueSource() {
return glueSource;
}
public void setGlueSource(String glueSource) {
this.glueSource = glueSource;
}
public String getGlueRemark() {
return glueRemark;
}
public void setGlueRemark(String glueRemark) {
this.glueRemark = glueRemark;
}
public Date getGlueUpdatetime() {
... | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-xxljob\src\main\java\com\xxl\job\admin\core\model\XxlJobInfo.java | 1 |
请完成以下Java代码 | private static class ProtocolResolvingResourceLoader implements ResourceLoader {
private final ResourceLoader resourceLoader;
private final List<ProtocolResolver> protocolResolvers;
private final List<FilePathResolver> filePathResolvers;
ProtocolResolvingResourceLoader(ResourceLoader resourceLoader, List<Pr... | String filePath = getFilePath(location, resource);
return (filePath != null) ? new ApplicationResource(filePath) : resource;
}
private @Nullable String getFilePath(String location, Resource resource) {
for (FilePathResolver filePathResolver : this.filePathResolvers) {
String filePath = filePathResolver.r... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\io\ApplicationResourceLoader.java | 1 |
请完成以下Java代码 | protected String getDelayedExecutionJobHandlerType() {
return null;
}
protected JobHandlerConfiguration getJobHandlerConfiguration() {
return null;
}
protected AbstractSetStateCmd getNextCommand() {
return null;
}
/**
* @return the id of the associated deployment, only necessary if the com... | if (tenantIdSet) {
definition = commandContext.getProcessDefinitionManager().findLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId);
} else {
// randomly use a latest process definition's deployment id from one of the tenants
List<ProcessDefinitionEntity> definitions = command... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\AbstractSetStateCmd.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PickingJob closeTUPickingTarget(
@NonNull final PickingJob pickingJob,
@Nullable final PickingJobLineId lineId)
{
final TUPickingTarget pickingTarget = getTUPickingTarget(pickingJob, lineId).orElse(null);
if (pickingTarget == null)
{
return pickingJob;
}
return setTUPickingTarget(pickingJob,... | {
final Set<DocumentLocation> deliveryLocations = bpartnerService.getDocumentLocations(pickingJob.getDeliveryBPLocationIds());
return pickingSlotService.getPickingSlotsSuggestions(deliveryLocations);
}
public PickingJob pickAll(@NonNull final PickingJobId pickingJobId, final @NonNull UserId callerId)
{
return... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\PickingJobService.java | 2 |
请完成以下Java代码 | public void setAD_Val_Rule_ID (final int AD_Val_Rule_ID)
{
if (AD_Val_Rule_ID < 1)
set_Value (COLUMNNAME_AD_Val_Rule_ID, null);
else
set_Value (COLUMNNAME_AD_Val_Rule_ID, AD_Val_Rule_ID);
}
@Override
public int getAD_Val_Rule_ID()
{
return get_ValueAsInt(COLUMNNAME_AD_Val_Rule_ID);
}
@Override
... | }
@Override
public void setWEBUI_Board_ID (final int WEBUI_Board_ID)
{
if (WEBUI_Board_ID < 1)
set_ValueNoCheck (COLUMNNAME_WEBUI_Board_ID, null);
else
set_ValueNoCheck (COLUMNNAME_WEBUI_Board_ID, WEBUI_Board_ID);
}
@Override
public int getWEBUI_Board_ID()
{
return get_ValueAsInt(COLUMNNAME_WEBU... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java-gen\de\metas\ui\web\base\model\X_WEBUI_Board.java | 1 |
请完成以下Java代码 | private List<I_M_HU> getTUsToAssign()
{
Check.assumeNotEmpty(_tusToAssign, "_tusToAssign not empty");
return _tusToAssign;
}
public final LUTUAssignBuilder setHUPlanningReceiptOwnerPM(final boolean isHUPlanningReceiptOwnerPM)
{
assertConfigurable();
_isHUPlanningReceiptOwnerPM = isHUPlanningReceiptOwnerPM;... | public LUTUAssignBuilder setM_Locator(final I_M_Locator locator)
{
assertConfigurable();
_locatorId = LocatorId.ofRecordOrNull(locator);
return this;
}
private LocatorId getLocatorId()
{
Check.assumeNotNull(_locatorId, "_locatorId not null");
return _locatorId;
}
public LUTUAssignBuilder setHUStatus(f... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\transfer\impl\LUTUAssignBuilder.java | 1 |
请完成以下Java代码 | public static String escapeEntities(String s) {
if (s == null || s.length() == 0) {
return s;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
char ch = s.charAt(i);
if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9') {
sb.append(ch);
}... | // Unexpected end
throw new IllegalArgumentException("Missing low surrogate character at end of string");
}
char low = s.charAt(i + 1);
if (!Character.isLowSurrogate(low)) {
throw new IllegalArgumentException(
"Expected low surrogate character but found value = " + (int) low);
}
int... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\util\TextEscapeUtils.java | 1 |
请完成以下Java代码 | public @Nullable PersistentRememberMeToken getTokenForSeries(String seriesId) {
try {
return getTemplate().queryForObject(this.tokensBySeriesSql, this::createRememberMeToken, seriesId);
}
catch (EmptyResultDataAccessException ex) {
this.logger.debug(LogMessage.format("Querying token for series '%s' returned... | * table when the class is initialized during the initDao method.
* @param createTableOnStartup set to true to execute the
*/
public void setCreateTableOnStartup(boolean createTableOnStartup) {
this.createTableOnStartup = createTableOnStartup;
}
private JdbcTemplate getTemplate() {
@Nullable JdbcTemplate res... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\rememberme\JdbcTokenRepositoryImpl.java | 1 |
请完成以下Java代码 | public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public Map<String, Object> getTransientVariables() {
return transientVariables;
}
public void setTransientVariables(Map<String, Object> transientVari... | }
public void setAssigneeId(String assigneeId) {
this.assigneeId = assigneeId;
}
public String getInitiatorVariableName() {
return initiatorVariableName;
}
public void setInitiatorVariableName(String initiatorVariableName) {
this.initiatorVariableName = initiatorVariableNa... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\interceptor\StartCaseInstanceBeforeContext.java | 1 |
请完成以下Java代码 | public void actionPerformed(ActionEvent e) {
cancelB_actionPerformed(e);
}
});
buttonsPanel.add(okB);
buttonsPanel.add(cancelB);
this.getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
}
void okB_actionPerformed(ActionEvent e) {
this.dispose();
}
void cancelB_actionPerformed(ActionEvent e) {... | + Local.getString("Sample Text"));
UIManager.put("ColorChooser.okText", Local.getString("OK"));
UIManager.put("ColorChooser.cancelText", Local.getString("Cancel"));
UIManager.put("ColorChooser.resetText", Local.getString("Reset"));
UIManager.put("ColorChooser.hsbHueText", Local.getString("H"));
UIManager.put(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\net\sf\memoranda\ui\htmleditor\TableDialog.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringApp {
public static void main(String[] args) {
SpringApplication.run(SpringApp.class, args);
}
@Bean
public Customizer<Resilience4JCircuitBreakerFactory> globalCustomConfiguration() {
TimeLimiterConfig timeLimiterConfig = TimeLimiterConfig.custom()
.t... | .build();
CircuitBreakerConfig circuitBreakerConfig = CircuitBreakerConfig.custom()
.failureRateThreshold(50)
.waitDurationInOpenState(Duration.ofMillis(1000))
.slidingWindowSize(2)
.build();
return factory -> factory.configure(builder -> ... | repos\tutorials-master\spring-cloud-modules\spring-cloud-circuit-breaker\src\main\java\com\baeldung\circuitbreaker\SpringApp.java | 2 |
请完成以下Java代码 | protected void prepare()
{
final IEventBusFactory eventBusFactory = SpringContextHolder.instance.getBean(IEventBusFactory.class);
eventBus = eventBusFactory.getEventBus(C_Location.EVENTS_TOPIC);
}
@Override
@RunOutOfTrx
protected String doIt()
{
Set<LocationId> locationIds = retrieveLocationIdsToUpdate(FET... | }
private void scheduleUpdate(@NonNull final LocationId locationId)
{
eventBus.enqueueObject(LocationGeocodeEventRequest.of(locationId));
countScheduled++;
if (maxLocationIdScheduled == null)
{
maxLocationIdScheduled = locationId;
}
else
{
maxLocationIdScheduled = Collections.max(Arrays.asList(... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\location\geocoding\process\C_Location_Geocoding_ScheduleUpdate.java | 1 |
请完成以下Java代码 | public Date resolveDuedate(String duedateDescription, Task task) {
return resolveDuedate(duedateDescription);
}
public Date resolveDuedate(String duedateDescription) {
return resolveDuedate(duedateDescription, (Date)null);
}
public Date resolveDuedate(String duedateDescription, Date startDate) {
r... | durationHelper.setRepeatOffset(repeatOffset);
return durationHelper.getDateAfter(startDate);
} else {
CronTimer cronTimer = CronTimer.parse(duedateDescription);
return cronTimer.getDueDate(startDate == null ? ClockUtil.getCurrentTime() : startDate);
}
}
catch (Exception e) {... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\calendar\CycleBusinessCalendar.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getClientInfo(String name) throws SQLException
{
return delegate.getClientInfo(name);
}
@Override
public Properties getClientInfo() throws SQLException
{
return delegate.getClientInfo();
}
@Override
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
{
retur... | {
delegate.abort(executor);
}
@Override
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
{
delegate.setNetworkTimeout(executor, milliseconds);
}
@Override
public int getNetworkTimeout() throws SQLException
{
return delegate.getNetworkTimeout();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\jasper\data_source\JasperJdbcConnection.java | 2 |
请完成以下Java代码 | public static boolean isCancelledContract(@NonNull final I_C_Flatrate_Term term)
{
return X_C_Flatrate_Term.CONTRACTSTATUS_Quit.equals(term.getContractStatus())
|| X_C_Flatrate_Term.CONTRACTSTATUS_Voided.equals(term.getContractStatus());
}
private static final CCache<Integer, I_C_Flatrate_Term> IC_2_TERM = CC... | public static void setBPartnerData(@NonNull final I_C_Invoice_Candidate ic)
{
final I_C_Flatrate_Term term = retrieveTerm(ic);
InvoiceCandidateLocationAdapterFactory
.billLocationAdapter(ic)
.setFrom(ContractLocationHelper.extractBillLocation(term));
}
public static UomId retrieveUomId(@NonNull final I... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\invoicecandidate\HandlerTools.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public PatientNoteMapping patientNotePatch(String apiKey, String id, PatientNote body) throws ApiException {
ApiResponse<PatientNoteMapping> resp = patientNotePatchWithHttpInfo(apiKey, id, body);
return resp.getData();
}
/**
* PatientenNotiz ändern
* Szenario - das WaWi ändert eine Pa... | public com.squareup.okhttp.Call patientNotePatchAsync(String apiKey, String id, PatientNote body, final ApiCallback<PatientNoteMapping> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = nu... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\api\PatientNoteApi.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class BookstoreService {
private final AuthorRepository authorRepository;
public BookstoreService(AuthorRepository authorRepository) {
this.authorRepository = authorRepository;
}
@Transactional(readOnly = true)
public void fetchAuthorWithAllBooks() {
Author author = autho... | @Transactional(readOnly = true)
public void fetchAuthorWithCheapBooks() {
Author author = authorRepository.findById(1L).orElseThrow();
List<Book> books = author.getCheapBooks();
System.out.println(books);
}
@Transactional(readOnly = true)
public void fetchAuthorWithRestOfBooks... | repos\Hibernate-SpringBoot-master\HibernateSpringBootFilterAssociation\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | public class CartItemEvent {
private String itemId;
private int quantity;
public CartItemEvent(String itemId, int quantity) {
this.itemId = itemId;
this.quantity = quantity;
}
public String getItemId() {
return itemId;
}
public void setItemId(String itemId) {
... | }
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
@Override
public String toString() {
return "CartItemEvent{" + "itemId='" + itemId + '\'' + ", quantity=" + quantity + '}';
}
} | repos\tutorials-master\messaging-modules\apache-rocketmq\src\main\java\com\baeldung\rocketmq\event\CartItemEvent.java | 1 |
请完成以下Java代码 | private final List<I_M_Movement> retrieveMovementsForInOut(final I_M_InOut inout)
{
Check.assumeNotNull(inout, "inout not null");
return Services.get(IQueryBL.class)
.createQueryBuilder(I_M_Movement.class, inout)
.addEqualsFilter(I_M_Movement.COLUMNNAME_M_InOut_ID, inout.getM_InOut_ID())
.create()
... | // Iterate all linked movements and reverse them one by one (if not already reversed)
final List<I_M_Movement> movements = retrieveMovementsForInOut(inout);
for (final I_M_Movement movement : movements)
{
// Skip those movements which were already reversed
if (docActionBL.isDocumentReversedOrVoided(movement... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inout\api\impl\InOutMovementBL.java | 1 |
请完成以下Java代码 | public Void execute(CommandContext commandContext) {
List<SignalEventSubscriptionEntity> signalEvents = null;
EventSubscriptionEntityManager eventSubscriptionEntityManager =
commandContext.getEventSubscriptionEntityManager();
if (executionId == null) {
signalEvents = eve... | );
if (signalEvents.isEmpty()) {
throw new ActivitiException(
"Execution '" +
executionId +
"' has not subscribed to a signal event with name '" +
eventName +
"'."
);
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\SignalEventReceivedCmd.java | 1 |
请完成以下Java代码 | public void setTemplateXST (String TemplateXST)
{
set_Value (COLUMNNAME_TemplateXST, TemplateXST);
}
/** Get TemplateXST.
@return Contains the template code itself
*/
public String getTemplateXST ()
{
return (String)get_Value(COLUMNNAME_TemplateXST);
}
/** Set Search Key.
@param Value | Search key for the record in the format required - must be unique
*/
public void setValue (String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
/** Get Search Key.
@return Search key for the record in the format required - must be unique
*/
public String getValue ()
{
return (String)get_Value(COLU... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Template.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public UserSummary getCurrentUser(@CurrentUser UserPrincipal currentUser)
{
UserSummary userSummary = new UserSummary(currentUser.getId(), currentUser.getUsername(),currentUser.getSurname(), currentUser.getName(), currentUser.getLastname(), currentUser.getCity());
return userSummary;
}
@Get... | {
return userRepository.findAllUsers();
}
@GetMapping("/users/{id}")
public UserProfile getUserProfile(@PathVariable(value = "id") Long id)
{
User user = userRepository.findById(id)
.orElseThrow(() -> new ResourceNotFoundException("User", "username", id));
UserProfil... | repos\SpringBoot-Projects-FullStack-master\Part-9.SpringBoot-React-Projects\Project-2.SpringBoot-React-ShoppingMall\fullstack\backend\src\main\java\com\urunov\controller\UserController.java | 2 |
请完成以下Java代码 | public void afterRegionDestroy(RegionEvent<K, V> event) {
processRegionEvent(event, RegionEventType.DESTROY);
}
@Override
public void afterRegionInvalidate(RegionEvent<K, V> event) {
processRegionEvent(event, RegionEventType.INVALIDATE);
}
@Override
public void afterRegionLive(RegionEvent<K, V> event) {
p... | CREATE,
DESTROY,
INVALIDATE,
UPDATE;
}
public enum RegionEventType {
CLEAR,
CREATE,
DESTROY,
INVALIDATE,
LIVE;
}
} | repos\spring-boot-data-geode-main\spring-geode-project\apache-geode-extensions\src\main\java\org\springframework\geode\cache\AbstractCommonEventProcessingCacheListener.java | 1 |
请完成以下Java代码 | public OAuth2DeviceCode generate(OAuth2TokenContext context) {
if (context.getTokenType() == null
|| !OAuth2ParameterNames.DEVICE_CODE.equals(context.getTokenType().getValue())) {
return null;
}
Instant issuedAt = Instant.now();
Instant expiresAt = issuedAt
.plus(context.getRegisteredClient().g... | sb.append(VALID_CHARS[offset]);
}
sb.insert(4, '-');
return sb.toString();
}
}
private static final class OAuth2UserCodeGenerator implements OAuth2TokenGenerator<OAuth2UserCode> {
private final StringKeyGenerator userCodeGenerator = new UserCodeStringKeyGenerator();
@Nullable
@Override
public O... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\OAuth2DeviceAuthorizationRequestAuthenticationProvider.java | 1 |
请完成以下Java代码 | public void setOperation (final java.lang.String Operation)
{
set_Value (COLUMNNAME_Operation, Operation);
}
@Override
public java.lang.String getOperation()
{
return get_ValueAsString(COLUMNNAME_Operation);
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
... | set_Value (COLUMNNAME_Value, Value);
}
@Override
public java.lang.String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
@Override
public void setValue2 (final java.lang.String Value2)
{
set_Value (COLUMNNAME_Value2, Value2);
}
@Override
public java.lang.String getValue2()
{
return get... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_NextCondition.java | 1 |
请完成以下Java代码 | public class RelatedDocumentsEvaluationContext
{
@Getter
private final RelatedDocumentsPermissions permissions;
@Getter
private final RelatedDocumentsId onlyRelatedDocumentsId;
@Nullable
private final HashMap<RelatedDocumentsTargetWindow, Priority> alreadySeenWindows;
@Builder
private RelatedDocumentsEvaluati... | }
public Priority getPriorityOrNull(final RelatedDocumentsTargetWindow window)
{
return alreadySeenWindows != null ? alreadySeenWindows.get(window) : null;
}
public void putAlreadySeenWindow(@NonNull final RelatedDocumentsTargetWindow targetWindow, @NonNull final Priority priority)
{
if (alreadySeenWindows !... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\references\related_documents\RelatedDocumentsEvaluationContext.java | 1 |
请完成以下Java代码 | default I_PP_Product_BOM getById(final int productBomId)
{
return productBomId > 0 ? getById(ProductBOMId.ofRepoId(productBomId)) : null;
}
List<I_PP_Product_BOM> getByIds(Collection<ProductBOMId> bomIds);
I_PP_Product_BOMLine getBOMLineById(int productBOMLineId);
ImmutableList<I_PP_Product_BOMLine> retrieveL... | default List<I_PP_Product_BOM> retrieveBOMsContainingExactProducts(final Integer... productIds)
{
return retrieveBOMsContainingExactProducts(Arrays.asList(productIds));
}
void save(I_PP_Product_BOMLine bomLine);
I_PP_Product_BOM createBOM(ProductBOMVersionsId versionsId, BOMCreateRequest request);
ProductId g... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\org\eevolution\api\IProductBOMDAO.java | 1 |
请完成以下Java代码 | public String getClimate() {
return climate;
}
public void setClimate(String climate) {
this.climate = climate;
}
public Double getPopulation() {
return population;
}
public void setPopulation(Double population) {
this.population = population;
}
@Overr... | out.writeObject(community);
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
this.climate = in.readUTF();
community = (Community) in.readObject();
}
@Override
public String toString() {
ret... | repos\tutorials-master\core-java-modules\core-java-serialization\src\main\java\com\baeldung\externalizable\Region.java | 1 |
请完成以下Java代码 | public void unLog()
{
super.unLog();
for (float[][] m : transition_probability2)
{
for (float[] v : m)
{
for (int i = 0; i < v.length; i++)
{
v[i] = (float) Math.exp(v[i]);
}
}
}
... | public boolean similar(HiddenMarkovModel model)
{
if (!(model instanceof SecondOrderHiddenMarkovModel)) return false;
SecondOrderHiddenMarkovModel hmm2 = (SecondOrderHiddenMarkovModel) model;
for (int i = 0; i < transition_probability.length; i++)
{
for (int j = 0; j < tr... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\hmm\SecondOrderHiddenMarkovModel.java | 1 |
请完成以下Java代码 | private Iterator<PO> fetchRecords(final MTable table, final List<String> addressColumnNames)
{
final StringBuilder whereClause = new StringBuilder("1=1");
final List<Object> params = new ArrayList<>();
if (p_AD_Org_ID != null)
{
whereClause.append(" AND AD_Org_ID = ?");
params.add(p_AD_Org_ID);
}
f... | }
if (whereAddresses.length() == 0)
{
throw new AdempiereException("Table " + table.getTableName() + " does not have address columns");
}
else
{
whereClause.append(" AND ( ").append(whereAddresses).append(" )");
}
return new Query(getCtx(), table.getTableName(), whereClause.toString(), get_TrxName(... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\process\UpdateAddresses.java | 1 |
请完成以下Java代码 | public void updateVisible()
{
if (container == null)
{
return;
}
boolean hasVisibleComponents = false;
for (final Component comp : getContentPane().getComponents())
{
// Ignore layout components
if (comp instanceof Box.Filler)
{
continue;
}
if (comp.isVisible())
{
hasVisibleC... | .newline();
contentPanel.add(childGroupPanel.getComponent(), constraints);
}
public void addLabelAndEditor(final CLabel fieldLabel, final VEditor fieldEditor, final boolean sameLine)
{
final GridField gridField = fieldEditor.getField();
final GridFieldLayoutConstraints gridFieldConstraints = gridField.getLayo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\grid\VPanelFieldGroup.java | 1 |
请完成以下Java代码 | public static <T> T executeWithinProcessApplication(Callable<T> callback, ProcessApplicationReference processApplicationReference) {
return executeWithinProcessApplication(callback, processApplicationReference, null);
}
public static <T> T executeWithinProcessApplication(Callable<T> callback, ProcessApplicatio... | // unwrap exception
if(e.getCause() != null && e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
}else {
throw new ProcessEngineException("Unexpected exeption while executing within process application ", e);
}
} finally {
remov... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\context\Context.java | 1 |
请完成以下Java代码 | public static HuId ofObject(@NonNull final Object object)
{
return RepoIdAwares.ofObject(object, HuId.class);
}
@Nullable
public static HuId ofRepoIdOrNull(final int repoId)
{
return repoId > 0 ? ofRepoId(repoId) : null;
}
public static int toRepoId(@Nullable final HuId huId)
{
return huId != null ? huI... | }
}
public static HuId ofHUValueOrNull(@Nullable final String huValue)
{
final String huValueNorm = StringUtils.trimBlankToNull(huValue);
if (huValueNorm == null) {return null;}
try
{
return ofRepoIdOrNull(NumberUtils.asIntOrZero(huValueNorm));
}
catch (final Exception ex)
{
return null;
}
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\handlingunits\HuId.java | 1 |
请完成以下Java代码 | public synchronized String getNextId() {
if (lastId<nextId) {
getNewBlock();
}
long _nextId = nextId++;
return Long.toString(_nextId);
}
protected synchronized void getNewBlock() {
// TODO http://jira.codehaus.org/browse/ACT-45 use a separate 'requiresNew' command executor
IdBlock idB... | return commandExecutor;
}
public void setCommandExecutor(CommandExecutor commandExecutor) {
this.commandExecutor = commandExecutor;
}
/**
* Reset inner state so that the generator fetches a new block of IDs from the database
* when the next ID generation request is received.
*/
public void rese... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\db\DbIdGenerator.java | 1 |
请完成以下Java代码 | public static HUReservationDocRef ofPickingJobStepId(@NonNull final PickingJobStepId pickingJobStepId) {return HUReservationDocRef.builder().pickingJobStepId(pickingJobStepId).build();}
public static HUReservationDocRef ofDDOrderLineId(@NonNull final DDOrderLineId ddOrderLineId) {return HUReservationDocRef.builder().... | R ddOrderLineId(@NonNull DDOrderLineId ddOrderLineId);
}
public <R> R map(@NonNull final CaseMappingFunction<R> mappingFunction)
{
if (salesOrderLineId != null)
{
return mappingFunction.salesOrderLineId(salesOrderLineId);
}
else if (projectId != null)
{
return mappingFunction.projectId(projectId);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\reservation\HUReservationDocRef.java | 1 |
请完成以下Java代码 | void stop() {
this.webServer.stop();
}
WebServer getWebServer() {
return this.webServer;
}
HttpHandler getHandler() {
return this.handler;
}
/**
* A delayed {@link HttpHandler} that doesn't initialize things too early.
*/
static final class DelayedInitializationHttpHandler implements HttpHandler {
... | /**
* {@link HttpHandler} that initializes its delegate on first request.
*/
private static final class LazyHttpHandler implements HttpHandler {
private final Mono<HttpHandler> delegate;
private LazyHttpHandler(Supplier<HttpHandler> handlerSupplier) {
this.delegate = Mono.fromSupplier(handlerSupplier);
... | repos\spring-boot-4.0.1\module\spring-boot-web-server\src\main\java\org\springframework\boot\web\server\reactive\context\WebServerManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Owner extends Person {
@Column
@NotBlank
private String address;
@Column
@NotBlank
private String city;
@Column
@NotBlank
@Pattern(regexp = "\\d{10}", message = "{telephone.invalid}")
private String telephone;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name =... | Integer compId = pet.getId();
if (Objects.equals(compId, id)) {
return pet;
}
}
}
return null;
}
/**
* Return the Pet with the given name, or null if none found for this Owner.
* @param name to test
* @param ignoreNew whether to ignore new pets (pets that are not saved yet)
* @return the ... | repos\spring-petclinic-main\src\main\java\org\springframework\samples\petclinic\owner\Owner.java | 2 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getCardNumber() {
return cardNumber;
}
pu... | public String getWebsite() {
return website;
}
public void setWebsite(String website) {
this.website = website;
}
public File getMainDirectory() {
return mainDirectory;
}
public void setMainDirectory(File mainDirectory) {
this.mainDirectory = mainDirectory;
... | repos\tutorials-master\apache-libraries-2\src\main\java\com\baeldung\apache\bval\model\User.java | 1 |
请完成以下Java代码 | private void writeService(IndentingWriter writer, ComposeService service) {
writer.indented(() -> {
writer.println(service.getName() + ":");
writer.indented(() -> {
writer.println("image: '%s:%s'".formatted(service.getImage(), service.getImageTag()));
writerServiceEnvironment(writer, service.getEnvironm... | private void writeServiceCommand(IndentingWriter writer, String command) {
if (!StringUtils.hasText(command)) {
return;
}
writer.println("command: '%s'".formatted(command));
}
private void writerServiceLabels(IndentingWriter writer, Map<String, String> labels) {
if (labels.isEmpty()) {
return;
}
wr... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\container\docker\compose\ComposeFileWriter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ImmutableList<MatchInv> deleteAndReturn(@NonNull final MatchInvQuery query)
{
final ImmutableList<I_M_MatchInv> records = toSqlQuery(query).list();
if (records.isEmpty())
{
return ImmutableList.of();
}
final ImmutableList<MatchInv> matchInvs = records.stream().map(MatchInvoiceRepository::fromRecor... | {
sqlQueryBuilder.addEqualsFilter(I_M_MatchInv.COLUMNNAME_M_InOut_Cost_ID, query.getInoutCostId());
}
if (query.getAsiId() != null)
{
sqlQueryBuilder.addEqualsFilter(I_M_MatchInv.COLUMNNAME_M_AttributeSetInstance_ID, query.getAsiId());
}
return sqlQueryBuilder;
}
public Set<MatchInvId> getIdsProcess... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\matchinv\service\MatchInvoiceRepository.java | 2 |
请完成以下Java代码 | public boolean equalsByMatchCriteria(@NonNull final PricingConditionsBreak reference)
{
if (this == reference)
{
return true;
}
return Objects.equals(matchCriteria, reference.matchCriteria);
}
public boolean isTemporaryPricingConditionsBreak()
{
return hasChanges || id == null;
}
public PricingCon... | return toBuilder().id(null).build();
}
public PricingConditionsBreak toTemporaryPricingConditionsBreakIfPriceRelevantFieldsChanged(@NonNull final PricingConditionsBreak reference)
{
if (isTemporaryPricingConditionsBreak())
{
return this;
}
if (equalsByPriceRelevantFields(reference))
{
return this;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\conditions\PricingConditionsBreak.java | 1 |
请完成以下Java代码 | public int getNoProductCount ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_NoProductCount);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Number of runs.
@param NumberOfRuns
Frequency of processing Perpetual Inventory
*/
public void setNumberOfRuns (int NumberOfRuns)
{
set_Value... | }
/** Get Process Now.
@return Process Now */
public boolean isProcessing ()
{
Object oo = get_Value(COLUMNNAME_Processing);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PerpetualInv.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void process(final Exchange exchange)
{
final JsonExternalSystemRequest request = exchange.getIn().getBody(JsonExternalSystemRequest.class);
final String remoteUrl = request.getParameters().get(ExternalSystemConstants.PARAM_EXTERNAL_SYSTEM_HTTP_URL);
if (Check.isBlank(remoteUrl))
{
throw new Runtim... | final String bPartnerIdentifier = request.getParameters().get(ExternalSystemConstants.PARAM_BPARTNER_ID);
if (Check.isBlank(bPartnerIdentifier))
{
throw new RuntimeException("Missing mandatory param: " + ExternalSystemConstants.PARAM_BPARTNER_ID);
}
final JsonMetasfreshId externalSystemConfigId = request.g... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-rabbitmq\src\main\java\de\metas\camel\externalsystems\rabbitmq\bpartner\processor\ExportBPartnerProcessor.java | 2 |
请完成以下Java代码 | public int hashCode() {
return Objects.hash(this.text);
}
@Override
public String toString() {
return this.text;
}
/**
* Load {@link PemContent} from the given content (either the PEM content itself or a
* reference to the resource to load).
* @param content the content to load
* @param resourceLoade... | * @return the loaded PEM content
* @throws IOException on IO error
*/
public static PemContent load(InputStream in) throws IOException {
return of(StreamUtils.copyToString(in, StandardCharsets.UTF_8));
}
/**
* Return a new {@link PemContent} instance containing the given text.
* @param text the text conta... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\ssl\pem\PemContent.java | 1 |
请在Spring Boot框架中完成以下Java代码 | default boolean isMember(ObservationHandler<?> handler) {
return handlerType().isInstance(handler);
}
/**
* Register group members against the given {@link ObservationConfig}.
* @param config the config used to register members
* @param members the group members to register
*/
default void registerMembers... | Class<?> handlerType();
/**
* Static factory method to create an {@link ObservationHandlerGroup} with members of
* the given handler type.
* @param <H> the handler type
* @param handlerType the handler type
* @return a new {@link ObservationHandlerGroup}
*/
static <H extends ObservationHandler<?>> Observ... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-observation\src\main\java\org\springframework\boot\micrometer\observation\autoconfigure\ObservationHandlerGroup.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class FooController {
@Autowired
private FooDao fooDao;
@GetMapping(value = "/{id}")
public Foo findById(@PathVariable("id") final Long id, final HttpServletResponse response) {
return fooDao.findById(id).orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));
}
// Note: the global filte... | @ResponseStatus(HttpStatus.CREATED)
public Foo create(@RequestBody final Foo resource, final HttpServletResponse response) {
return fooDao.save(resource);
}
@PutMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
public void update(@PathVariable("id") final Long id, @RequestBody final Foo resource) {
fooD... | repos\tutorials-master\spring-boot-modules\spring-boot-mvc-3\src\main\java\com\baeldung\etag\FooController.java | 2 |
请完成以下Java代码 | public class RoleVO extends Role implements INode<RoleVO> {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 父节点ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long parentId;
/**
* 子孙节点
*... | @JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<RoleVO> children;
@Override
public List<RoleVO> getChildren() {
if (this.children == null) {
this.children = new ArrayList<>();
}
return this.children;
}
/**
* 上级角色
*/
private String parentName;
} | repos\SpringBlade-master\blade-service-api\blade-system-api\src\main\java\org\springblade\system\vo\RoleVO.java | 1 |
请完成以下Java代码 | public void setAdditionalText(final @Nullable String AdditionalText)
{
set_Value(COLUMNNAME_AdditionalText, AdditionalText);
}
@Override
public @NotNull String getAdditionalText()
{
return get_ValueAsString(COLUMNNAME_AdditionalText);
}
@Override
public I_C_BPartner_DocType getC_BPartner_DocType()
{
re... | {
if (C_BPartner_Report_Text_ID < 1)
set_ValueNoCheck(COLUMNNAME_C_BPartner_Report_Text_ID, null);
else
set_ValueNoCheck(COLUMNNAME_C_BPartner_Report_Text_ID, C_BPartner_Report_Text_ID);
}
@Override
public int getC_BPartner_Report_Text_ID()
{
return get_ValueAsInt(COLUMNNAME_C_BPartner_Report_Text_ID);... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\partnerreporttext\model\X_C_BPartner_Report_Text.java | 1 |
请完成以下Java代码 | public class PDFMerge {
public void mergeUsingPDFBox(List<String> pdfFiles, String outputFile) throws IOException {
PDFMergerUtility pdfMergerUtility = new PDFMergerUtility();
pdfMergerUtility.setDestinationFileName(outputFile);
pdfFiles.forEach(file -> {
try {
... | PdfImportedPage pdfImportedPage;
for (PdfReader pdfReader : pdfReaders) {
int currentPdfReaderPage = 1;
while (currentPdfReaderPage <= pdfReader.getNumberOfPages()) {
document.newPage();
pdfImportedPage = writer.getImportedPage(pdfReader, currentPdfReaderP... | repos\tutorials-master\text-processing-libraries-modules\pdf-2\src\main\java\com\baeldung\pdfmerge\PDFMerge.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class HelloResource {
//
@ApiOperation(value = "return Hello world")
@ApiResponses(
value = {
@ApiResponse(code =100, message = "100 is the message"),
@ApiResponse(code = 200, message = "Successful Hello world")
}
)
@GetMapping
... | @ApiOperation(value = "Return Hello World")
@PostMapping("/post")
public String helloPost(@RequestBody final String hello){
return hello;
}
@ApiOperation(value = "Return Hello World")
@PutMapping("/put")
public String helloPut(@RequestBody final String hello) {
return hello;
... | repos\SpringBoot-Projects-FullStack-master\Part-4 Spring Boot REST API\SpringSwaggerProjectAgain\src\main\java\spring\swagger\resource\HelloResource.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class JavaProjectGenerationConfiguration {
private final ProjectDescription description;
public JavaProjectGenerationConfiguration(ProjectDescription description) {
this.description = description;
}
@Bean
JavaSourceCodeWriter javaSourceCodeWriter(IndentingWriterFactory indentingWriterFactory) {
retur... | ObjectProvider<MainSourceCodeCustomizer<?, ?, ?>> mainSourceCodeCustomizers,
JavaSourceCodeWriter javaSourceCodeWriter) {
return new MainSourceCodeProjectContributor<>(this.description, JavaSourceCode::new, javaSourceCodeWriter,
mainApplicationTypeCustomizers, mainCompilationUnitCustomizers, mainSourceCodeCust... | repos\initializr-main\initializr-generator-spring\src\main\java\io\spring\initializr\generator\spring\code\java\JavaProjectGenerationConfiguration.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.