instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public Integer getCount() {
return this.query().getSize();
}
public Integer getPageNumber() {
return this.query().getNumber();
}
public Long getTotal() {
return this.query().getTotalElements();
}
public Object getContent() {
return this.query().getContent();
... | Types typeInstance;
if (sex.length() == 0 && email.length() == 0) {
typeInstance = new AllType(sex, email, pageable);
} else if (sex.length() > 0 && email.length() > 0) {
typeInstance = new SexEmailType(sex, email, pageable);
} else {
typeInstance = new S... | repos\SpringBoot-vue-master\src\main\java\com\boylegu\springboot_vue\controller\pagination\PaginationFormatting.java | 2 |
请完成以下Java代码 | static void handleCarExceptionWithUnnamedVariables(Car<?> car) {
try {
someOperationThatFails(car);
} catch (IllegalStateException | NumberFormatException _) {
System.out.println("Got an illegal state exception for: " + car.name());
} catch (RuntimeException _) {
... | // Some update logic
System.out.println("Car updated!");
}
static Map<String, List<Car<?>>> getCarsByFirstLetterWithNamedVariables(List<Car<?>> cars) {
Map<String, List<Car<?>>> carMap = new HashMap<>();
cars.forEach(car ->
carMap.computeIfAbsent(car.name().substring(0, 1), ... | repos\tutorials-master\core-java-modules\core-java-21\src\main\java\com\baeldung\unnamed\variables\UnnamedVariables.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DeleteProcessDefinitionsBuilderImpl cascade() {
this.cascade = true;
return this;
}
@Override
public DeleteProcessDefinitionsBuilderImpl skipCustomListeners() {
this.skipCustomListeners = true;
return this;
}
@Override
public DeleteProcessDefinitionsBuilderImpl skipIoMappings() {
... | ensureOnlyOneNotNull(NullValueException.class, "'processDefinitionKey' or 'processDefinitionIds' cannot be null", processDefinitionKey, processDefinitionIds);
Command<Void> command;
if (processDefinitionKey != null) {
command = new DeleteProcessDefinitionsByKeyCmd(processDefinitionKey, cascade, skipCusto... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\repository\DeleteProcessDefinitionsBuilderImpl.java | 2 |
请完成以下Java代码 | public void setC_BPartner_Location_Value_ID(final int C_BPartner_Location_Value_ID)
{
delegate.setC_BPartner_Location_Value_ID(C_BPartner_Location_Value_ID);
}
@Override
public int getAD_User_ID()
{
return delegate.getAD_User_ID();
}
@Override
public void setAD_User_ID(final int AD_User_ID)
{
delegate.... | public void setFromOrderHeader(@NonNull final I_C_Order order)
{
final boolean useDropshiplocation = order.isDropShip() && order.isSOTrx();
final DocumentLocation orderLocation = useDropshiplocation
? OrderDocumentLocationAdapterFactory.deliveryLocationAdapter(order).toDocumentLocation()
: OrderDocument... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\location\adapter\OrderLineMainLocationAdapter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DmnDeploymentBuilder disableSchemaValidation() {
this.isDmn20XsdValidationEnabled = false;
return this;
}
@Override
public DmnDeploymentBuilder tenantId(String tenantId) {
deployment.setTenantId(tenantId);
return this;
}
@Override
public DmnDeploymentBuil... | @Override
public DmnDeployment deploy() {
return repositoryService.deploy(this);
}
// getters and setters
// //////////////////////////////////////////////////////
public DmnDeploymentEntity getDeployment() {
return deployment;
}
public boolean isDmnXsdValidationEnabled() ... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\repository\DmnDeploymentBuilderImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Map<String, String> getProperties() {
return this.properties;
}
public void setProperties(Map<String, String> properties) {
this.properties = properties;
}
}
static class DataSourceBeanCreationException extends BeanCreationException {
private final DataSourceProperties properties;
private ... | super(message);
this.properties = properties;
this.connection = connection;
}
DataSourceProperties getProperties() {
return this.properties;
}
EmbeddedDatabaseConnection getConnection() {
return this.connection;
}
}
} | repos\spring-boot-4.0.1\module\spring-boot-jdbc\src\main\java\org\springframework\boot\jdbc\autoconfigure\DataSourceProperties.java | 2 |
请完成以下Java代码 | public void setProducts (final @Nullable java.lang.String Products)
{
throw new IllegalArgumentException ("Products is virtual column"); }
@Override
public java.lang.String getProducts()
{
return get_ValueAsString(COLUMNNAME_Products);
}
@Override
public void setQty (final @Nullable BigDecimal Qty)
{
s... | @Override
public void setVHU(final de.metas.handlingunits.model.I_M_HU VHU)
{
set_ValueFromPO(COLUMNNAME_VHU_ID, de.metas.handlingunits.model.I_M_HU.class, VHU);
}
@Override
public void setVHU_ID (final int VHU_ID)
{
if (VHU_ID < 1)
set_Value (COLUMNNAME_VHU_ID, null);
else
set_Value (COLUMNNAME_VH... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Assignment.java | 1 |
请完成以下Java代码 | public List<OrderCost> getByIds(@NonNull final Collection<OrderCostId> orderCostIds)
{
return newSession().getByIds(orderCostIds);
}
public void saveAll(final Collection<OrderCost> orderCostsList)
{
newSession().saveAll(orderCostsList);
}
public void save(final OrderCost orderCost)
{
newSession().save(or... | }
public void deleteByCreatedOrderLineId(@NonNull final OrderAndLineId createdOrderLineId)
{
final I_C_Order_Cost orderCostRecord = queryBL.createQueryBuilder(I_C_Order_Cost.class)
.addEqualsFilter(I_C_Order_Cost.COLUMNNAME_C_Order_ID, createdOrderLineId.getOrderId())
.addEqualsFilter(I_C_Order_Cost.COLUMN... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\costs\OrderCostRepository.java | 1 |
请完成以下Java代码 | public List<IDunnableSource> getSources(IDunningContext context)
{
final List<IDunnableSource> result = new ArrayList<IDunnableSource>();
result.addAll(dunnableSources.values());
return result;
}
private IDunnableSource createSource(Class<? extends IDunnableSource> sourceClass)
{
final IDunnableSource sour... | {
if (dunnableSources.containsKey(clazz))
{
return;
}
final IDunnableSource source = createSource(clazz);
dunnableSources.put(clazz, source);
}
@Override
public String toString()
{
return "DefaultDunnableSourceFactory [dunnableSources=" + dunnableSources + "]";
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\api\impl\DefaultDunnableSourceFactory.java | 1 |
请完成以下Java代码 | public static DmnEngine getDmnEngine(String dmnEngineName) {
if (!isInitialized()) {
init();
}
return dmnEngines.get(dmnEngineName);
}
/**
* retries to initialize a dmn engine that previously failed.
*/
public static EngineInfo retry(String resourceUrl) {
... | for (String dmnEngineName : engines.keySet()) {
DmnEngine dmnEngine = engines.get(dmnEngineName);
try {
dmnEngine.close();
} catch (Exception e) {
LOGGER.error("exception while closing {}", (dmnEngineName == null ? "the default dmn ... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\DmnEngines.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = ... | }
public Date getDepartureDate() {
return departureDate;
}
public void setDepartureDate(Date departureDate) {
this.departureDate = departureDate;
}
public Date getArrivalDate() {
return arrivalDate;
}
public void setArrivalDate(Date arrivalDate) {
this.arr... | repos\tutorials-master\spring-cloud-modules\spring-cloud-kubernetes\kubernetes-guide\travel-agency-service\src\main\java\com\baeldung\spring\cloud\kubernetes\travelagency\model\TravelDeal.java | 2 |
请在Spring Boot框架中完成以下Java代码 | private VersionedEntityInfo getVersionedEntityInfo(TransportProtos.VersionedEntityInfoProto proto) {
return new VersionedEntityInfo(EntityIdFactory.getByTypeAndUuid(proto.getEntityType(), new UUID(proto.getEntityIdMSB(), proto.getEntityIdLSB())));
}
private BranchInfo getBranchInfo(TransportProtos.Bran... | }
private ToVersionControlServiceMsg.Builder newRequestProto(PendingGitRequest<?> request, RepositorySettings settings) {
var tenantId = request.getTenantId();
var requestId = request.getRequestId();
var builder = ToVersionControlServiceMsg.newBuilder()
.setNodeId(serviceInf... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\sync\vc\DefaultGitVersionControlQueueService.java | 2 |
请完成以下Java代码 | public PageData<MobileAppBundleInfo> findInfosByTenantId(TenantId tenantId, PageLink pageLink) {
return DaoUtil.toPageData(mobileAppBundleRepository.findInfoByTenantId(tenantId.getId(), pageLink.getTextSearch(), DaoUtil.toPageable(pageLink)));
}
@Override
public MobileAppBundleInfo findInfoById(Ten... | mobileOauth2ProviderRepository.deleteById(new MobileAppOauth2ClientCompositeKey(mobileAppBundleOauth2Client.getMobileAppBundleId().getId(),
mobileAppBundleOauth2Client.getOAuth2ClientId().getId()));
}
@Override
public MobileAppBundle findByPkgNameAndPlatform(TenantId tenantId, String pkgNam... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\mobile\JpaMobileAppBundleDao.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OrdersController {
private final OrdersService orders;
@PostMapping("/orders/sell")
public ResponseEntity<Order> postSellOrder(String symbol, BigDecimal quantity, BigDecimal price) {
log.info("postSellOrder: symbol={},quantity={},price={}", symbol,quantity,price);
Order or... | return ResponseEntity.status(HttpStatus.CREATED).body(order);
}
@GetMapping("/orders/{id}")
public ResponseEntity<Order> getOrderById(@PathVariable Long id) {
Optional<Order> o = orders.findById(id);
if (!o.isPresent()) {
return ResponseEntity.notFound().build();
... | repos\tutorials-master\messaging-modules\postgres-notify\src\main\java\com\baeldung\messaging\postgresql\controller\OrdersController.java | 2 |
请完成以下Java代码 | public class FilterExample implements Predicate {
private Pattern pattern;
public FilterExample(String regexQuery) {
if (regexQuery != null && !regexQuery.isEmpty()) {
pattern = Pattern.compile(regexQuery);
}
}
public boolean evaluate(RowSet rs) {
try {
... | return false;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public boolean evaluate(Object value, int column) throws SQLException {
throw new UnsupportedOperationException("This operation is unsupported.");
}
public boolean evaluate(Ob... | repos\tutorials-master\persistence-modules\jdbc\src\main\java\com\baeldung\jdbcrowset\FilterExample.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setM_Product_Proxy_ID (final int M_Product_Proxy_ID)
{
if (M_Product_Proxy_ID < 1)
set_Value (COLUMNNAME_M_Product_Proxy_ID, null);
else
set_Value (COLUM... | public int getM_ProductGroup_ID()
{
return get_ValueAsInt(COLUMNNAME_M_ProductGroup_ID);
}
@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.swat\de.metas.swat.base\src\main\java-gen\de\metas\invoicecandidate\model\X_M_ProductGroup.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class RedisConfig {
@Autowired
RedisConnectionFactory factory;
@Bean
public ReactiveRedisTemplate<String, Employee> reactiveRedisTemplate(ReactiveRedisConnectionFactory factory) {
Jackson2JsonRedisSerializer<Employee> serializer = new Jackson2JsonRedisSerializer<>(Employee.class);
... | return reactiveRedisConnectionFactory.getReactiveConnection()
.keyCommands();
}
@Bean
public ReactiveStringCommands stringCommands(final ReactiveRedisConnectionFactory reactiveRedisConnectionFactory) {
return reactiveRedisConnectionFactory.getReactiveConnection()
.stringComm... | repos\tutorials-master\persistence-modules\spring-data-redis\src\main\java\com\baeldung\spring\data\reactive\redis\config\RedisConfig.java | 2 |
请完成以下Java代码 | public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setElapsedTimeMS (final BigDecimal ElapsedTimeMS)
{
set_Value (COLUMNNAME_ElapsedTimeMS, ElapsedTimeMS);
}
@Override
public BigDecimal getElapsedTimeMS()
{
final BigDecimal bd = get_Va... | if (Record_ID < 0)
set_Value (COLUMNNAME_Record_ID, null);
else
set_Value (COLUMNNAME_Record_ID, Record_ID);
}
@Override
public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public void setTextMsg (final java.lang.String TextMsg)
{
set_Value (COLUMNNAME_TextMsg, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_EventAudit.java | 1 |
请完成以下Java代码 | public void setDiscountDate (final @Nullable java.sql.Timestamp DiscountDate)
{
set_Value (COLUMNNAME_DiscountDate, DiscountDate);
}
@Override
public java.sql.Timestamp getDiscountDate()
{
return get_ValueAsTimestamp(COLUMNNAME_DiscountDate);
}
@Override
public void setDiscountDays (final int DiscountDay... | @Override
public int getEDI_cctop_invoic_v_ID()
{
return get_ValueAsInt(COLUMNNAME_EDI_cctop_invoic_v_ID);
}
@Override
public void setName (final @Nullable java.lang.String Name)
{
set_ValueNoCheck (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLU... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java-gen\de\metas\esb\edi\model\X_EDI_cctop_140_v.java | 1 |
请完成以下Java代码 | public MatchResult matcher(HttpServletRequest request) {
for (RequestMatcher matcher : this.requestMatchers) {
MatchResult result = matcher.matcher(request);
if (result.isMatch()) {
return result;
}
}
return MatchResult.notMatch();
}
@Override
public boolean equals(Object o) {
if (this == o) {
... | OrRequestMatcher that = (OrRequestMatcher) o;
return Objects.equals(this.requestMatchers, that.requestMatchers);
}
@Override
public int hashCode() {
return Objects.hash(this.requestMatchers);
}
@Override
public String toString() {
return "Or " + this.requestMatchers;
}
} | repos\spring-security-main\web\src\main\java\org\springframework\security\web\util\matcher\OrRequestMatcher.java | 1 |
请完成以下Java代码 | public class UmsMemberRuleSetting implements Serializable {
private Long id;
@ApiModelProperty(value = "连续签到天数")
private Integer continueSignDay;
@ApiModelProperty(value = "连续签到赠送数量")
private Integer continueSignPoint;
@ApiModelProperty(value = "每消费多少元获取1个点")
private BigDecimal consumePer... | public void setMaxPointPerOrder(Integer maxPointPerOrder) {
this.maxPointPerOrder = maxPointPerOrder;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
@Override
public String toString() {
StringBuilder sb =... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\UmsMemberRuleSetting.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public InsuranceContractQuantity archived(Boolean archived) {
this.archived = archived;
return this;
}
/**
* Maximalmenge nicht mehr gültig - archiviert
* @return archived
**/
@Schema(example = "false", description = "Maximalmenge nicht mehr gültig - archiviert")
public Boolean isArchived() {
... | sb.append(" pcn: ").append(toIndentedString(pcn)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" unit: ").append(toIndentedString(unit)).append("\n");
sb.append(" archived: ").append(toIndentedString(archived)).append("\n");
sb.append("}")... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\model\InsuranceContractQuantity.java | 2 |
请完成以下Java代码 | private I_M_ProductPrice buildNewProductPriceRecord(@NonNull final CreateProductPriceRequest request)
{
final I_M_ProductPrice record = InterfaceWrapperHelper.newInstance(I_M_ProductPrice.class);
record.setAD_Org_ID(request.getOrgId().getRepoId());
record.setM_Product_ID(request.getProductId().getRepoId());
r... | record.setIsActive(request.getIsActive());
return record;
}
@NonNull
private I_M_ProductPrice getRecordById(@NonNull final ProductPriceId productPriceId)
{
return queryBL
.createQueryBuilder(I_M_ProductPrice.class)
.addEqualsFilter(I_M_ProductPrice.COLUMNNAME_M_ProductPrice_ID, productPriceId.getRepoI... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\productprice\ProductPriceRepository.java | 1 |
请完成以下Java代码 | private void updatePricing(final I_PMM_PurchaseCandidate candidate)
{
try
{
final IPMMPricingAware pricingAware = pmmPurchaseCandidateBL.asPMMPricingAware(candidate);
pmmPricingBL.updatePricing(pricingAware);
InterfaceWrapperHelper.save(candidate);
countProcessed++;
}
catch (final Exception e)... | .acquire();
//
// Retrieve candidates
return queryBL.createQueryBuilder(I_PMM_PurchaseCandidate.class, getCtx(), ITrx.TRXNAME_ThreadInherited)
.filter(lockManager.getLockedByFilter(I_PMM_PurchaseCandidate.class, _lock))
//
.orderBy()
.addColumn(I_PMM_PurchaseCandidate.COLUMN_PMM_PurchaseCandidate... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\process\PMM_Purchase_Candidate_UpdatePricing.java | 1 |
请完成以下Java代码 | public Incoterms getById(@NotNull final IncotermsId id)
{
return getIncotermsMap().getById(id);
}
@NotNull
public Incoterms getByValue(@NotNull final String value, @NotNull final OrgId orgId)
{
return getIncotermsMap().getByValue(value, orgId);
}
@NonNull
private IncotermsMap getIncotermsMap()
{
return... | }
@Nullable
public Incoterms getDefaultByOrgId(@NonNull final OrgId orgId)
{
return CoalesceUtil.coalesce(defaultByOrgId.get(orgId), defaultByOrgId.get(OrgId.ANY));
}
@NonNull Incoterms getByValue(@NonNull final String value, @NonNull final OrgId orgId)
{
final Incoterms incoterms = CoalesceUtil.coa... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\incoterms\IncotermsRepository.java | 1 |
请完成以下Java代码 | public String getCreateUserId() {
return createUserId;
}
public Date getStartTime() {
return startTime;
}
public Date getEndTime() {
return endTime;
}
public Date getRemovalTime() {
return removalTime;
}
public Date getExecutionStartTime() {
return executionStartTime;
}
publ... | }
public static HistoricBatchDto fromBatch(HistoricBatch historicBatch) {
HistoricBatchDto dto = new HistoricBatchDto();
dto.id = historicBatch.getId();
dto.type = historicBatch.getType();
dto.totalJobs = historicBatch.getTotalJobs();
dto.batchJobsPerSeed = historicBatch.getBatchJobsPerSeed();
... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\batch\HistoricBatchDto.java | 1 |
请完成以下Java代码 | public int hashCode() {
int result = (this.parentAcl != null) ? this.parentAcl.hashCode() : 0;
result = 31 * result + this.aclAuthorizationStrategy.hashCode();
result = 31 * result
+ ((this.permissionGrantingStrategy != null) ? this.permissionGrantingStrategy.hashCode() : 0);
result = 31 * result + ((this.a... | }
sb.append(ace).append("\n");
}
if (count == 0) {
sb.append("no ACEs; ");
}
sb.append("inheriting: ").append(this.entriesInheriting).append("; ");
sb.append("parent: ").append((this.parentAcl == null) ? "Null" : this.parentAcl.getObjectIdentity().toString());
sb.append("; ");
sb.append("aclAuthoriz... | repos\spring-security-main\acl\src\main\java\org\springframework\security\acls\domain\AclImpl.java | 1 |
请完成以下Java代码 | protected void dispatchExecutionTimeOut(Job job, ExecutionEntity execution, CommandContext commandContext) {
// subprocesses
for (ExecutionEntity subExecution : execution.getExecutions()) {
dispatchExecutionTimeOut(job, subExecution, commandContext);
}
// call activities
... | }
}
protected void dispatchActivityTimeOut(Job job, ActivityImpl activity, ExecutionEntity execution, CommandContext commandContext) {
commandContext.getEventDispatcher().dispatchEvent(
ActivitiEventBuilder.createActivityCancelledEvent(activity.getId(),
(String) ... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\jobexecutor\TimerExecuteNestedActivityJobHandler.java | 1 |
请完成以下Java代码 | public void setM_InOut_ID (int M_InOut_ID)
{
if (M_InOut_ID < 1)
set_Value (COLUMNNAME_M_InOut_ID, null);
else
set_Value (COLUMNNAME_M_InOut_ID, Integer.valueOf(M_InOut_ID));
}
/** Get Shipment/Receipt.
@return Material Shipment Document
*/
public int getM_InOut_ID ()
{
Integer ii = (Integer)g... | @return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUM... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_LandedCost.java | 1 |
请完成以下Java代码 | public class AlarmUpdateRequest implements AlarmModificationRequest {
@NotNull
@Schema(description = "JSON object with Tenant Id", accessMode = Schema.AccessMode.READ_ONLY)
private TenantId tenantId;
@NotNull
@Schema(description = "JSON object with the alarm Id. " +
"Specify this field ... | @Schema(description = "JSON object with propagation details")
private AlarmPropagationInfo propagation;
private UserId userId;
public static AlarmUpdateRequest fromAlarm(Alarm a) {
return fromAlarm(a, null);
}
public static AlarmUpdateRequest fromAlarm(Alarm a, UserId userId) {
re... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\alarm\AlarmUpdateRequest.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Duration getCloseNotifyFlushTimeout() {
return closeNotifyFlushTimeout;
}
public void setCloseNotifyFlushTimeout(Duration closeNotifyFlushTimeout) {
this.closeNotifyFlushTimeout = closeNotifyFlushTimeout;
}
public Duration getCloseNotifyReadTimeout() {
return closeNotifyReadTimeout;
}
pub... | return this.maxFramePayloadLength;
}
public void setMaxFramePayloadLength(Integer maxFramePayloadLength) {
this.maxFramePayloadLength = maxFramePayloadLength;
}
public boolean isProxyPing() {
return proxyPing;
}
public void setProxyPing(boolean proxyPing) {
this.proxyPing = proxyPing;
}
@Ov... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\config\HttpClientProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class Recipe {
@Id
@Column(name = "cocktail")
private String cocktail;
@Column
private String instructions;
public Recipe() {
}
public Recipe(String cocktail, String instructions) {
this.cocktail = cocktail;
this.instructions = instructions;
}
public St... | public String getInstructions() {
return instructions;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Recipe recipe = (Recipe) o;
return Objects.equals(cockt... | repos\tutorials-master\persistence-modules\java-jpa-2\src\main\java\com\baeldung\jpa\unrelated\entities\Recipe.java | 2 |
请完成以下Java代码 | public int getDropShip_User_ID()
{
return get_ValueAsInt(COLUMNNAME_DropShip_User_ID);
}
@Override
public void setEventDate (final @Nullable java.sql.Timestamp EventDate)
{
set_Value (COLUMNNAME_EventDate, EventDate);
}
@Override
public java.sql.Timestamp getEventDate()
{
return get_ValueAsTimestamp(... | set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqNo()
{
return get_ValueAsInt(COLUMNNAME_SeqNo);
}
/**
* Status AD_Reference_ID=540002
* Reference name: C_SubscriptionProgress Status
*/
public static final int STATUS_AD_Reference_ID=540002;
/** Planned = P */
public static final St... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\model\X_C_SubscriptionProgress.java | 1 |
请完成以下Java代码 | public class AuthorizationDeniedEvent<T> extends AuthorizationEvent implements ResolvableTypeProvider {
/**
* @since 6.4
*/
public AuthorizationDeniedEvent(Supplier<Authentication> authentication, T object, AuthorizationResult result) {
super(authentication, object, result);
}
/**
* Get the object to whic... | public T getObject() {
return (T) getSource();
}
/**
* Get {@link ResolvableType} of this class.
* @return {@link ResolvableType}
* @since 6.5
*/
@Override
public ResolvableType getResolvableType() {
return ResolvableType.forClassWithGenerics(getClass(), ResolvableType.forInstance(getObject()));
}
} | repos\spring-security-main\core\src\main\java\org\springframework\security\authorization\event\AuthorizationDeniedEvent.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ServerFlowConfig setMaxOccupyRatio(Double maxOccupyRatio) {
this.maxOccupyRatio = maxOccupyRatio;
return this;
}
public Integer getIntervalMs() {
return intervalMs;
}
public ServerFlowConfig setIntervalMs(Integer intervalMs) {
this.intervalMs = intervalMs;
... | public Double getMaxAllowedQps() {
return maxAllowedQps;
}
public ServerFlowConfig setMaxAllowedQps(Double maxAllowedQps) {
this.maxAllowedQps = maxAllowedQps;
return this;
}
@Override
public String toString() {
return "ServerFlowConfig{" +
"namespace='"... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\cluster\config\ServerFlowConfig.java | 2 |
请完成以下Java代码 | public void setPP_Order_ID (final int PP_Order_ID)
{
if (PP_Order_ID < 1)
set_Value (COLUMNNAME_PP_Order_ID, null);
else
set_Value (COLUMNNAME_PP_Order_ID, PP_Order_ID);
}
@Override
public int getPP_Order_ID()
{
return get_ValueAsInt(COLUMNNAME_PP_Order_ID);
}
@Override
public void setPP_Order_... | }
@Override
public boolean isProcessed()
{
return get_ValueAsBoolean(COLUMNNAME_Processed);
}
@Override
public void setTargetWeight (final BigDecimal TargetWeight)
{
set_Value (COLUMNNAME_TargetWeight, TargetWeight);
}
@Override
public BigDecimal getTargetWeight()
{
final BigDecimal bd = get_Value... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_Weighting_Run.java | 1 |
请完成以下Java代码 | public final void put(@NonNull final IView view)
{
views.put(view.getViewId(), DataEntryDetailsView.cast(view));
}
@Nullable
@Override
public IView getByIdOrNull(final ViewId viewId)
{
return views.getIfPresent(viewId);
}
@Override
public void closeById(final ViewId viewId, final ViewCloseAction closeAct... | }
@Override
public Stream<IView> streamAllViews()
{
return Stream.empty();
}
@Override
public void invalidateView(final ViewId viewId)
{
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\contract\flatrate\view\DataEntryDedailsViewFactory.java | 1 |
请完成以下Spring Boot application配置 | spring:
application:
name: zipkin-server
datasource:
url: jdbc:mysql://127.0.0.1:3306/zipkin?useUnicode=true&characterEncoding=utf-8
driver-class-name: com.mysql.jdbc.Driver
userna | me: root
password: 123456
server:
port: 9100
zipkin:
storage:
type: mysql | repos\SpringAll-master\43.Spring-Cloud-Sleuth\Zipkin-Server\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public int getAD_Org_ID()
{
return orderLine.getAD_Org_ID();
}
@Override
public boolean isSOTrx()
{
final I_C_Order order = getOrder();
return order.isSOTrx();
}
@Override
public I_C_BPartner getC_BPartner()
{ | final I_C_Order order = getOrder();
return InterfaceWrapperHelper.create(Services.get(IOrderBL.class).getBPartnerOrNull(order), I_C_BPartner.class);
}
private I_C_Order getOrder()
{
final I_C_Order order = orderLine.getC_Order();
if (order == null)
{
throw new AdempiereException("Order not set for" +... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\org\adempiere\mm\attributes\api\impl\OrderLineBPartnerAware.java | 1 |
请完成以下Java代码 | public String getDokumentID() {
return dokumentID;
}
/**
* Sets the value of the dokumentID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDokumentID(String value) {
... | *
*/
public RetourenAnteilTypType getRetourenAnteilTyp() {
return retourenAnteilTyp;
}
/**
* Sets the value of the retourenAnteilTyp property.
*
* @param value
* allowed object is
* {@link RetourenAnteilTypType }
... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.schema.v2\src\main\java-xjc\de\metas\vertical\pharma\vendor\gateway\msv3\schema\v2\RetourenavisAnkuendigungAntwort.java | 1 |
请完成以下Java代码 | public class AuthorId implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private Long authorId;
public AuthorId() {
}
public AuthorId(String name, Long authorId) {
this.name = name;
this.authorId = authorId;
}
pub... | if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AuthorId other = (AuthorId) obj;
if (this.authorId != other.authorId) {
return false;
}
if (!Objects.equals(... | repos\Hibernate-SpringBoot-master\HibernateSpringBootCompositeKeySeqIdClass\src\main\java\com\bookstore\entity\AuthorId.java | 1 |
请完成以下Java代码 | public static void main(String[] args) {
var client = Client.getClient();
List<ChatMessage> history = new ArrayList<>();
history.add(SystemMessage.of(
"You are a helpful travel assistant. Answer in at least 150 words."
));
try (Scanner scanner = new Scanner(System.i... | }
ChatRequest chatRequest = chatRequestBuilder.build();
CompletableFuture<Stream<Chat>> chatStreamFuture =
client.chatCompletions().createStream(chatRequest);
Stream<Chat> chatStream = chatStreamFuture.join();
StringBuilder replyBuil... | repos\tutorials-master\libraries-ai\src\main\java\com\baeldung\simpleopenai\SwitchingToStreamingResponses.java | 1 |
请完成以下Java代码 | default Instant getExpiresAt() {
return this.getClaimAsInstant(IdTokenClaimNames.EXP);
}
/**
* Returns the time at which the ID Token was issued {@code (iat)}.
* @return the time at which the ID Token was issued
*/
default Instant getIssuedAt() {
return this.getClaimAsInstant(IdTokenClaimNames.IAT);
}
... | * @return the Authentication Methods References
*/
default List<String> getAuthenticationMethods() {
return this.getClaimAsStringList(IdTokenClaimNames.AMR);
}
/**
* Returns the Authorized party {@code (azp)} to which the ID Token was issued.
* @return the Authorized party to which the ID Token was issued
... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\oidc\IdTokenClaimAccessor.java | 1 |
请完成以下Java代码 | public void onCountryChanged(final I_C_Campaign_Price record)
{
final CountryId countryId = CountryId.ofRepoIdOrNull(record.getC_Country_ID());
if (countryId == null)
{
return;
}
updateCurrency(record, countryId);
}
private void updateCurrency(final I_C_Campaign_Price record, final CountryId countryId... | final UomId stockUomId = productBL.getStockUOMId(productId);
record.setC_UOM_ID(stockUomId.getRepoId());
updatePricingInfo(record);
}
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE }, ifColumnsChanged = { I_C_Campaign_Price.COLUMNNAME_C_BPartner_ID, I_C_Campaign_Price... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\rules\campaign_price\callout\C_Campaign_Price.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CandidateChangeService
{
private static final Logger logger = LogManager.getLogger(CandidateChangeService.class);
private final ImmutableMap<CandidateType, CandidateHandler> type2handler;
public CandidateChangeService(@NonNull final Collection<CandidateHandler> handlers)
{
type2handler = createMapOf... | final CandidateHandler candidateChangeHandler = type2handler.get(candidate.getType());
if (candidateChangeHandler == null)
{
throw new AdempiereException("The given candidate has an unsupported type")
.appendParametersToMessage()
.setParameter("type", candidate.getType())
.setParameter("candidate"... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-service\src\main\java\de\metas\material\dispo\service\candidatechange\CandidateChangeService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String deleteBook(String id) throws BookNotFoundException {
Long bookId = bookService.deleteById(id);
if (1 == bookId) {
return "Book deleted";
} else {
throw new BookNotFoundException(id);
}
}
@Get("/{id}")
public Book findById(@PathVariable("... | @Get("/published-after")
public Flux<Book> findByYearGreaterThan(@QueryValue(value = "year") int year) {
return bookService.findByYearGreaterThan(year);
}
@Error(exception = ConstraintViolationException.class)
public MutableHttpResponse<String> onSavedFailed(ConstraintViolationException ex) {
... | repos\tutorials-master\microservices-modules\micronaut-reactive\src\main\java\com\baeldung\micronautreactive\controller\BookController.java | 2 |
请完成以下Java代码 | public void setPointsSum_Forecasted (final BigDecimal PointsSum_Forecasted)
{
set_Value (COLUMNNAME_PointsSum_Forecasted, PointsSum_Forecasted);
}
@Override
public BigDecimal getPointsSum_Forecasted()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PointsSum_Forecasted);
return bd != null ? bd : B... | public BigDecimal getPointsSum_Invoiced()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_PointsSum_Invoiced);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setPointsSum_Settled (final BigDecimal PointsSum_Settled)
{
set_Value (COLUMNNAME_PointsSum_Settled, PointsSum_Settled);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_Commission_Share.java | 1 |
请完成以下Java代码 | public String getUOMSymbol()
{
return getUOM().getUOMSymbol();
}
public I_C_UOM getUOM()
{
if (inventoryType.isPhysical())
{
final Quantity qtyBook = getQtyBook();
final Quantity qtyCount = getQtyCount();
Quantity.assertSameUOM(qtyBook, qtyCount);
return qtyBook.getUOM();
}
else if (inventory... | }
public static ImmutableSet<HuId> extractHuIds(@NonNull final Collection<InventoryLineHU> lineHUs)
{
return extractHuIds(lineHUs.stream());
}
static ImmutableSet<HuId> extractHuIds(@NonNull final Stream<InventoryLineHU> lineHUs)
{
return lineHUs
.map(InventoryLineHU::getHuId)
.filter(Objects::nonNul... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inventory\InventoryLineHU.java | 1 |
请完成以下Java代码 | public void setExternallyUpdatedAt (final @Nullable java.sql.Timestamp ExternallyUpdatedAt)
{
set_Value (COLUMNNAME_ExternallyUpdatedAt, ExternallyUpdatedAt);
}
@Override
public java.sql.Timestamp getExternallyUpdatedAt()
{
return get_ValueAsTimestamp(COLUMNNAME_ExternallyUpdatedAt);
}
@Override
public v... | {
set_Value (COLUMNNAME_TimePeriod, TimePeriod);
}
@Override
public BigDecimal getTimePeriod()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_TimePeriod);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setUnit (final @Nullable String Unit)
{
set_Value (COLUMNNAME_Unit, Un... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.healthcare.alberta\src\main\java-gen\de\metas\vertical\healthcare\alberta\model\X_Alberta_OrderedArticleLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private static String genKey(Integer id) {
return "user::" + id;
}
// ========== 使用专属的 ReactiveRedisTemplate 的方式 =========
@Autowired
private ReactiveRedisTemplate<String, UserCacheObject> userRedisTemplate;
/**
* 获得指定用户编号的用户
*
* @param id 用户编号
* @return 用户
*/
... | *
* @param user 用户
* @return 是否成功
*/
@PostMapping("/v2/set")
public Mono<Boolean> setV2(UserCacheObject user) {
String key = genKeyV2(user.getId());
return userRedisTemplate.opsForValue().set(key, user);
}
private static String genKeyV2(Integer id) {
return "user:... | repos\SpringBoot-Labs-master\lab-27\lab-27-webflux-redis\src\main\java\cn\iocoder\springboot\lab27\springwebflux\controller\UserController.java | 2 |
请完成以下Java代码 | private boolean sendEmailNow(UserId toUserId, EMail email)
{
final EMailSentStatus emailSentStatus = email.send();
//
X_AD_UserMail um = new X_AD_UserMail(getCtx(), 0, null);
um.setClientOrg(this);
um.setAD_User_ID(toUserId.getRepoId());
um.setSubject(email.getSubject());
um.setMailText(email.getMessageC... | * @param message nessage
* @return EMail
* @deprecated please use {@link de.metas.email.MailService} instead, and extend it as required.
*/
@Deprecated
public @Nullable EMail createEMail(
final EMailAddress to,
final String subject,
final String message,
final boolean html)
{
try
{
final Mai... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MClient.java | 1 |
请完成以下Java代码 | public String getDefinitionName() {
return eventPayloadDefinition.getName();
}
@Override
public String getDefinitionType() {
return eventPayloadDefinition.getType();
}
@Override
public Object getValue() {
return value;
}
public void setValue(Object value) {
... | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EventPayloadInstanceImpl that = (EventPayloadInstanceImpl) o;
return Objects.equals(eventPayloadDefinitio... | repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\runtime\EventPayloadInstanceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Result<?> getMessages(@RequestParam(value = "conversationId", required = true) String conversationId) {
return chatService.getMessages(conversationId);
}
/**
* 清空消息
*
* @return
* @author chenrui
* @date 2025/2/25 11:42
*/
@IgnoreAuth
@GetMapping(value = "/me... | /**
* 上传文件
* for [QQYUN-12135]AI聊天,上传图片提示非法token
*
* @param request
* @param response
* @return
* @throws Exception
* @author chenrui
* @date 2025/4/25 11:04
*/
@IgnoreAuth
@PostMapping(value = "/upload")
public Result<?> upload(HttpServletRequest request, H... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-module\jeecg-boot-module-airag\src\main\java\org\jeecg\modules\airag\app\controller\AiragChatController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | final Properties additionalProperties() {
final Properties hibernateProperties = new Properties();
if (env.getProperty("hibernate.hbm2ddl.auto") != null) {
hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
}
if (env.getPrope... | }
@Configuration
@Profile("hsqldb")
@PropertySource("classpath:persistence-hsqldb.properties")
class HsqldbConfig {
}
@Configuration
@Profile("derby")
@PropertySource("classpath:persistence-derby.properties")
class DerbyConfig {
}
@Configuration
@Profile("sqlite")
@PropertySource("classpath:persistence-sqlite.proper... | repos\tutorials-master\persistence-modules\spring-data-rest\src\main\java\com\baeldung\books\config\DbConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public IPage<RoleVO> selectRolePage(IPage<RoleVO> page, RoleVO role) {
return page.setRecords(baseMapper.selectRolePage(page, role));
}
@Override
public List<RoleVO> tree(String tenantId) {
String userRole = SecureUtil.getUserRole();
String excludeRole = null;
if (!CollectionUtil.contains(Func.toStrArray(us... | roleIds.forEach(roleId -> dataScopeIds.forEach(scopeId -> {
RoleScope roleScope = new RoleScope();
roleScope.setRoleId(roleId);
roleScope.setScopeId(scopeId);
roleDataScopes.add(roleScope);
}));
// 新增配置
roleScopeService.saveBatch(roleDataScopes);
return true;
}
@Override
public String getRoleId... | repos\SpringBlade-master\blade-service\blade-system\src\main\java\org\springblade\system\service\impl\RoleServiceImpl.java | 2 |
请完成以下Java代码 | public static void main(String[] args) {
if (args.length != 1) {
System.err.println("usage: java " + Builder.class.getName() + " <expression string>");
System.exit(1);
}
PrintWriter out = new PrintWriter(System.out);
Tree tree = null;
try {
tre... | }
@Override
public ELResolver getELResolver() {
return null;
}
};
out.print(">> ");
try {
out.println(tree.getRoot().getValue(new Bindings(null, null), context, null));
} catch (ELExcepti... | repos\Activiti-develop\activiti-core-common\activiti-juel-jakarta\src\main\java\org\activiti\core\el\juel\tree\impl\Builder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void execute()
{
trxManager.runInThreadInheritedTrx(this::execute0);
}
private void execute0()
{
orderPayScheduleService.deleteByOrderId(OrderId.ofRepoId(orderRecord.getC_Order_ID()));
final OrderSchedulingContext context = orderPayScheduleService.extractContext(orderRecord);
if (context == null)
... | final PaymentTermBreak lastTermBreak = termBreaks.get(termBreaks.size() - 1);
// Calculate the exact amount needed for the last line: Grand Total - accumulated total
final Money lastLineDueAmount = context.getGrandTotal().subtract(totalScheduledAmount);
final OrderPayScheduleCreateRequest.Line lastLine = toOrde... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\paymentschedule\service\OrderPayScheduleCreateCommand.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public DistributionJob complete(@NonNull final DistributionJobId jobId, @NonNull final UserId callerId)
{
final DistributionJob job = getJobById(jobId);
job.assertCanEdit(callerId);
return complete(job);
}
public DistributionJob complete(@NonNull final DistributionJob job)
{
// just to make sure there is n... | if (request.getProductScannedCode() != null)
{
productId = productService.getProductIdByScannedProductCode(request.getProductScannedCode());
huService.assetHUContainsProduct(huQRCode, productId);
}
else
{
productId = huService.getSingleProductId(huQRCode);
}
final DistributionJobLineId nextEligibl... | repos\metasfresh-new_dawn_uat\backend\de.metas.distribution.rest-api\src\main\java\de\metas\distribution\mobileui\job\service\DistributionRestService.java | 2 |
请完成以下Java代码 | public void subscribe(final IEventListener listener)
{
delegate().subscribe(listener);
}
@Override
public void subscribe(final Consumer<Event> eventConsumer)
{
delegate().subscribe(eventConsumer);
}
@Override
public <T> IEventListener subscribeOn(final Class<T> type, final Consumer<T> eventConsumer)
{
... | @Override
public void enqueueObject(final Object obj)
{
delegate().enqueueObject(obj);
}
@Override
public void enqueueObjectsCollection(@NonNull final Collection<?> objs)
{
delegate().enqueueObjectsCollection(objs);
}
@Override
public boolean isDestroyed()
{
return delegate().isDestroyed();
}
@Over... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\event\ForwardingEventBus.java | 1 |
请完成以下Java代码 | public int removeAllByCreatedTimeBefore(long ts) {
return notificationRequestRepository.deleteAllByCreatedTimeBefore(ts);
}
@Override
public NotificationRequestInfo findInfoById(TenantId tenantId, NotificationRequestId id) {
NotificationRequestInfoEntity info = notificationRequestRepository... | @Override
protected Class<NotificationRequestEntity> getEntityClass() {
return NotificationRequestEntity.class;
}
@Override
protected JpaRepository<NotificationRequestEntity, UUID> getRepository() {
return notificationRequestRepository;
}
@Override
public EntityType getEnti... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\notification\JpaNotificationRequestDao.java | 1 |
请完成以下Java代码 | public int getC_DocType_Invoicing_Pool_ID()
{
return get_ValueAsInt(COLUMNNAME_C_DocType_Invoicing_Pool_ID);
}
@Override
public void setIsOnDistinctICTypes (final boolean IsOnDistinctICTypes)
{
set_Value (COLUMNNAME_IsOnDistinctICTypes, IsOnDistinctICTypes);
}
@Override
public boolean isOnDistinctICTypes... | }
@Override
public void setNegative_Amt_C_DocType_ID (final int Negative_Amt_C_DocType_ID)
{
if (Negative_Amt_C_DocType_ID < 1)
set_Value (COLUMNNAME_Negative_Amt_C_DocType_ID, null);
else
set_Value (COLUMNNAME_Negative_Amt_C_DocType_ID, Negative_Amt_C_DocType_ID);
}
@Override
public int getNegative... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DocType_Invoicing_Pool.java | 1 |
请完成以下Java代码 | public <T> String debugAccept(final IQueryFilter<T> filter, final T model)
{
final StringBuilder sb = new StringBuilder();
sb.append("\n-------------------------------------------------------------------------------");
sb.append("\nModel: " + model);
final List<IQueryFilter<T>> filters = extractAllFilters(filt... | for (final IQueryFilter<T> f : compositeFilter.getFilters())
{
final List<IQueryFilter<T>> resultLocal = extractAllFilters(f);
result.addAll(resultLocal);
}
}
return result;
}
@Override
public <T> QueryResultPage<T> retrieveNextPage(
@NonNull final Class<T> clazz,
@NonNull final String next... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\QueryBL.java | 1 |
请完成以下Java代码 | public boolean hasNature(Nature nature)
{
return getNatureFrequency(nature) > 0;
}
/**
* 是否有以某个前缀开头的词性
*
* @param prefix 词性前缀,比如u会查询是否有ude, uzhe等等
* @return
*/
public boolean hasNatureStartsWith(String prefix)
{
... | }
}
/**
* 获取词语的ID
*
* @param a 词语
* @return ID, 如果不存在, 则返回-1
*/
public static int getWordID(String a)
{
return CoreDictionary.trie.exactMatchSearch(a);
}
/**
* 热更新核心词典<br>
* 集群环境(或其他IOAdapter)需要自行删除缓存文件
*
* @return 是否成功
*/
public st... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\CoreDictionary.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8081
spring:
application:
name: spring-boot-mvc-client
security:
oauth2:
client:
provider:
baeldung-keycloak:
issuer-uri: http://localhost:8080/realms/baeldung-keycloak
registration:
keycloak:
provider: baeldung-keycloak
... | G
boot: INFO
management:
endpoint:
health:
probes:
enabled: true
endpoints:
web:
exposure:
include: '*'
health:
livenessstate:
enabled: true
readinessstate:
enabled: true | repos\tutorials-master\spring-boot-modules\spring-boot-keycloak\spring-boot-mvc-client\src\main\resources\application.yml | 2 |
请完成以下Java代码 | public class MSalesRegion extends X_C_SalesRegion
{
/**
*
*/
private static final long serialVersionUID = 8582026748675153489L;
/**
* Get SalesRegion from Cache
* @param ctx context
* @param C_SalesRegion_ID id
* @return MSalesRegion
*/
public static MSalesRegion get (Properties ctx, int C_SalesRe... | /**
* After Save.
* Insert
* - create tree
* @param newRecord insert
* @param success save success
* @return success
*/
protected boolean afterSave (boolean newRecord, boolean success)
{
if (!success)
return success;
if (newRecord)
insert_Tree(MTree_Base.TREETYPE_SalesRegion);
// Value/Na... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MSalesRegion.java | 1 |
请完成以下Java代码 | public static String bankCard(String cardNum) {
if (oConvertUtils.isEmpty(cardNum)) {
return "";
}
return formatBetween(cardNum, 6, 4);
}
/**
* [公司开户银行联号] 公司开户银行联行号,显示前两位,其他用星号隐藏,每位1个星号
* @param code 公司开户银行联号
* @return <例子:12********>
*/
public static... | }
/**
* 将左边的格式化成*
* @param str 字符串
* @param reservedLength 保留长度
* @return 格式化后的字符串
*/
public static String formatLeft(String str, int reservedLength){
int len = str.length();
String show = str.substring(len-reservedLength);
String stars = String.join("", Collect... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\desensitization\util\SensitiveInfoUtil.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
@Override
public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
@Override
public String getIp() {
return i... | }
@Override
public Date getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Date getGmtModified() {
return gmtModified;
}
public void setGmtModified(Date gmtModified) {
this.gmtModified =... | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-sentinel\src\main\java\com\alibaba\csp\sentinel\dashboard\rule\nacos\entity\AuthorityRuleCorrectEntity.java | 1 |
请完成以下Java代码 | public class TaskCandidateGroupImpl extends TaskCandidateImpl implements TaskCandidateGroup {
private String groupId;
public TaskCandidateGroupImpl() {}
public TaskCandidateGroupImpl(String groupId, String taskId) {
super(taskId);
this.groupId = groupId;
}
@Override
public St... | if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TaskCandidateGroupImpl that = (TaskCandidateGroupImpl) o;
return Objects.equals(groupId, that.groupId) && Objects.equals(getTaskId(), that.getTaskId());
}
... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-task-model-impl\src\main\java\org\activiti\api\task\model\impl\TaskCandidateGroupImpl.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_AD_BusinessRule getAD_BusinessRule()
{
return get_ValueAsPO(COLUMNNAME_AD_BusinessRule_ID, org.compiere.model.I_AD_BusinessRule.class);
}
@Override
public void setAD_BusinessRule(final org.compiere.model.I_AD_BusinessRule AD_BusinessRule)
{
set_ValueFromPO(COLUMNNAME_AD_BusinessRul... | @Override
public void setLookupSQL (final java.lang.String LookupSQL)
{
set_Value (COLUMNNAME_LookupSQL, LookupSQL);
}
@Override
public java.lang.String getLookupSQL()
{
return get_ValueAsString(COLUMNNAME_LookupSQL);
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, S... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_BusinessRule_WarningTarget.java | 1 |
请完成以下Java代码 | public final class OrgPermission extends AbstractPermission implements Serializable
{
public static OrgPermission ofResourceAndReadOnly(final OrgResource resource, final boolean readOnly)
{
final ImmutableSet.Builder<Access> accesses = ImmutableSet.builder();
// READ access: this is implied if we are here
acce... | public String toString()
{
return resource + ", " + accesses;
}
@Override
public boolean hasAccess(Access access)
{
return accesses.contains(access);
}
public boolean isReadOnly()
{
return hasAccess(Access.READ) && !hasAccess(Access.WRITE);
}
public boolean isReadWrite()
{
return hasAccess(Access.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\OrgPermission.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public SavedRequestAwareAuthenticationSuccessHandler successRedirectHandler() {
SavedRequestAwareAuthenticationSuccessHandler successRedirectHandler = new SavedRequestAwareAuthenticationSuccessHandler();
successRedirectHandler.setDefaultTargetUrl("/home");
return successRedirectHandler;
}
... | return new SAMLLogoutFilter(successLogoutHandler(),
new LogoutHandler[] { logoutHandler() },
new LogoutHandler[] { logoutHandler() });
}
@Bean
public HTTPPostBinding httpPostBinding() {
return new HTTPPostBinding(parserPool(), VelocityFactory.getEngine());
}
@Be... | repos\tutorials-master\spring-security-modules\spring-security-saml\src\main\java\com\baeldung\saml\config\SamlSecurityConfig.java | 2 |
请完成以下Spring Boot application配置 | application.servers[0].ip=127.0.0.1
application.servers[0].path=/path1
application.servers[1].ip=127.0.0.2
application.servers[1].path=/path2
application.servers[2].ip=127.0.0.3
application.servers[2].path=/path3
spring.datasource.url=jdbc:h2:dev
spring.datasource.username=SA
spring.datasource.password=password
app.nam... | activate.on-profile=multidocument-integration-extension
bael.otherProperty=integrationExtensionOtherValue
#---
spring.config.activate.on-profile=multidocument-prod
spring.datasource.password=password
spring.datasource.url=jdbc:h2:prod
spring.datasource.username=prodUser
bael.property=prodValue | repos\tutorials-master\spring-boot-modules\spring-boot-properties-3\src\main\resources\application.properties | 2 |
请完成以下Java代码 | private IAttributeStorage getAttributeStorage(final I_M_HU cuHU)
{
return huContext.getHUAttributeStorageFactory().getAttributeStorage(cuHU);
}
private Quantity getCurrentTURemainingQty()
{
if (capacity.isInfiniteCapacity())
{
return Quantity.infinite(capacity.getC_UOM());
}
Quantity qtyRemaining = c... | }
if (bpartnerId != null)
{
huBuilder.setBPartnerId(bpartnerId);
}
if (bpartnerLocationRepoId > 0)
{
huBuilder.setC_BPartner_Location_ID(bpartnerLocationRepoId);
}
huBuilder.setHUPlanningReceiptOwnerPM(true);
huBuilder.setHUClearanceStatusInfo(clearanceStatusInfo);
return huBuilder;
}
priv... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\TULoaderInstance.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void updateUser(String userId, Set<Contact> contacts, Set<Address> addresses) throws Exception {
User user = UserUtility.recreateUserState(repository, userId);
if (user == null)
throw new Exception("User does not exist.");
user.getContacts()
.stream()
... | .equals(contactType))
.collect(Collectors.toSet());
}
public Set<Address> getAddressByRegion(String userId, String state) throws Exception {
User user = UserUtility.recreateUserState(repository, userId);
if (user == null)
throw new Exception("User does not exist.");
... | repos\tutorials-master\patterns-modules\cqrs-es\src\main\java\com\baeldung\patterns\es\service\UserService.java | 2 |
请完成以下Java代码 | public void setAD_WF_Responsible_ID (final int AD_WF_Responsible_ID)
{
if (AD_WF_Responsible_ID < 1)
set_Value (COLUMNNAME_AD_WF_Responsible_ID, null);
else
set_Value (COLUMNNAME_AD_WF_Responsible_ID, AD_WF_Responsible_ID);
}
@Override
public int getAD_WF_Responsible_ID()
{
return get_ValueAsInt(CO... | return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public void setTextMsg (final java.lang.String TextMsg)
{
set_Value (COLUMNNAME_TextMsg, TextMsg);
}
@Override
public java.lang.String getTextMsg()
{
return get_ValueAsString(COLUMNNAME_TextMsg);
}
@Override
public void setWF_Initial_User_ID (f... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_WF_Process.java | 1 |
请完成以下Java代码 | public class OrdersCollector implements IOrdersCollector
{
public static OrdersCollector newInstance()
{
return new OrdersCollector();
}
private final AtomicInteger countOrders = new AtomicInteger(0);
private static final AdMessageKey MSG_Event_Generated = AdMessageKey.of("Event_ProcurementPurchaseOrderGenerat... | return ImmutableList.builder()
.add(TableRecordReference.of(order))
.add(bpartner.getValue())
.add(bpartner.getName())
.build();
}
public void setDefaultNotificationRecipientId(final UserId defaultNotificationRecipientId)
{
this.defaultNotificationRecipientId = defaultNotificationRecipientId;
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\impl\OrdersCollector.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public JAXBElement<CustomType> createErpelPresentationDetailsExtension(CustomType value) {
return new JAXBElement<CustomType>(_ErpelPresentationDetailsExtension_QNAME, CustomType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link CustomType }{@code >}
*
... | * Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link CustomType }{@code >}
*/
@XmlElementDecl(namespace = "http://erpel.at/schemas/1p0/documents/ext", name = "ErpelSupplierExtension")
public JAXBElement<CustomType> createErp... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\ext\ObjectFactory.java | 2 |
请完成以下Java代码 | public static int getTotalNumberOfLinesUsingNIOFiles(String fileName) {
int lines = 0;
try (Stream<String> fileStream = Files.lines(Paths.get(fileName))) {
lines = (int) fileStream.count();
} catch (IOException ioe) {
ioe.printStackTrace();
}
return lines;... | }
return lines;
}
public static int getTotalNumberOfLinesUsingApacheCommonsIO(String fileName) {
int lines = 0;
try {
LineIterator lineIterator = FileUtils.lineIterator(new File(fileName));
while (lineIterator.hasNext()) {
lineIterator.nextLine();... | repos\tutorials-master\core-java-modules\core-java-nio-3\src\main\java\com\baeldung\lines\NumberOfLineFinder.java | 1 |
请完成以下Java代码 | public void setContent (final @Nullable java.lang.String Content)
{
set_ValueNoCheck (COLUMNNAME_Content, Content);
}
@Override
public java.lang.String getContent()
{
return get_ValueAsString(COLUMNNAME_Content);
}
/**
* Direction AD_Reference_ID=541551
* Reference name: RabbitMQ_Message_Audit_Direct... | {
if (RabbitMQ_Message_Audit_ID < 1)
set_ValueNoCheck (COLUMNNAME_RabbitMQ_Message_Audit_ID, null);
else
set_ValueNoCheck (COLUMNNAME_RabbitMQ_Message_Audit_ID, RabbitMQ_Message_Audit_ID);
}
@Override
public int getRabbitMQ_Message_Audit_ID()
{
return get_ValueAsInt(COLUMNNAME_RabbitMQ_Message_Audit... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_RabbitMQ_Message_Audit.java | 1 |
请完成以下Java代码 | public static boolean saveSentenceList(List<List<IWord>> sentenceList, String path)
{
return IOUtil.saveObjectTo(sentenceList, path);
}
public static List<List<IWord>> convert2SentenceList(String path)
{
List<Document> documentList = CorpusLoader.convert2DocumentList(path);
List... | {
/**
* 这个线程负责处理这些事情
*/
public List<File> fileList;
public HandlerThread(String name)
{
super(name);
}
@Override
public void run()
{
long start = System.currentTimeMillis();
System.out.printf("线程#%s 开... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\document\CorpusLoader.java | 1 |
请完成以下Java代码 | public void handle(ServerWebExchange exchange, Mono<CsrfToken> csrfToken) {
Assert.notNull(exchange, "exchange cannot be null");
Assert.notNull(csrfToken, "csrfToken cannot be null");
Mono<CsrfToken> updatedCsrfToken = csrfToken
.map((token) -> new DefaultCsrfToken(token.getHeaderName(), token.getParameterName... | byte[] tokenBytes = Utf8.encode(token);
byte[] randomBytes = new byte[tokenBytes.length];
secureRandom.nextBytes(randomBytes);
byte[] xoredBytes = xorCsrf(randomBytes, tokenBytes);
byte[] combinedBytes = new byte[tokenBytes.length + randomBytes.length];
System.arraycopy(randomBytes, 0, combinedBytes, 0, rand... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\server\csrf\XorServerCsrfTokenRequestAttributeHandler.java | 1 |
请完成以下Java代码 | protected Properties extractCtxFromItem(final Object item)
{
return InterfaceWrapperHelper.getCtx(item);
}
@Override
protected String extractTrxNameFromItem(final Object item)
{
return InterfaceWrapperHelper.getTrxName(item);
}
@Override
protected Object extractModelToEnqueueFromItem(final Colle... | private final transient IDocumentBL docActionBL = Services.get(IDocumentBL.class);
private final transient ICounterDocBL counterDocumentBL = Services.get(ICounterDocBL.class);
@Override
public Result processWorkPackage(final I_C_Queue_WorkPackage workpackage, final String localTrxName)
{
final List<Object> model... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\document\async\spi\impl\CreateCounterDocPP.java | 1 |
请完成以下Java代码 | public int getExternalSystem_Config_ID()
{
return get_ValueAsInt(COLUMNNAME_ExternalSystem_Config_ID);
}
@Override
public void setExternalSystem_Other_ConfigParameter_ID (final int ExternalSystem_Other_ConfigParameter_ID)
{
if (ExternalSystem_Other_ConfigParameter_ID < 1)
set_ValueNoCheck (COLUMNNAME_Ext... | public String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValue (final @Nullable String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
@Override
public String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Other_ConfigParameter.java | 1 |
请完成以下Java代码 | public String getTableNameOrNull(final DocumentId documentId)
{
return null;
}
@Override
public List<RelatedProcessDescriptor> getAdditionalRelatedProcessDescriptors()
{
return processes;
}
@Override
protected InvoiceRows getRowsData()
{
return InvoiceRows.cast(super.getRowsData());
}
public void ad... | throw new UnsupportedOperationException();
}
public void markPreparedForAllocation(@NonNull final DocumentIdsSelection rowIds)
{
getRowsData().markPreparedForAllocation(rowIds);
invalidateAll();
}
public void unmarkPreparedForAllocation(@NonNull final DocumentIdsSelection rowIds)
{
getRowsData().unmarkPre... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\payment_allocation\InvoicesView.java | 1 |
请完成以下Java代码 | private void createBankStatementLineRef(
@NonNull final PaymentToLink paymentToLink,
@NonNull final I_C_BankStatementLine bankStatementLine,
final int lineNo)
{
final PaymentId paymentId = paymentToLink.getPaymentId();
final I_C_Payment payment = getPaymentById(paymentId);
final BankStatementLineRefere... | if (doReconcilePayments)
{
paymentBL.markReconciledAndSave(
payment,
PaymentReconcileReference.bankStatementLineRef(lineRef.getId()));
}
//
linkedPayments.add(PaymentLinkResult.builder()
.bankStatementId(lineRef.getBankStatementId())
.bankStatementLineId(lineRef.getBankStatementLineId())
... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\impl\BankStatementLineMultiPaymentLinkCommand.java | 1 |
请完成以下Java代码 | public java.lang.String getName ()
{
return (java.lang.String)get_Value(COLUMNNAME_Name);
}
/**
* Type AD_Reference_ID=540047
* Reference name: AD_BoilerPlate_VarType
*/
public static final int TYPE_AD_Reference_ID=540047;
/** SQL = S */
public static final String TYPE_SQL = "S";
/** Rule Engine = R *... | @param Value
Search key for the record in the format required - must be unique
*/
@Override
public void setValue (java.lang.String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
/** Get Search Key.
@return Search key for the record in the format required - must be unique
*/
@Override
public java.l... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\letters\model\X_AD_BoilerPlate_Var.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getRootScopeType() {
return rootScopeType;
}
@Override
public void setRootScopeType(String rootScopeType) {
this.rootScopeType = rootScopeType;
}
@Override
public Date getCreateTime() {
return createTime;
}
@Override | public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String getHierarchyType() {
return hierarchyType;
}
@Override
public void setHierarchyType(String hierarchyType) {
this.hierarchyType = hierarchyType;
}
} | repos\flowable-engine-main\modules\flowable-entitylink-service\src\main\java\org\flowable\entitylink\service\impl\persistence\entity\HistoricEntityLinkEntityImpl.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public DeliveryRecipientType getDeliveryRecipient() {
return deliveryRecipient;
}
/**
* Sets the value of the deliveryRecipient property.
*
* @param value
* allowed object is
* {@link DeliveryRecipientType }
*
*/
public void setDeliveryRecipient(Deli... | * {@link DeliveryDetailsType }
*
*/
public DeliveryDetailsType getDeliveryDetails() {
return deliveryDetails;
}
/**
* Sets the value of the deliveryDetails property.
*
* @param value
* allowed object is
* {@link DeliveryDetailsType }
*
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\DeliveryType.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getServerEventId()
{
return serverEventId;
}
public void setServerEventId(String serverEventId)
{
this.serverEventId = serverEventId;
}
/**
*
* @return the date when this record was created, which is also the date when the sync request was submitted towards the remote endpoint.
*/
@Over... | * @return the date when our local endpoint received the remote endpoint's confirmation.
*/
public Date getDateConfirmReceived()
{
return dateConfirmReceived;
}
public void setDateConfirmReceived(Date dateConfirmReceived)
{
this.dateConfirmReceived = dateConfirmReceived;
}
public long getEntryId()
{
re... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\model\SyncConfirm.java | 2 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Category getCategory() {
return category;
}
public v... | }
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
@Override
public Product clone() throws CloneNotSupportedException {
Product clone = (Product) super.clone();
clone.setId(null);
return clone;
}
... | repos\tutorials-master\persistence-modules\java-jpa-4\src\main\java\com\baeldung\jpa\cloneentity\Product.java | 1 |
请完成以下Java代码 | public String docValidate (PO po, int type)
{
log.info("po.get_TableName() = " + po.get_TableName());
String result = null;
if (expHelper != null) {
try {
if ( type == TIMING_AFTER_COMPLETE
|| type == TIMING_AFTER_CLOSE
|| type == TIMING_AFTER_REVERSECORRECT
|| type == TIMING_AFTER_VO... | log.info("AD_Org_ID =" + m_AD_Org_ID);
log.info("AD_Role_ID =" + m_AD_Role_ID);
log.info("AD_User_ID =" + m_AD_User_ID);
return null;
}
/**
* Get Client to be monitored
* @return AD_Client_ID client
*/
public int getAD_Client_ID()
{
return m_AD_Client_ID;
}
/**
* String Representation
* @... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\model\ExportModelValidator.java | 1 |
请完成以下Java代码 | public class SslUtils {
private static void trustAllHttpsCertificates() throws Exception {
TrustManager[] trustAllCerts = new TrustManager[1];
TrustManager tm = new miTM();
trustAllCerts[0] = tm;
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, nul... | public void checkClientTrusted(X509Certificate[] certs, String authType) throws CertificateException {
}
}
/**
* 忽略HTTPS请求的SSL证书,必须在openConnection之前调用
*/
public static void ignoreSsl() throws Exception {
HostnameVerifier hv = (urlHostName, session) -> true;
trustAllHttpsCe... | repos\kkFileView-master\server\src\main\java\cn\keking\utils\SslUtils.java | 1 |
请完成以下Java代码 | public ILock getExistingLockForOwner(final LockOwner lockOwner)
{
return getLockDatabase().retrieveLockForOwner(lockOwner);
}
@Override
public <T> IQueryFilter<T> getNotLockedFilter(@NonNull String modelTableName, @NonNull String joinColumnNameFQ)
{
return getLockDatabase().getNotLockedFilter(modelTableName, ... | public <T> IQuery<T> addNotLockedClause(final IQuery<T> query)
{
return getLockDatabase().addNotLockedClause(query);
}
@Override
public ExistingLockInfo getLockInfo(final TableRecordReference tableRecordReference, final LockOwner lockOwner)
{
return getLockDatabase().getLockInfo(tableRecordReference, lockOwne... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\lock\api\impl\LockManager.java | 1 |
请完成以下Java代码 | public class CorrelationPropertyBindingImpl extends BaseElementImpl implements CorrelationPropertyBinding {
protected static AttributeReference<CorrelationProperty> correlationPropertyRefAttribute;
protected static ChildElement<DataPath> dataPathChild;
public static void registerType(ModelBuilder modelBuilder) ... | }
public CorrelationPropertyBindingImpl(ModelTypeInstanceContext instanceContext) {
super(instanceContext);
}
public CorrelationProperty getCorrelationProperty() {
return correlationPropertyRefAttribute.getReferenceTargetElement(this);
}
public void setCorrelationProperty(CorrelationProperty correl... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\CorrelationPropertyBindingImpl.java | 1 |
请完成以下Java代码 | public Void execute(CommandContext commandContext) {
reportMetrics(commandContext);
JobEntity jobEntity = commandContext.getJobManager().findJobById(jobId);
boolean rescheduled = false;
if (isRescheduleNow) {
commandContext.getJobManager().reschedule(jobEntity, ClockUtil.getCurrentTime());
... | .getNextBatchWindow(ClockUtil.getCurrentTime(), commandContext.getProcessEngineConfiguration());
if (nextBatchWindow != null) {
commandContext.getJobManager().reschedule(jobEntity, nextBatchWindow.getStart());
} else {
LOG.warnHistoryCleanupBatchWindowNotFound();
suspendJob(jobEntity);
}
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\historycleanup\HistoryCleanupSchedulerCmd.java | 1 |
请完成以下Java代码 | public void deleteDocuments(DocumentIdsSelection documentIds)
{
throw new InvalidDocumentStateException(parentDocument, RESULT_TabSingleRowDetail.getName());
}
@Override
public DocumentValidStatus checkAndGetValidStatus(OnValidStatusChanged onValidStatusChanged)
{
if (singleDocument != null)
{
final Docu... | else if (saveStatus.isDeleted())
{
singleDocument.markAsDeleted();
forgetSingleDocument();
}
}
}
private final void forgetSingleDocument()
{
singleDocument = null;
}
@Override
public void markStaleAll()
{
staled = true;
parentDocument.getChangesCollector().collectStaleDetailId(parentDocum... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\SingleRowDetailIncludedDocumentsCollection.java | 1 |
请完成以下Java代码 | public void createTopic(String topicName) throws Exception {
try (Admin admin = Admin.create(properties)) {
int partitions = 1;
short replicationFactor = 1;
NewTopic newTopic = new NewTopic(topicName, partitions, replicationFactor);
CreateTopicsResult result = ad... | KafkaFuture<Void> future = result.values()
.get(topicName);
future.get();
}
}
public void createCompactedTopicWithCompression(String topicName) throws Exception {
Properties props = new Properties();
props.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "loca... | repos\tutorials-master\apache-kafka-2\src\main\java\com\baeldung\kafka\admin\KafkaTopicApplication.java | 1 |
请完成以下Java代码 | public class TraceInterceptor implements ProducerInterceptor<String, String> {
private int errorCounter = 0;
private int successCounter = 0;
/**
* 最先调用,读取配置信息,只调用一次
*/
@Override
public void configure(Map<String, ?> configs) {
System.out.println(JSON.toJSONString(configs));
}
... | */
@Override
public void onAcknowledgement(RecordMetadata metadata, Exception exception) {
if (Objects.isNull(exception)) {
// TODO 出错了
}
}
/**
* 关闭 interceptor,主要用于执行一些资源清理工作,只调用一次
*/
@Override
public void close() {
System.out.println("==========c... | repos\spring-boot-student-master\spring-boot-student-kafka\src\main\java\com\xiaolyuh\interceptor\TraceInterceptor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class WebSecurityConfig
{
private final TokenAuthProvider tokenAuthProvider;
private final ProducerTemplate producerTemplate;
private final AuthenticationConfiguration authConfig;
public WebSecurityConfig(
@NotNull final TokenAuthProvider tokenAuthProvider,
@NotNull final ProducerTemplate producerTemp... | */
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/**" + RestServiceRoutes.WOO.getPath()).hasAuthority(RestServiceRoutes.WOO.getStringAuthority())
.requestMatchers("/**" + RestServiceRoutes.GRS.getPath()).hasAuthority(RestServiceRoutes.GRS.getS... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\core\src\main\java\de\metas\camel\externalsystems\core\restapi\auth\WebSecurityConfig.java | 2 |
请完成以下Java代码 | public void setScrappedQty (java.math.BigDecimal ScrappedQty)
{
set_Value (COLUMNNAME_ScrappedQty, ScrappedQty);
}
/** Get Verworfene Menge.
@return The Quantity scrapped due to QA issues
*/
@Override
public java.math.BigDecimal getScrappedQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Scrap... | @Override
public java.math.BigDecimal getTargetQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_TargetQty);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Suchschlüssel.
@param Value
Search key for the record in the format required - must be unique
*/
@Override
public void setV... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_MovementLine.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.