instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public void setPhone(String phone) {
this.phone = phone;
}
public String getIdNo() {
return idNo;
}
public void setIdNo(String idNo) {
this.idNo = idNo;
}
public String getBankAccountNo() {
return bankAccountNo;
}
public void setBankAccountNo(String ba... | return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
} | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\vo\AuthParamVo.java | 2 |
请完成以下Java代码 | public static PDFViewerBean getViewer()
{
return new PDFViewerBean();
}
public static boolean isValid(Pageable layout)
{
return true;
}
public static boolean isLicensed()
{
return true;
}
/**
* Converts given image to PDF.
*
* @param image
* @return PDF file as bytes array.
*/
public static... | final com.itextpdf.text.Document document = new com.itextpdf.text.Document(pageSize, 50, 50, 50, 50);
//
// Add image to document
final ByteArrayOutputStream pdfBytes = new ByteArrayOutputStream();
final PdfWriter writer = PdfWriter.getInstance(document, pdfBytes);
writer.open();
document.open();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\adempiere\pdf\Document.java | 1 |
请完成以下Java代码 | private void runOnce(@NonNull final AdSchedulerId adSchedulerId)
{
final String serverId = MScheduler.computeServerID(adSchedulerId);
final AdempiereServerMgr adempiereServerMgr = AdempiereServerMgr.get();
final AdempiereServer server = adempiereServerMgr.getServer(serverId);
if (server == null)
{
throw n... | {
return schedulerDao.getSchedulerByProcessIdIfUnique(request.getSchedulerSearchKey().getAdProcessId())
.orElseThrow(() -> new AdempiereException("No scheduler found for process")
.appendParametersToMessage()
.setParameter("adProcessId", request.getSchedulerSearchKey().getAdProcessId()));
}
el... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java\de\metas\scheduler\AdSchedulerManageRequestHandler.java | 1 |
请完成以下Java代码 | public static AttributeSetId ofRepoIdOrNone(final int repoId)
{
final AttributeSetId id = ofRepoIdOrNull(repoId);
return id != null ? id : NONE;
}
@Nullable
public static AttributeSetId ofRepoIdOrNull(final int repoId)
{
if (repoId == NONE.repoId)
{
return NONE;
}
else if (repoId > 0)
{
return... | }
private AttributeSetId(final int repoId)
{
this.repoId = Check.assumeGreaterOrEqualToZero(repoId, "M_AttributeSet_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public boolean isNone()
{
return repoId == NONE.repoId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\mm\attributes\AttributeSetId.java | 1 |
请完成以下Java代码 | public static @NotNull List<MADBoilerPlateVarEval> getAll()
{
//noinspection DataFlowIssue
return s_cache.getOrLoad(0, MADBoilerPlateVarEval::retrieveAll);
}
private static ImmutableList<MADBoilerPlateVarEval> retrieveAll()
{
return queryBL.createQueryBuilder(I_AD_BoilerPlate_Var_Eval.Table_Name)
.orderB... | @Override
public I_AD_BoilerPlate_Var getAD_BoilerPlate_Var() throws RuntimeException
{
if (get_TrxName() == null)
return MADBoilerPlateVar.get(getCtx(), getAD_BoilerPlate_Var_ID());
else
return super.getAD_BoilerPlate_Var();
}
@Override
public I_C_DocType getC_DocType() throws RuntimeException
{
if ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\letters\model\MADBoilerPlateVarEval.java | 1 |
请完成以下Java代码 | protected void validateEventScopeInstance(MigratingEventScopeInstance eventScopeInstance,
MigratingProcessInstance migratingProcessInstance,
List<MigratingCompensationInstanceValidator> migratingTransitionInstanceValidators,
MigratingActivityInstanceValidationReportImpl instanceReport
) {
for ... | walker.walkUntil();
}
protected void ensureProcessInstanceExist(String processInstanceId,
ExecutionEntity processInstance) {
if (processInstance == null) {
throw LOGGER.processInstanceDoesNotExist(processInstanceId);
}
}
protected void ensureSameProces... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\migration\MigrateProcessInstanceCmd.java | 1 |
请完成以下Java代码 | public void hyperlinkUpdate(HyperlinkEvent e)
{
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
{
ADHyperlink link = helper.getADHyperlink(e.getURL().toString());
handle(link);
}
}
private void handle(ADHyperlink link)
{
if (link == null)
{
return;
}
else if (ADHyperlink.Action.S... | }
int adWindowId = -1;
String adWindowIdStr = params.get("AD_Window_ID");
if (adWindowIdStr != null && !adWindowIdStr.isEmpty())
{
adWindowId = Integer.valueOf(adWindowIdStr);
}
String whereClause = params.get("WhereClause");
MQuery query = new MQuery(AD_Table_ID);
if (!Check.isEmpty(whereClause))... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\adempiere\gui\ADHyperlinkHandler.java | 1 |
请完成以下Java代码 | public void notify(DelegateTask task) {
// test whether cdi is setup correctly. (if not, just do not deliver the
// event)
try {
ProgrammaticBeanLookup.lookup(ProcessEngine.class);
} catch (Exception e) {
return;
}
BusinessProcessEvent event = cre... | if (type == BusinessProcessEventType.CREATE_TASK) {
return new Annotation[] { businessProcessQualifier, new CreateTaskLiteral(activityId) };
}
if (type == BusinessProcessEventType.ASSIGN_TASK) {
return new Annotation[] { businessProcessQualifier, new AssignTaskLiteral(activityId)... | repos\flowable-engine-main\modules\flowable-cdi\src\main\java\org\flowable\cdi\impl\event\CdiTaskListener.java | 1 |
请完成以下Java代码 | public class TomcatParseBpmPlatformXmlStep extends AbstractParseBpmPlatformXmlStep {
private final static ContainerIntegrationLogger LOG = ProcessEngineLogger.CONTAINER_INTEGRATION_LOGGER;
public static final String CATALINA_BASE = "catalina.base";
public static final String CATALINA_HOME = "catalina.home";
... | try {
URL fileLocation = checkValidFileLocation(bpmPlatformFileLocation);
if (fileLocation != null) {
LOG.foundTomcatDeploymentDescriptor(bpmPlatformFileLocation, fileLocation.toString());
}
return fileLocation;
}
catch (MalformedURLException e) {
throw LOG.invalidDeploym... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\tomcat\deployment\TomcatParseBpmPlatformXmlStep.java | 1 |
请完成以下Java代码 | public static InputStream fileAsStream(File file) {
try {
return new BufferedInputStream(new FileInputStream(file));
} catch(FileNotFoundException e) {
throw LOG.fileNotFoundException(file.getAbsolutePath(), e);
}
}
/**
* Returns the File for a filename.
*
* @param filename the fil... | if (classLoader != null) {
fileUrl = classLoader.getResource(filename);
}
if (fileUrl == null) {
// Try the current Thread context classloader
classLoader = Thread.currentThread().getContextClassLoader();
fileUrl = classLoader.getResource(filename);
if (fileUrl == null) {
... | repos\camunda-bpm-platform-master\commons\utils\src\main\java\org\camunda\commons\utils\IoUtil.java | 1 |
请完成以下Java代码 | public void assignToInventoryCounters(final List<I_M_InventoryLine> inventoryLines, final int numberOfCounters)
{
final Map<Integer, List<I_M_InventoryLine>> linesToLocators = new HashMap<>();
GuavaCollectors.groupByAndStream(inventoryLines.stream(), I_M_InventoryLine::getM_Locator_ID)
.forEach(
invento... | {
final int defaultChargeId = getDefaultInternalChargeId();
inventoryLine.setC_Charge_ID(defaultChargeId);
}
@Override
public void markInventoryLinesAsCounted(@NonNull final InventoryId inventoryId)
{
inventoryDAO.retrieveLinesForInventoryId(inventoryId)
.forEach(this::markInventoryLineAsCounted);
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inventory\impl\InventoryBL.java | 1 |
请完成以下Java代码 | public void setAuthenticationFailureHandler(AuthenticationFailureHandler authenticationFailureHandler) {
this.authenticationFailureHandler = authenticationFailureHandler;
}
/**
* Sets the request matcher to check whether to proceed the request further.
*/
public void setRequiresAuthenticationRequestMatcher(Re... | */
private class PreAuthenticatedProcessingRequestMatcher implements RequestMatcher {
@Override
public boolean matches(HttpServletRequest request) {
Authentication currentUser = AbstractPreAuthenticatedProcessingFilter.this.securityContextHolderStrategy
.getContext()
.getAuthentication();
if (curren... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\AbstractPreAuthenticatedProcessingFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private <T> List<ResourceExportData> exportResources(Supplier<Collection<TbResourceInfo>> imagesProcessor,
Supplier<Collection<TbResourceInfo>> resourcesProcessor,
SecurityUser user) throws ThingsboardExcep... | return save(resource, user);
} else {
accessControlService.checkPermission(user, Resource.TB_RESOURCE, Operation.READ, resource.getId(), resource);
return resource;
}
}
private Comparator<? super LwM2mObject> getComparator(String sortProperty, String sortOrder) {
... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\resource\DefaultTbResourceService.java | 2 |
请完成以下Java代码 | private void validateRouteUri(URI uri) {
if (uri == null) {
handleError("The URI can not be empty");
}
if (!StringUtils.hasText(uri.getScheme())) {
handleError(String.format("The URI format [%s] is incorrect, scheme can not be empty", uri));
}
}
private void handleUnavailableDefinition(String simpleNa... | }
private boolean isAvailable(PredicateDefinition predicateDefinition) {
return routePredicates.stream()
.anyMatch(routePredicate -> predicateDefinition.getName().equals(routePredicate.name()));
}
@DeleteMapping("/routes/{id}")
public Mono<ResponseEntity<Object>> delete(@PathVariable String id) {
return th... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\actuate\AbstractGatewayControllerEndpoint.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void setStandardParameters()
{
// TODO: use the modern API, but note that we can't mix calls to this deprecated API with calls to the new one.
// Set a password to protect the locked cells.
// NOTE: if no password is set, the cells which are marked as locked won't be locked.
// NOTE2: instead of using... | * Then sets the columns to be hidden whose original jasper elements were annotated to be hidden with the {@link MetasJRXlsExporter#PROPERTY_COLUMN_HIDDEN} property.
* <p>
* See {@link MetasJRXlsExporterNature} for how that property gets from the jasper elements to the given <code>xCuts</code> instance.
*/
@Overr... | repos\metasfresh-new_dawn_uat\backend\de.metas.report\metasfresh-report-service\src\main\java\de\metas\report\jasper\exporter\MetasJRXlsExporter.java | 2 |
请完成以下Java代码 | public I_R_RequestType getR_RequestType() throws RuntimeException
{
return (I_R_RequestType)MTable.get(getCtx(), I_R_RequestType.Table_Name)
.getPO(getR_RequestType_ID(), get_TrxName()); }
/** Set Request Type.
@param R_RequestType_ID
Type of request (e.g. Inquiry, Complaint, ..)
*/
public void setR... | /** Set Source Updated.
@param SourceUpdated
Date the source document was updated
*/
public void setSourceUpdated (Timestamp SourceUpdated)
{
set_Value (COLUMNNAME_SourceUpdated, SourceUpdated);
}
/** Get Source Updated.
@return Date the source document was updated
*/
public Timestamp getSourceUpda... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_K_Index.java | 1 |
请完成以下Java代码 | public class Car {
@Id @GeneratedValue
private Long id;
private String make;
@Relationship(direction = INCOMING)
private Company company;
public Car(String make, String model) {
this.make = make;
this.model = model;
}
public Long getId() {
return id;
}
... | public String getMake() {
return make;
}
public void setMake(String make) {
this.make = make;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
private String model;
} | repos\tutorials-master\persistence-modules\neo4j\src\main\java\com\baeldung\neo4j\domain\Car.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void parseXssElement(boolean addIfNotPresent, Element element, ParserContext parserContext) {
Element xssElt = (element != null) ? DomUtils.getChildElementByTagName(element, XSS_ELEMENT) : null;
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(XXssProtectionHeaderWriter.class);
... | }
}
private String getAttribute(Element element, String name, String defaultValue) {
if (element == null) {
return defaultValue;
}
String value = element.getAttribute(name);
if (StringUtils.hasText(value)) {
return value;
}
return defaultValue;
}
} | repos\spring-security-main\config\src\main\java\org\springframework\security\config\http\HeadersBeanDefinitionParser.java | 2 |
请完成以下Java代码 | private static final class CompositeReceiptScheduleWarehouseDestProvider implements IReceiptScheduleWarehouseDestProvider
{
private final IReceiptScheduleWarehouseDestProvider defaultProvider;
private final CopyOnWriteArrayList<IReceiptScheduleWarehouseDestProvider> providers = new CopyOnWriteArrayList<>();
pri... | Check.assumeNotNull(provider, "Parameter provider is not null");
providers.add(provider);
}
@Override
public Optional<WarehouseId> getWarehouseDest(final IContext context)
{
return Stream.concat(providers.stream(), Stream.of(defaultProvider))
.map(provider -> provider.getWarehouseDest(context))
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\api\impl\ReceiptScheduleProducerFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private Saml2AuthenticationToken tokenByRegistrationId(HttpServletRequest request,
RequestMatcher.MatchResult result) {
String registrationId = result.getVariables().get("registrationId");
if (registrationId == null) {
return null;
}
RelyingPartyRegistration registration = this.registrations.findByRegistr... | */
void setAuthenticationRequestRepository(
Saml2AuthenticationRequestRepository<AbstractSaml2AuthenticationRequest> authenticationRequestRepository) {
Assert.notNull(authenticationRequestRepository, "authenticationRequestRepository cannot be null");
this.authenticationRequests = authenticationRequestRepository... | repos\spring-security-main\saml2\saml2-service-provider\src\main\java\org\springframework\security\saml2\provider\service\web\BaseOpenSamlAuthenticationTokenConverter.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setDesc(String desc) {
this.desc = desc;
}
public static Map<String, Map<String, Object>> toMap() {
AliPayTradeStateEnum[] ary = AliPayTradeStateEnum.values();
Map<String, Map<String, Object>> enumMap = new HashMap<String, Map<String, Object>>();
for (int num = 0; nu... | AliPayTradeStateEnum[] arry = AliPayTradeStateEnum.values();
for (int i = 0; i < arry.length; i++) {
if (arry[i].name().equalsIgnoreCase(name)) {
return arry[i];
}
}
return null;
}
/**
* 取枚举的json字符串
*
* @return
*/
public st... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\enums\alipay\AliPayTradeStateEnum.java | 2 |
请完成以下Java代码 | public static EntityId findEntityId(TbContext ctx, EntityType entityType, String entityName) {
BaseData<? extends EntityId> targetEntity;
switch (entityType) {
case DEVICE:
targetEntity = ctx.getDeviceService().findDeviceByTenantIdAndName(ctx.getTenantId(), entityName);
... | default:
throw new IllegalStateException("Unexpected entity type " + entityType.name());
}
if (targetEntity == null) {
throw new IllegalStateException("Failed to find " + entityType.getNormalName().toLowerCase() + " with name '" + entityName + "'!");
}
return ... | repos\thingsboard-master\rule-engine\rule-engine-components\src\main\java\org\thingsboard\rule\engine\util\EntitiesByNameAndTypeLoader.java | 1 |
请完成以下Java代码 | public void setQty_Old (java.math.BigDecimal Qty_Old)
{
set_Value (COLUMNNAME_Qty_Old, Qty_Old);
}
/** Get Menge (old).
@return Menge (old) */
@Override
public java.math.BigDecimal getQty_Old ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Qty_Old);
if (bd == null)
{
return Env.ZERO;
}
r... | /** Price = P */
public static final String TYPE_Price = "P";
/** Quantity = Q */
public static final String TYPE_Quantity = "Q";
/** Set Art.
@param Type
Type of Validation (SQL, Java Script, Java Language)
*/
@Override
public void setType (java.lang.String Type)
{
set_Value (COLUMNNAME_Type, Type);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_RfQResponse_ChangeEvent.java | 1 |
请完成以下Java代码 | private String buildNumericPredicateQuery(SqlQueryContext ctx, String field, NumericFilterPredicate numericFilterPredicate) {
String paramName = getNextParameterName(field);
ctx.addDoubleParameter(paramName, numericFilterPredicate.getValue().getValue());
String numericOperationQuery = "";
... | case EQUAL:
booleanOperationQuery = String.format("%s = :%s", field, paramName);
break;
case NOT_EQUAL:
booleanOperationQuery = String.format("%s != :%s", field, paramName);
break;
}
return String.format("(%s is not null and %s)... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\query\EntityKeyMapping.java | 1 |
请完成以下Java代码 | public JsonNode getAdditionalInfo() {
return getJson(() -> additionalInfo, () -> additionalInfoBytes);
}
public void setAdditionalInfo(JsonNode addInfo) {
setJson(addInfo, json -> this.additionalInfo = json, bytes -> this.additionalInfoBytes = bytes);
}
public void setAdditionalInfoFie... | if (json != null) {
return json;
} else {
byte[] data = binaryData.get();
if (data != null) {
try {
return mapper.readTree(new ByteArrayInputStream(data));
} catch (IOException e) {
log.warn("Can't deseri... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\BaseDataWithAdditionalInfo.java | 1 |
请完成以下Java代码 | protected void registerChannelModel(DelegateExpressionInboundChannelModel channelModel, String tenantId, EventRegistry eventRegistry) {
String delegateExpression = channelModel.getAdapterDelegateExpression();
if (StringUtils.isNotEmpty(delegateExpression)) {
VariableContainerWrapper variable... | }
@Override
public void unregisterChannelModel(ChannelModel channelModel, String tenantId, EventRepositoryService eventRepositoryService) {
// Nothing to do
}
public HasExpressionManagerEngineConfiguration getEngineConfiguration() {
return engineConfiguration;
}
public void se... | repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\pipeline\DelegateExpressionInboundChannelModelProcessor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
public int getSales() {
return sales;
}
public void setSales(int sales) {
this.sales = sales;
}
public String getWeight() {
return weight;
}
... | }
public Integer getProdState() {
return prodState;
}
public void setProdState(Integer prodState) {
this.prodState = prodState;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
pub... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\req\product\ProdInsertReq.java | 2 |
请完成以下Java代码 | public String getStartUserId() {
return startUserId;
}
@Override
public String getAssignee() {
return assignee;
}
@Override
public String getCompletedBy() {
return completedBy;
}
@Override
public String getReferenceId() {
return referenceId;
}
... | return variables.containsKey(variableName);
}
@Override
public Object getVariable(String variableName) {
return variables.get(variableName);
}
@Override
public String getTenantId() {
return tenantId;
}
@Override
public Set<String> getVariableNames() {
retur... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\delegate\ReadOnlyDelegatePlanItemInstanceImpl.java | 1 |
请完成以下Java代码 | public static void init() throws Exception {
Properties hbConfigProp = getHibernateProperties();
Class.forName(hbConfigProp.getProperty("hibernate.connection.driver_class"));
connection = DriverManager.getConnection(hbConfigProp.getProperty("hibernate.connection.url"), hbConfigProp.getProperty("... | private static Properties getHibernateProperties() throws IOException {
Properties properties = new Properties();
URL propertiesURL = Thread.currentThread().getContextClassLoader().getResource("hibernate-lifecycle.properties");
try (FileInputStream inputStream = new FileInputStream(propertiesURL... | repos\tutorials-master\persistence-modules\hibernate5\src\main\java\com\baeldung\hibernate\lifecycle\HibernateLifecycleUtil.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:mysql://localhost:3306/bookstoredb?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=root
#if you want to rely on columnDefinition then uncomment the following line
#spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true
spring.jpa.properties.h... | org.hibernate.dialect.MySQL8Dialect
spring.jpa.open-in-view=false
spring.datasource.initialization-mode=always
spring.datasource.platform=mysql | repos\Hibernate-SpringBoot-master\HibernateSpringBootCalculatePropertyGenerated\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public int hashCode()
{
if (_hashcode == null)
{
final int prime = 31;
int result = 1;
result = prime * result + (defaultValue == null ? 0 : defaultValue.hashCode());
result = prime * result + (modifiers == null ? 0 : modifiers.hashCode());
result = prime * result + (name == null ? 0 : name.hashCode... | return false;
}
if (modifiers == null)
{
if (other.modifiers != null)
{
return false;
}
}
else if (!modifiers.equals(other.modifiers))
{
return false;
}
if (name == null)
{
if (other.name != null)
{
return false;
}
}
else if (!name.equals(other.name))
{
return fal... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\util\CtxName.java | 1 |
请完成以下Java代码 | public int getSetupTime()
{
return get_ValueAsInt(COLUMNNAME_SetupTime);
}
@Override
public void setSetupTimeReal (final int SetupTimeReal)
{
set_Value (COLUMNNAME_SetupTimeReal, SetupTimeReal);
}
@Override
public int getSetupTimeReal()
{
return get_ValueAsInt(COLUMNNAME_SetupTimeReal);
}
@Overrid... | public void setWaitingTime (final int WaitingTime)
{
set_Value (COLUMNNAME_WaitingTime, WaitingTime);
}
@Override
public int getWaitingTime()
{
return get_ValueAsInt(COLUMNNAME_WaitingTime);
}
@Override
public void setYield (final int Yield)
{
set_Value (COLUMNNAME_Yield, Yield);
}
@Override
publi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_Order_Node.java | 1 |
请完成以下Java代码 | protected List<I_M_ReceiptSchedule> getM_ReceiptSchedules()
{
return getView()
.getReferencingDocumentPaths().stream()
.map(referencingDocumentPath -> getReceiptSchedule(referencingDocumentPath))
.collect(GuavaCollectors.toImmutableList());
}
private I_M_ReceiptSchedule getReceiptSchedule(@NonNull fin... | final IQuery<I_M_HU> query = Services.get(IQueryBL.class)
.createQueryBuilder(I_M_HU.class, this)
.filter(processInfoFilter)
.addOnlyActiveRecordsFilter()
.create();
final Set<HuId> huIds = query
.listIds()
.stream()
.map(HuId::ofRepoId)
.collect(ImmutableSet.toImmutableSet());
if (... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_M_HU_CreateReceipt_Base.java | 1 |
请完成以下Java代码 | public String getParameter() {
return this.parameter;
}
protected UserDetailsService getUserDetailsService() {
return this.userDetailsService;
}
public String getKey() {
return this.key;
}
public void setTokenValiditySeconds(int tokenValiditySeconds) {
this.tokenValiditySeconds = tokenValiditySeconds;
... | Assert.notNull(authenticationDetailsSource, "AuthenticationDetailsSource cannot be null");
this.authenticationDetailsSource = authenticationDetailsSource;
}
/**
* Sets the strategy to be used to validate the {@code UserDetails} object obtained
* for the user when processing a remember-me cookie to automaticall... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\rememberme\AbstractRememberMeServices.java | 1 |
请完成以下Java代码 | public class PrivilegeQueryImpl extends AbstractQuery<PrivilegeQuery, Privilege> implements PrivilegeQuery, CacheAwareQuery<PrivilegeEntity> {
private static final long serialVersionUID = 1L;
protected String id;
protected List<String> ids;
protected String name;
protected String userId;
prote... | }
public void setName(String name) {
this.name = name;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String group... | repos\flowable-engine-main\modules\flowable-idm-engine\src\main\java\org\flowable\idm\engine\impl\PrivilegeQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Pharmacy website(String website) {
this.website = website;
return this;
}
/**
* Get website
* @return website
**/
@Schema(example = "http://www.vitalapotheke.de", description = "")
public String getWebsite() {
return website;
}
public void setWebsite(String website) {
this.... | Objects.equals(this.timestamp, pharmacy.timestamp);
}
@Override
public int hashCode() {
return Objects.hash(_id, name, address, postalCode, city, phone, fax, email, website, timestamp);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pharmacy {\... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-patient-api\src\main\java\io\swagger\client\model\Pharmacy.java | 2 |
请完成以下Java代码 | public void start() {
synchronized (lifeCycleMonitor) {
if (!isRunning()) {
enginesBuild.forEach(name -> {
EventRegistryEngine eventRegistryEngine = EventRegistryEngines.getEventRegistryEngine(name);
eventRegistryEngine.handleDeployedChannelDef... | eventRegistryChangeDetectionExecutor.initialize();
}
}
@Override
public void stop() {
synchronized (lifeCycleMonitor) {
running = false;
}
}
@Override
public boolean isRunning() {
return running;
}
@Override
public int getPhase() {
... | repos\flowable-engine-main\modules\flowable-event-registry-spring\src\main\java\org\flowable\eventregistry\spring\SpringEventRegistryEngineConfiguration.java | 1 |
请完成以下Java代码 | public class Client {
private static final Logger LOG = Logger.getLogger(Client.class.getName());
private WebClient webClient;
public Client(String uri) {
this.webClient = WebClient.create(uri);
}
public Mono<User> getUser(int id) {
return webClient.get()
.uri("/user/... | .bodyToMono(User.class);
}
public Flux<User> fetchUsers(List<Integer> userIds) {
return Flux.fromIterable(userIds)
.flatMap(this::getUser);
}
public Flux<User> fetchUserAndOtherUser(int id) {
return Flux.merge(getUser(id), getOtherUser(id));
}
public Mono<UserWithI... | repos\tutorials-master\spring-reactive-modules\spring-reactive-client\src\main\java\com\baeldung\reactive\webclient\simultaneous\Client.java | 1 |
请完成以下Java代码 | public class UsernameAccessDecisionVoter implements AccessDecisionVoter<Object> {
private String rolePrefix = "ROLE_";
@Override
public boolean supports(ConfigAttribute attribute) {
if ((attribute.getAttribute() != null)
&& !attribute.getAttribute().startsWith(rolePrefix)) {
... | if (authentication == null) {
return ACCESS_DENIED;
}
String name = authentication.getName();
int result = ACCESS_ABSTAIN;
for (ConfigAttribute attribute : attributes) {
if (this.supports(attribute)) {
result = ACCESS_DENIED;
if (at... | repos\tutorials-master\spring-integration\src\main\java\com\baeldung\si\security\UsernameAccessDecisionVoter.java | 1 |
请完成以下Java代码 | public void createNotice(final I_C_Async_Batch asyncBatch)
{
final I_C_Async_Batch_Type asyncBatchType = loadOutOfTrx(asyncBatch.getC_Async_Batch_Type_ID(), I_C_Async_Batch_Type.class);
if (!IAsyncBatchDAO.ASYNC_BATCH_TYPE_DEFAULT.equals(asyncBatchType.getInternalName()))
{
return;
}
final UserId recipie... | notificationBL.send(
UserNotificationRequest.builder()
.notificationsConfig(notificationsConfig)
.contentADMessage(MSG_ASYNC_PROCESSED)
.contentADMessageParam(asyncBatch.getName())
.targetAction(TargetRecordAction.of(TableRecordReference.of(asyncBatch)))
.build());
}
private static ... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\spi\impl\DefaultAsyncBatchListener.java | 1 |
请完成以下Java代码 | public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Note.
@param Note
Optional additional user d... | {
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Remote Addr.
@param Remote_Addr
Remote Address
*/
public void setRemote_Addr (String Remote_Addr)
{
set_Value (COLUMNNAME_Remote_Addr, Remote_Addr);
}
/** Get Remote Add... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Registration.java | 1 |
请完成以下Java代码 | public class TbelCfTsRollingData implements TbelCfObject, Iterable<TbelCfTsMultiDoubleVal> {
@Getter
private final TbTimeWindow timeWindow;
@Getter
private final List<TbelCfTsMultiDoubleVal> values;
public TbelCfTsRollingData(TbTimeWindow timeWindow, List<TbelCfTsMultiDoubleVal> values) {
... | public List<TbelCfTsMultiDoubleVal> getValue() {
return values;
}
@JsonIgnore
public int getSize() {
return values.size();
}
@Override
public Iterator<TbelCfTsMultiDoubleVal> iterator() {
return values.iterator();
}
} | repos\thingsboard-master\common\script\script-api\src\main\java\org\thingsboard\script\api\tbel\TbelCfTsRollingData.java | 1 |
请完成以下Java代码 | public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Verarbeitet.
@return Checkbox sagt aus, ob der Beleg verarbeitet wurde.
*/
@Override
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
... | /** Set Wochenerster.
@param WeekDate Wochenerster */
@Override
public void setWeekDate (java.sql.Timestamp WeekDate)
{
set_ValueNoCheck (COLUMNNAME_WeekDate, WeekDate);
}
/** Get Wochenerster.
@return Wochenerster */
@Override
public java.sql.Timestamp getWeekDate ()
{
return (java.sql.Timestamp)... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java-gen\de\metas\procurement\base\model\X_PMM_Week.java | 1 |
请完成以下Java代码 | protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new Strin... | }
public I_S_Resource getS_Resource() throws RuntimeException
{
return (I_S_Resource)MTable.get(getCtx(), I_S_Resource.Table_Name)
.getPO(getS_Resource_ID(), get_TrxName()); }
/** Set Resource.
@param S_Resource_ID
Resource
*/
public void setS_Resource_ID (int S_Resource_ID)
{
if (S_Resource_ID... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_S_ResourceUnAvailable.java | 1 |
请完成以下Java代码 | public void setC_TaxDeclarationLine(org.compiere.model.I_C_TaxDeclarationLine C_TaxDeclarationLine)
{
set_ValueFromPO(COLUMNNAME_C_TaxDeclarationLine_ID, org.compiere.model.I_C_TaxDeclarationLine.class, C_TaxDeclarationLine);
}
/** Set Tax Declaration Line.
@param C_TaxDeclarationLine_ID
Tax Declaration Docu... | @Override
public org.compiere.model.I_Fact_Acct getFact_Acct() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_Fact_Acct_ID, org.compiere.model.I_Fact_Acct.class);
}
@Override
public void setFact_Acct(org.compiere.model.I_Fact_Acct Fact_Acct)
{
set_ValueFromPO(COLUMNNAME_Fact_Acct_ID, org.compiere.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_TaxDeclarationAcct.java | 1 |
请完成以下Java代码 | public String toString()
{
final StringBuilder sb = new StringBuilder();
for (final String columnName : columnNames)
{
if (sb.length() > 0)
{
sb.append(",");
}
sb.append(columnName);
}
sb.insert(0, "COALESCE(").append(")");
sb.append("==").append(value);
return sb.toString();
}
@Over... | @Override
public String getSql()
{
buildSql();
return sqlWhereClause;
}
@Override
public List<Object> getSqlParams(final Properties ctx)
{
return getSqlParams();
}
public List<Object> getSqlParams()
{
buildSql();
return sqlParams;
}
private boolean sqlBuilt = false;
private String sqlWhereClaus... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\CoalesceEqualsQueryFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Future<Integer> execute02AsyncWithFuture() {
return AsyncResult.forValue(this.execute02());
}
@Async
public ListenableFuture<Integer> execute01AsyncWithListenableFuture() {
try {
return AsyncResult.forValue(this.execute02());
} catch (Throwable ex) {
r... | }
private static void sleep(int seconds) {
try {
Thread.sleep(seconds * 1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
@Async
public Integer zhaoDaoNvPengYou(Integer a, Integer b) {
throw new RuntimeException("程序员不需要... | repos\SpringBoot-Labs-master\lab-29\lab-29-async-demo\src\main\java\cn\iocoder\springboot\lab29\asynctask\service\DemoService.java | 2 |
请完成以下Java代码 | public void setC_CostClassification_ID (final int C_CostClassification_ID)
{
if (C_CostClassification_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_CostClassification_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_CostClassification_ID, C_CostClassification_ID);
}
@Override
public int getC_CostClassification_... | return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValue (final @Nullable java.lang.String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
@Override
public java.lang.String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_CostClassification.java | 1 |
请完成以下Java代码 | protected static FlowableMailClient createMailClient(MailServerConfiguration serverConfiguration, MailServerInfo serverInfo,
MailServerInfo fallbackServerInfo) {
MailDefaultsConfiguration defaultsConfiguration = createMailDefaultsConfiguration(serverInfo, fallbackServerInfo);
return new Jaka... | if (serverInfo != null) {
value = valueProvider.apply(serverInfo);
}
if (value == null) {
value = valueProvider.apply(fallbackServerInfo);
}
return value;
}
protected static Collection<String> getForceTo(MailServerInfo serverInfo, MailServerInfo fallback... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\cfg\mail\FlowableMailClientCreator.java | 1 |
请完成以下Java代码 | public class AlphanumericPerformanceBenchmark {
private static final String TEST_STRING = "ABC123abc123";
private static final String REGEX = "[^[a-zA-Z0-9]*$]";
private static final Pattern PATTERN = Pattern.compile(REGEX);
@Benchmark
@BenchmarkMode(Mode.Throughput)
public void alphanumericRe... | }
}
blackhole.consume(result);
}
@Benchmark
@BenchmarkMode(Mode.Throughput)
public void alphanumericIterationWithCopy(Blackhole blackhole) {
boolean result = true;
for (final char c : TEST_STRING.toCharArray()) {
if (!isAlphanumeric(c)) {
resu... | repos\tutorials-master\core-java-modules\core-java-regex\src\main\java\com\baeldung\alphanumeric\AlphanumericPerformanceBenchmark.java | 1 |
请完成以下Java代码 | protected boolean beforeSave (boolean newRecord)
{
if (getAD_Org_ID() != 0)
setAD_Org_ID(0);
// Region Check
if (getC_Region_ID() != 0)
{
if (m_c == null || m_c.getC_Country_ID() != getC_Country_ID())
getCountry();
if (!m_c.isHasRegion())
setC_Region_ID(0);
}
if (getC_City_ID() <= 0 && get... | @Override
protected boolean afterSave (boolean newRecord, boolean success)
{
// Value/Name change in Account
if (!newRecord
&& ("Y".equals(Env.getContext(getCtx(), Env.CTXNAME_AcctSchemaElementPrefix + AcctSchemaElementType.LocationFrom.getCode()))
|| "Y".equals(Env.getContext(getCtx(), Env.CTXNAME_AcctSc... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MLocation.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Exchange directExchange() {
return ExchangeBuilder.directExchange("DIRECT_EXCHANGE").durable(true).build();
}
/**
* 声明一个队列 支持持久化.
*
* @return the queue
*/
@Bean("directQueue")
public Queue directQueue() {
return QueueBuilder.durable("DIRECT_QUEUE").build();
... | * @return the queue
*/
@Bean("fanoutQueueB")
public Queue fanoutQueueB() {
return QueueBuilder.durable("FANOUT_QUEUE_B").build();
}
/**
* 绑定队列A 到Fanout 交换机.
*
* @param queue the queue
* @param fanoutExchange the fanout exchange
* @return the binding
*... | repos\SpringBootBucket-master\springboot-rabbitmq\src\main\java\com\xncoding\pos\config\RabbitConfig.java | 2 |
请完成以下Java代码 | public String toString()
{
// NOTE: we are making it translateable friendly because it's displayed in Prefereces->Info->Rollen
final StringBuilder sb = new StringBuilder()
.append("DocumentApproval[")
.append("@IsCanApproveOwnDoc@: @" + (canApproveOwnDoc ? "Y" : "N") + "@");
if (!canApproveOwnDoc)
{
... | return false;
}
public boolean canApproveOwnDoc()
{
return canApproveOwnDoc;
}
@NonNull
public Money getAmtApproval(@NonNull final CurrencyId fallbackCurrencyId)
{
return currencyId != null
? Money.of(amtApproval, currencyId)
: Money.of(amtApproval, fallbackCurrencyId);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\permissions\DocumentApprovalConstraint.java | 1 |
请完成以下Java代码 | public int getCount() {
return count;
}
public List<String> getIds(List<String> ids) {
return ids.subList(0, count);
}
public void removeIds(int numberOfIds) {
count -= numberOfIds;
}
@Override
public String toString() {
return new StringJoiner(";").add(deploymentId).add(String.valueOf(... | public int hashCode() {
return Objects.hash(count, deploymentId);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DeploymentMapping)) {
return false;
}
DeploymentMapping other = (DeploymentMapping) obj;
return count ==... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\batch\DeploymentMapping.java | 1 |
请完成以下Java代码 | private static final class POSourceDocument implements SourceDocument
{
@NonNull
private final PO po;
@Override
public boolean hasFieldValue(final String fieldName)
{
return po.get_ColumnIndex(fieldName) >= 0;
}
@Override
public Object getFieldValue(final String fieldName)
{
return po.get_Val... | @NonNull
private final GridTab gridTab;
@Override
public boolean hasFieldValue(final String fieldName)
{
return gridTab.getField(fieldName) != null;
}
@Override
public Object getFieldValue(final String fieldName)
{
return gridTab.getValue(fieldName);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\letters\model\MADBoilerPlate.java | 1 |
请完成以下Java代码 | public int complete(String buffer, int cursor, List<CharSequence> candidates) {
int completionIndex = super.complete(buffer, cursor, candidates);
int spaceIndex = buffer.indexOf(' ');
String commandName = ((spaceIndex != -1) ? buffer.substring(0, spaceIndex) : "");
if (StringUtils.hasText(commandName)) {
for... | this.console.println(String.format("\t%" + maxOptionsLength + "s: %s", optionHelpLine.getOptions(),
optionHelpLine.getUsage()));
}
this.console.drawLine();
}
catch (IOException ex) {
Log.error(ex.getMessage() + " (" + ex.getClass().getName() + ")");
}
}
/**
* Encapsulated options and usage hel... | repos\spring-boot-4.0.1\cli\spring-boot-cli\src\main\java\org\springframework\boot\cli\command\shell\CommandCompleter.java | 1 |
请完成以下Java代码 | public void setInsufficientQtyAvailableForSalesColor_ID (final int InsufficientQtyAvailableForSalesColor_ID)
{
if (InsufficientQtyAvailableForSalesColor_ID < 1)
set_Value (COLUMNNAME_InsufficientQtyAvailableForSalesColor_ID, null);
else
set_Value (COLUMNNAME_InsufficientQtyAvailableForSalesColor_ID, Insuff... | return get_ValueAsInt(COLUMNNAME_MD_AvailableForSales_Config_ID);
}
@Override
public void setSalesOrderLookBehindHours (final int SalesOrderLookBehindHours)
{
set_Value (COLUMNNAME_SalesOrderLookBehindHours, SalesOrderLookBehindHours);
}
@Override
public int getSalesOrderLookBehindHours()
{
return get_Va... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java-gen\de\metas\material\cockpit\model\X_MD_AvailableForSales_Config.java | 1 |
请完成以下Java代码 | public void updateDocOutBoundLog(final I_C_Invoice invoiceRecord)
{
final TableRecordReference recordReference = TableRecordReference.of(invoiceRecord);
final Optional<I_C_Doc_Outbound_Log> updatedDocOutboundLog = ediDocOutBoundLogService.setEdiExportStatusFromInvoiceRecord(recordReference);
updatedDocOutboundL... | @DocValidate(timings = ModelValidator.TIMING_BEFORE_REVERSECORRECT)
public void forbiddReversal(final I_C_Invoice invoice)
{
final String ediStatus = invoice.getEDI_ExportStatus();
if (I_EDI_Document_Extension.EDI_EXPORTSTATUS_Sent.equals(ediStatus)
|| I_EDI_Document_Extension.EDI_EXPORTSTATUS_SendingStarted.... | repos\metasfresh-new_dawn_uat\backend\de.metas.edi\src\main\java\de\metas\edi\model\validator\C_Invoice.java | 1 |
请完成以下Java代码 | public void dump()
{
for (int i = 0; i < size; i++)
{
System.err.println("i: " + i + " [" + base[i] + ", " + check[i]
+ "]");
}
}
public List<String> getKey()
{
return key;
}
public int[] getValue()
{
re... | {
return base;
}
public void setBase(int[] base)
{
this.base = base;
}
public int[] getLength()
{
return length;
}
public void setLength(int[] length)
{
this.length = length;
}
public void setSize(int size)
{
this.size = size;
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\crf\crfpp\DoubleArrayTrieInteger.java | 1 |
请完成以下Java代码 | public boolean isLeapYearExample(int year) {
GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();
return cal.isLeapYear(year);
}
public Date subtractDays(GregorianCalendar calendar, int daysToSubtract) {
GregorianCalendar cal = calendar;
cal.add(Calend... | DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
return datatypeFactory.newXMLGregorianCalendar(calendar);
}
public Date toDate(XMLGregorianCalendar calendar) {
return calendar.toGregorianCalendar()
.getTime();
}
public int compareDates(GregorianCalendar fir... | repos\tutorials-master\core-java-modules\core-java-date-operations-4\src\main\java\com\baeldung\gregorian\calendar\GregorianCalendarExample.java | 1 |
请完成以下Java代码 | default void updateConfigs(Map<String, Object> updates) {
}
/**
* Remove the specified key from the configuration map.
* @param configKey the key to remove.
* @since 2.7
*/
default void removeConfig(String configKey) {
}
/**
* Called whenever a consumer is added or removed.
*
* @param <K> the key t... | */
default void consumerAdded(String id, Consumer<K, V> consumer) {
}
/**
* An existing consumer was removed.
* @param id the consumer id (factory bean name and client.id separated by a
* period).
* @param consumer the consumer.
*/
default void consumerRemoved(@Nullable String id, Consumer<K, V>... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\core\ConsumerFactory.java | 1 |
请完成以下Java代码 | default File getRootDirectory() {
return null;
}
/**
* Closes the {@code Archive}, releasing any open resources.
* @throws Exception if an error occurs during close processing
*/
@Override
default void close() throws Exception {
}
/**
* Factory method to create an appropriate {@link Archive} from the ... | /**
* Represents a single entry in the archive.
*/
interface Entry {
/**
* Returns the name of the entry.
* @return the name of the entry
*/
String name();
/**
* Returns {@code true} if the entry represents a directory.
* @return if the entry is a directory
*/
boolean isDirectory();
}... | repos\spring-boot-4.0.1\loader\spring-boot-loader\src\main\java\org\springframework\boot\loader\launch\Archive.java | 1 |
请完成以下Java代码 | public String getPaymentRule()
{
Check.assumeNotNull(paymentRule, "paymentRule not null");
return paymentRule;
}
public Builder setPaymentRule(final String paymentRule)
{
this.paymentRule = paymentRule;
return this;
}
public Builder setInvoiceId(final @Nullable InvoiceId invoiceId)
{
this... | }
public Builder setOpenAmt(final BigDecimal openAmt)
{
this._openAmt = openAmt;
return this;
}
public BigDecimal getPayAmt()
{
final BigDecimal openAmt = getOpenAmt();
final BigDecimal discountAmt = getDiscountAmt();
return openAmt.subtract(discountAmt);
}
public BigDecimal getDiscountA... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\payment\impl\PaySelectionLineCandidate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Result<?> add(@RequestBody SysFormFile sysFormFile) {
sysFormFileService.save(sysFormFile);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param sysFormFile
* @return
*/
@AutoLog(value = "表单评论文件-编辑")
@Operation(summary = "表单评论文件-编辑")
@RequestMapping(value... | return Result.OK(sysFormFile);
}
/**
* 导出excel
*
* @param request
* @param sysFormFile
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, SysFormFile sysFormFile) {
return super.exportXls(request, sysFormFile, SysFormFile.... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\controller\SysFormFileController.java | 2 |
请完成以下Java代码 | public Map<String, String> getScopedSlots() {
return scopedSlots;
}
public void setScopedSlots(Map<String, String> scopedSlots) {
this.scopedSlots = scopedSlots;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getTitle() {
return title;
}
... | */
public String getLabel() {
return label;
}
/**
* @param label the label to set
*/
public void setLabel(String label) {
this.label = label;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value the value to set
*/
public void setValue(String value) {... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\TreeModel.java | 1 |
请完成以下Java代码 | public ILUTUConfigurationEditor startEditing()
{
return new LUTUConfigurationEditor(this);
}
@Override
public I_M_HU_LUTU_Configuration getCreateLUTUConfiguration()
{
//
// If there is an already existing configuration, return it without any changes
final I_M_HU_LUTU_Configuration lutuConfigurationExistin... | handler.setCurrentLUTUConfiguration(documentLine, lutuConfiguration);
// Save it
handler.save(documentLine);
}
protected I_M_HU_LUTU_Configuration createNewLUTUConfiguration()
{
final T documentLine = getDocumentLine();
return handler.createNewLUTUConfiguration(documentLine);
}
private T getDocumentLine... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\DocumentLUTUConfigurationManager.java | 1 |
请完成以下Java代码 | private boolean isGridModeOnly()
{
return getGridTab().isGridModeOnly();
}
private GridWindow getGridWindow()
{
return getGridTab().getGridWindow();
}
public Builder setAPanel(final APanel aPanel)
{
this.aPanel = aPanel;
return this;
}
private APanel getAPanel()
{
Check.assumeN... | {
return getAPanel().getIgnoreAction();
}
private int getTabIndex()
{
return getGridTab().getTabNo();
}
private boolean isLazyInitialization()
{
// lazy if not first tab
return getTabIndex() != 0;
}
public Builder setGoSingleRowLayout(final boolean goSingleRowLayout)
{
this.goSingl... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\GridController.java | 1 |
请完成以下Java代码 | protected int copyResponseBody(ClientHttpResponse clientResponse, InputStream inputStream,
OutputStream outputStream) throws IOException {
Objects.requireNonNull(clientResponse, "No ClientResponse specified");
Objects.requireNonNull(inputStream, "No InputStream specified");
Objects.requireNonNull(outputStream,... | if (totalReadBytes < Integer.MAX_VALUE) {
try {
totalReadBytes = Math.addExact(totalReadBytes, readBytes);
}
catch (ArithmeticException e) {
totalReadBytes = Integer.MAX_VALUE;
}
}
}
outputStream.flush();
return totalReadBytes;
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webmvc\src\main\java\org\springframework\cloud\gateway\server\mvc\common\AbstractProxyExchange.java | 1 |
请完成以下Java代码 | public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getHostname() {
return hostname;
}
public void ... | public MachineInfo toMachineInfo() {
MachineInfo machineInfo = new MachineInfo();
machineInfo.setApp(app);
machineInfo.setHostname(hostname);
machineInfo.setIp(ip);
machineInfo.setPort(port);
machineInfo.setLastHeartbeat(timestamp.getTime());
machineInfo.setHeart... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\MachineEntity.java | 1 |
请完成以下Java代码 | private int getM_Product_ID()
{
final String tableName = getTableName();
if (I_M_Product.Table_Name.equals(tableName))
{
return getRecord_ID();
}
else if (I_PP_Product_BOM.Table_Name.equals(tableName))
{
final ProductBOMId bomId = ProductBOMId.ofRepoId(getRecord_ID());
final I_PP_Product_BOM bom =... | log.info("Product is not a BOM");
// No BOM - should not happen, but no problem
return;
}
// Check this level
checkProductBOMCyclesAndMarkAsVerified(product);
// Get Default BOM from this product
final I_PP_Product_BOM bom = productBOMDAO.getDefaultBOMByProductId(ProductId.ofRepoId(product.getM_Produc... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\process\PP_Product_BOM_Check.java | 1 |
请完成以下Java代码 | public class Fresh_QtyOnHand_Tab_Callout extends TabCalloutAdapter
{
@Override
public void onNew(final ICalloutRecord calloutRecord)
{
final I_Fresh_QtyOnHand freshQtyOnHand = calloutRecord.getModel(I_Fresh_QtyOnHand.class);
final Timestamp dateDoc = freshQtyOnHand.getDateDoc();
Timestamp dateDocToUse = dateD... | }
freshQtyOnHand.setDateDoc(dateDocToUse);
freshQtyOnHand.setDescription(null);
}
private boolean isDateDocAlreadyUsed(final I_Fresh_QtyOnHand freshQtyOnHand, final Timestamp dateDocToUse)
{
return Services.get(IQueryBL.class)
.createQueryBuilder(I_Fresh_QtyOnHand.class, freshQtyOnHand)
.addOnlyActiv... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\freshQtyOnHand\callout\Fresh_QtyOnHand_Tab_Callout.java | 1 |
请完成以下Java代码 | public void setQtyCalculated (final BigDecimal QtyCalculated)
{
set_Value (COLUMNNAME_QtyCalculated, QtyCalculated);
}
@Override
public BigDecimal getQtyCalculated()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyCalculated);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public voi... | }
@Override
public java.lang.String getUserElementString3()
{
return get_ValueAsString(COLUMNNAME_UserElementString3);
}
@Override
public void setUserElementString4 (final @Nullable java.lang.String UserElementString4)
{
set_Value (COLUMNNAME_UserElementString4, UserElementString4);
}
@Override
public... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_ForecastLine.java | 1 |
请完成以下Java代码 | public String toString()
{
return asQualityNoticesString();
}
public QualityNoticesCollection copy()
{
final QualityNoticesCollection copy = new QualityNoticesCollection();
copy.addQualityNotices(this);
return copy;
}
@Override
public QualityNoticesCollection clone()
{
return copy();
}
/**
* Ad... | addQualityNotice(qualityNote);
}
}
/**
*
* @return string representation of quality notices from this collection
*/
public String asQualityNoticesString()
{
if (qualityNoticesSet == null || qualityNoticesSet.isEmpty())
{
return "";
}
final StringBuilder qualityNoticesStr = new StringBuilder();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\spi\impl\QualityNoticesCollection.java | 1 |
请完成以下Java代码 | public String getNm() {
return nm;
}
/**
* Sets the value of the nm property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNm(String value) {
this.nm = value;
}
/**
* Gets the value of the ctry prop... | * {@link String }
*
*/
public String getCtry() {
return ctry;
}
/**
* Sets the value of the ctry property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCtry(String value) {
this.ctry = valu... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\schema-pain_001_01_03_ch_02\src\main\java-xjc\de\metas\payment\sepa\jaxb\sct\pain_001_001_03_ch_02\RegulatoryAuthority2.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<UnitType> getQuantityVariances() {
if (quantityVariances == null) {
quantityVariances = new ArrayList<UnitType>();
}
return this.quantityVariances;
}
/**
* Gets the value of the parentLineNumber property.
*
* @return
* possible object is
... | /**
* Sets the value of the returnableContainer property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setReturnableContainer(Boolean value) {
this.returnableContainer = value;
}
/**
* Gets the value of the quantityIn... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\DESADVListLineItemExtensionType.java | 2 |
请在Spring Boot框架中完成以下Java代码 | protected void doInTransactionWithoutResult(
TransactionStatus status) {
log.info("Starting first transaction ...");
Author author = authorRepository.findById(1L).orElseThrow();
try {
log.info("Locking for 10s... | TransactionStatus status) {
log.info("Starting second transaction ...");
authorRepository.deleteById(1L);
}
});
log.info("Second transaction comitted!");
});
tA.start();
Thread.sleep(2... | repos\Hibernate-SpringBoot-master\HibernateSpringBootPessimisticLocksDelInsUpd\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | protected ProcessPreconditionsResolution checkPreconditionsApplicable()
{
if (!getSelectedRowIds().isSingleDocumentId())
{
return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection();
}
final PPOrderLineRow ppOrderLineRow = getSingleSelectedRow();
if (!ppOrderLineRow.isIssue())
{
return ... | @Override
protected String doIt()
{
final PPOrderLinesView ppOrder = getView();
final PPOrderLineRow issueRow = getSingleSelectedRow();
ppOrderBL.issueServiceProduct(PPOrderIssueServiceProductRequest.builder()
.ppOrderId(ppOrder.getPpOrderId())
.ppOrderBOMLineId(issueRow.getOrderBOMLineId())
.overr... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pporder\process\WEBUI_PP_Order_IssueServiceProduct.java | 1 |
请完成以下Java代码 | public MAd[] getAds ()
{
int[] AdCats = null;
String sql = "SELECT count(*) FROM CM_Template_AD_Cat WHERE CM_Template_ID=?";
PreparedStatement pstmt = null;
try
{
int numberAdCats = 0;
pstmt = DB.prepareStatement (sql, get_TrxName ());
pstmt.setInt (1, get_ID ());
ResultSet rs = pstmt.executeQuer... | try
{
if (pstmt != null)
pstmt.close ();
}
catch (SQLException ex1)
{
}
pstmt = null;
if (AdCats != null && AdCats.length > 0)
{
MAd[] returnAds = new MAd[AdCats.length];
for (int i = 0; i < AdCats.length; i++)
{
returnAds[i] = MAd.getNext (getCtx (), AdCats[i],
get_TrxName ());... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MTemplate.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public VariableEventFilter variableEventFilter() {
return new VariableEventFilter();
}
@Bean
@ConditionalOnMissingBean
public EphemeralVariableResolver ephemeralVariableResolver(ProcessExtensionService processExtensionService) {
return new EphemeralVariableResolver(processExtensionServi... | ) {
return () ->
runtimeService.addEventListener(
new VariableUpdatedListenerDelegate(
getInitializedListeners(listeners),
new ToVariableUpdatedConverter(ephemeralVariableResolver),
variableEventFilter
),
... | repos\Activiti-develop\activiti-core\activiti-api-impl\activiti-api-runtime-shared-impl\src\main\java\org\activiti\runtime\api\conf\CommonRuntimeAutoConfiguration.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Object createTextIndex() {
// 设置字段名称
String field = "name";
// 创建索引
return mongoTemplate.getCollection(COLLECTION_NAME).createIndex(Indexes.text(field));
}
/**
* 创建哈希索引
*
* @return 索引信息
*/
public Object createHashIndex() {
// 设置字段名称
... | // 配置索引选项
IndexOptions options = new IndexOptions();
// 设置为唯一索引
options.unique(true);
// 创建索引
return mongoTemplate.getCollection(COLLECTION_NAME).createIndex(Indexes.ascending(indexName), options);
}
/**
* 创建局部索引
*
* @return 索引信息
*/
public Object ... | repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\CreateIndexService.java | 2 |
请完成以下Java代码 | public XhtmlDocument appendTitle(String value)
{
title.addElement(value);
return(this);
}
/**
* Sets the codeset for this XhtmlDocument
*/
public void setCodeset ( String codeset )
{
this.codeset = codeset;
}
/**
* Gets the codeset for ... | // XhtmlDocument is just a convient wrapper for html call html.output
html.output(out);
}
/**
Override the toString() method so that it prints something meaningful.
*/
public final String toString()
{
StringBuffer sb = new StringBuffer();
if ( getCodeset() ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\XhtmlDocument.java | 1 |
请完成以下Java代码 | public abstract class ByteArrayStream extends ByteArray
{
/**
* 每次读取1mb
*/
protected int bufferSize;
public ByteArrayStream(byte[] bytes, int bufferSize)
{
super(bytes);
this.bufferSize = bufferSize;
}
public static ByteArrayStream createByteArrayStream(String path)
... | ensureAvailableBytes(2);
return super.nextChar();
}
@Override
public double nextDouble()
{
ensureAvailableBytes(8);
return super.nextDouble();
}
@Override
public byte nextByte()
{
ensureAvailableBytes(1);
return super.nextByte();
}
@Over... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\io\ByteArrayStream.java | 1 |
请完成以下Java代码 | private void handleExceptionInUI(final Throwable ex)
{
runnable.handleExceptionInUI(this, ex);
}
@Override
public void publishPartialResults(final List<PartialResultType> partialResults)
{
logger.debug("Publishing partial results to UI thread: {} ({})", partialResults, this);
if (partialResults == ... | }
else if (rootPaneContainer instanceof Window)
{
return (Window)rootPaneContainer;
}
else if (rootPaneContainer instanceof Component)
{
comp = (Component)rootPaneContainer;
}
else
{
comp = rootPaneContainer.getRootPane();
}
final Window window = AEnv.getParentComponent(comp, ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\adempiere\form\swing\SwingClientUIAsyncInvoker.java | 1 |
请完成以下Java代码 | public void setAsync(boolean async) {
this.async = async;
}
public void setActivityId(String activityId) {
this.activityId = activityId;
}
public String getActivityId() {
return activityId;
}
public boolean isStartEvent() {
return isStartEvent;
}
publi... | this.isStartEvent = isStartEvent;
}
public String getEventType() {
return eventType;
}
public String getConfiguration() {
return configuration;
}
public void setConfiguration(String configuration) {
this.configuration = configuration;
}
} | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\bpmn\parser\EventSubscriptionDeclaration.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void updateData(RpAccountCheckMistakeScratchPool RpAccountCheckMistakeScratchPool) {
rpAccountCheckMistakeScratchPoolDao.update(RpAccountCheckMistakeScratchPool);
}
@Override
public RpAccountCheckMistakeScratchPool getDataById(String id) {
return rpAccountCheckMistakeScratchPoolDao.getById(id);
}
/**
... | * @param scratchPoolList
*/
public void deleteFromPool(List<RpAccountCheckMistakeScratchPool> scratchPoolList) {
for (RpAccountCheckMistakeScratchPool record : scratchPoolList) {
rpAccountCheckMistakeScratchPoolDao.delete(record.getId());
}
}
/**
* 查询出缓存池中所有的数据
*
* @return
*/
public List<RpAccou... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\service\impl\RpAccountCheckMistakeScratchPoolServiceImpl.java | 2 |
请完成以下Java代码 | public class AssociationXMLConverter extends BaseBpmnXMLConverter {
public Class<? extends BaseElement> getBpmnElementType() {
return Association.class;
}
@Override
protected String getXMLElementName() {
return ELEMENT_ASSOCIATION;
}
@Override
protected BaseElement convert... | @Override
protected void writeAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw)
throws Exception {
Association association = (Association) element;
writeDefaultAttribute(ATTRIBUTE_FLOW_SOURCE_REF, association.getSourceRef(), xtw);
writeDefaultAttribute(A... | repos\Activiti-develop\activiti-core\activiti-bpmn-converter\src\main\java\org\activiti\bpmn\converter\AssociationXMLConverter.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
/**
* FieldName AD_Reference_ID=542025
* Reference name: MobileUI_UserProfile_DD_CaptionItem_Field
*/
public static final int FIELDNAME_AD_Reference_ID=542025;
/** SourceDoc = Sour... | public void setMobileUI_UserProfile_DD_ID (final int MobileUI_UserProfile_DD_ID)
{
if (MobileUI_UserProfile_DD_ID < 1)
set_ValueNoCheck (COLUMNNAME_MobileUI_UserProfile_DD_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MobileUI_UserProfile_DD_ID, MobileUI_UserProfile_DD_ID);
}
@Override
public int getMob... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_MobileUI_UserProfile_DD_CaptionItem.java | 1 |
请完成以下Java代码 | public static String toString(JSONObject o) throws JSONException {
Iterator keys = o.keys();
String s;
StringBuilder sb = new StringBuilder();
if (o.has("Status-Code") && o.has("Reason-Phrase")) {
sb.append(o.getString("HTTP-Version"));
sb.append(' ');
... | !s.equals("Reason-Phrase") &&
!s.equals("Method") &&
!s.equals("Request-URI") &&
!o.isNull(s)
) {
sb.append(s);
sb.append(": ");
sb.append(o.getString(s));
sb.append(CRLF);
}
}... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\util\json\HTTP.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EC2Metadata {
@Value("${ami-id:N/A}")
private String amiId;
@Value("${hostname:N/A}")
private String hostname;
@Value("${instance-type:N/A}")
private String instanceType;
@Value("${services/domain:N/A}")
private String serviceDomain;
@Value("#{instanceData['Name'] ?... | public String getServiceDomain() {
return serviceDomain;
}
public String getName() {
return name;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("EC2Metadata [amiId=");
builder.append(amiId);
builde... | repos\tutorials-master\spring-cloud-modules\spring-cloud-aws\src\main\java\com\baeldung\spring\cloud\aws\ec2\EC2Metadata.java | 2 |
请完成以下Java代码 | public class LoggingProducerListener<K, V> implements ProducerListener<K, V> {
/**
* Default max content logged.
*/
public static final int DEFAULT_MAX_CONTENT_LOGGED = 100;
protected final LogAccessor logger = new LogAccessor(LogFactory.getLog(getClass())); // NOSONAR
private boolean includeContents = true;... | logOutput.append(" and partition ").append(recordMetadata != null
? recordMetadata.partition()
: record.partition());
}
logOutput.append(":");
return logOutput.toString();
});
}
private String keyOrValue(Object keyOrValue) {
if (keyOrValue instanceof byte[]) {
return "byte[" + ((byte[]) k... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\LoggingProducerListener.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EventResponse {
protected String url;
protected String id;
protected String action;
protected String userId;
@JsonSerialize(using = DateToStringSerializer.class, as = Date.class)
protected Date time;
protected String taskUrl;
protected String processInstanceUrl;
protect... | public void setTime(Date time) {
this.time = time;
}
public String getTaskUrl() {
return taskUrl;
}
public void setTaskUrl(String taskUrl) {
this.taskUrl = taskUrl;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
public String getProcessInstanceUrl() {
return ... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\engine\EventResponse.java | 2 |
请完成以下Java代码 | public void printBoard() {
int size = this.boardValues.length;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
System.out.print(boardValues[i][j] + " ");
}
System.out.println();
}
}
public List<Position> getEmptyPosit... | public void printStatus() {
switch (this.checkStatus()) {
case P1:
System.out.println("Player 1 wins");
break;
case P2:
System.out.println("Player 2 wins");
break;
case DRAW:
System.out.println("Game Draw");
break;
... | repos\tutorials-master\algorithms-modules\algorithms-searching\src\main\java\com\baeldung\algorithms\mcts\tictactoe\Board.java | 1 |
请完成以下Java代码 | public boolean hasNext()
{
return !consumed;
}
@Override
public IScript next()
{
if (consumed)
{
throw new NoSuchElementException();
}
consumed = true;
return getScript();
} | private IScript getScript()
{
if (script == null)
{
final IScriptFactory scriptFactory = getScriptFactoryToUse();
script = scriptFactory.createScript(fileRef);
}
return script;
}
@Override
public String toString()
{
return "SingletonScriptScanner [fileRef=" + fileRef + "]";
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.migration\de.metas.migration.base\src\main\java\de\metas\migration\scanner\impl\SingletonScriptScanner.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static ReceivingTarget extractReceivingTarget(@NonNull final I_PP_Order_BOMLine ppOrderBOMLine)
{
final HuId luId = HuId.ofRepoIdOrNull(ppOrderBOMLine.getCurrent_Receiving_LU_HU_ID());
if (luId == null)
{
return null;
}
return ReceivingTarget.builder()
.luId(luId)
// TODO .tuId()
.tuPI... | supportingServices.saveOrderRouting(routing);
}
public void saveHeader(@NonNull final ManufacturingJob job)
{
final I_PP_Order ppOrder = getPPOrderRecordById(job.getPpOrderId());
ppOrder.setCurrentScaleDeviceId(job.getCurrentScaleDeviceId() != null ? job.getCurrentScaleDeviceId().getAsString() : null);
Interf... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing.rest-api\src\main\java\de\metas\manufacturing\job\service\ManufacturingJobLoaderAndSaver.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName == null ? null : productName.trim();
}
public String getMerchantOrderNo() {
return merchantOrderNo;
}
public void setMerchantOrderNo(String merchantOrderNo) {
this.merc... | return platProfit;
}
public void setPlatProfit(BigDecimal platProfit) {
this.platProfit = platProfit;
}
public String getPayWayCode() {
return payWayCode;
}
public void setPayWayCode(String payWayCode) {
this.payWayCode = payWayCode == null ? null : payWayCode.trim();
}
public String getPayWayName() {... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\entity\RpAccountCheckMistakeScratchPool.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Duration getIdleTimeout() {
return this.idleTimeout;
}
public void setIdleTimeout(Duration idleTimeout) {
this.idleTimeout = idleTimeout;
}
public int getMaxConnections() {
return this.maxConnections;
}
public void setMaxConnections(int maxConnections) {
this.maxConnections = maxConnections;
}
... | this.maxSessionsPerConnection = maxSessionsPerConnection;
}
public Duration getTimeBetweenExpirationCheck() {
return this.timeBetweenExpirationCheck;
}
public void setTimeBetweenExpirationCheck(Duration timeBetweenExpirationCheck) {
this.timeBetweenExpirationCheck = timeBetweenExpirationCheck;
}
public boo... | repos\spring-boot-4.0.1\module\spring-boot-jms\src\main\java\org\springframework\boot\jms\autoconfigure\JmsPoolConnectionFactoryProperties.java | 2 |
请完成以下Java代码 | public static byte[] decrypt(byte[] content, String aesTextKey) {
return decrypt(content, Objects.requireNonNull(aesTextKey).getBytes(DEFAULT_CHARSET));
}
/**
* 解密
*
* @param content 内容
* @param aesKey 密钥
* @return byte[]
*/
public static byte[] encrypt(byte[] content, byte[] aesKey) {
return aes(... | /**
* 提供基于PKCS7算法的加解密接口.
*/
private static class Pkcs7Encoder {
private static final int BLOCK_SIZE = 32;
private static byte[] encode(byte[] src) {
int count = src.length;
// 计算需要填充的位数
int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE);
// 获得补位所用的字符
byte pad = (byte) (amountToPad & 0xFF);
... | repos\SpringBlade-master\blade-gateway\src\main\java\org\springblade\gateway\utils\JwtCrypto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public List<DailyCollectAccountHistoryVo> listDailyCollectAccountHistoryVo(String accountNo, String statDate, Integer riskDay, Integer fundDirection) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("accountNo", accountNo);
params.put("statDate", statDate);
params.put("riskDay", riskDay... | * 分页参数.
* @param params
* 查询参数,可以为null.
* @return AccountHistoryList.
* @throws BizException
*/
public PageBean queryAccountHistoryListPage(PageParam pageParam, Map<String, Object> params) {
return rpAccountHistoryDao.listPage(pageParam, params);
}
/**
* 获取所有账户
* @return
... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\account\service\impl\RpAccountQueryServiceImpl.java | 2 |
请完成以下Java代码 | public void setMark3Percent (int Mark3Percent)
{
set_Value (COLUMNNAME_Mark3Percent, Integer.valueOf(Mark3Percent));
}
/** Get Mark 3 Percent.
@return Percentage up to this color is used
*/
public int getMark3Percent ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Mark3Percent);
if (ii == null)
re... | {
return new KeyNamePair(get_ID(), getName());
}
/** Set Color Schema.
@param PA_ColorSchema_ID
Performance Color Schema
*/
public void setPA_ColorSchema_ID (int PA_ColorSchema_ID)
{
if (PA_ColorSchema_ID < 1)
set_ValueNoCheck (COLUMNNAME_PA_ColorSchema_ID, null);
else
set_ValueNoChe... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_ColorSchema.java | 1 |
请完成以下Java代码 | private void deleteUserQuery(final I_AD_UserQuery userQuery)
{
if (userQuery == null)
{
// nothing to delete
return;
}
try
{
InterfaceWrapperHelper.delete(userQuery);
}
catch (final Exception e)
{
throw new AdempiereException("@DeleteError@: " + userQuery.getName(), e);
}
resetUserQue... | private int getAD_Tab_ID()
{
Check.assumeNotNull(adTabId, "adTabId not null");
return adTabId;
}
public Builder setAD_Table_ID(final int adTableId)
{
this.adTableId = adTableId;
return this;
}
private int getAD_Table_ID()
{
Check.assumeNotNull(adTableId, "adTableId not null");
Check.as... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\compiere\apps\search\UserQueryRepository.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.