instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public void recycle() { // clean out the object state operationType = null; entityType = null; } // getters / setters ////////////////////////////////////////// public Class<? extends DbEntity> getEntityType() { return entityType; } public void setEntityType(Class<? extends DbEntity> entity...
this.failure = failure; } public enum State { NOT_APPLIED, APPLIED, /** * Indicates that the operation was not performed for any reason except * concurrent modifications. */ FAILED_ERROR, /** * Indicates that the operation was not performed and that the reason * was...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\db\entitymanager\operation\DbOperation.java
1
请完成以下Java代码
public int getM_CostQueue_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_CostQueue_ID); if (ii == null) return 0; return ii.intValue(); } @Override public org.compiere.model.I_M_CostType getM_CostType() throws RuntimeException { return get_ValueAsPO(COLUMNNAME_M_CostType_ID, org.compiere.model....
} /** Set Produkt. @param M_Product_ID Produkt, Leistung, Artikel */ @Override public void setM_Product_ID (int M_Product_ID) { if (M_Product_ID < 1) set_ValueNoCheck (COLUMNNAME_M_Product_ID, null); else set_ValueNoCheck (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID)); } /** Get Pr...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_CostQueue.java
1
请完成以下Java代码
public class LastModifiedFileApp { public static File findUsingIOApi(String sdir) { File dir = new File(sdir); if (dir.isDirectory()) { Optional<File> opFile = Arrays.stream(dir.listFiles(File::isFile)) .max((f1, f2) -> Long.compare(f1.lastModified(), f2.lastModified())); ...
} public static File findUsingCommonsIO(String sdir) { File dir = new File(sdir); if (dir.isDirectory()) { File[] dirFiles = dir.listFiles((FileFilter) FileFilterUtils.fileFileFilter()); if (dirFiles != null && dirFiles.length > 0) { Arrays.sort(dirFiles, Las...
repos\tutorials-master\core-java-modules\core-java-io-3\src\main\java\com\baeldung\lastmodifiedfile\LastModifiedFileApp.java
1
请完成以下Java代码
private Set<InventoryId> getSelectedInventoryIds() { return retrieveSelectedRecordsQueryBuilder(I_M_Inventory.class) .create() .listIds() .stream() .map(InventoryId::ofRepoId) .collect(ImmutableSet.toImmutableSet()); } private void recomputeCosts( @NonNull final CostElement costElement, ...
private Instant getStartDate() { return inventoryDAO.getMinInventoryDate(getSelectedInventoryIds()) .orElseThrow(() -> new AdempiereException("Cannot determine Start Date")); } private List<CostElement> getCostElements() { if (p_costingMethod != null) { return costElementRepository.getMaterialCostingE...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\inventory\process\M_Inventory_RecomputeCosts.java
1
请完成以下Java代码
public static List<ClusterGroupEntity> wrapToClusterGroup(List<ClusterUniversalStatePairVO> list) { if (list == null || list.isEmpty()) { return new ArrayList<>(); } Map<String, ClusterGroupEntity> map = new HashMap<>(); for (ClusterUniversalStatePairVO stateVO : list) { ...
ClusterGroupEntity group = map.computeIfAbsent(targetServer, v -> new ClusterGroupEntity() .setBelongToApp(true).setMachineId(targetServer) .setIp(targetServer).setPort(targetPort) ); group.getClientSet().add(ip + '@' + ...
repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\util\ClusterEntityUtils.java
1
请完成以下Java代码
public static List<String> translateBatch(List<String> texts, String targetLanguage) { List<String> translationList = null; try { List<Translation> translations = translate.translate(texts, Translate.TranslateOption.targetLanguage(targetLanguage)); translationList = translations....
.setParent(parent.toString()) .setTargetLanguageCode(targetLanguage) .addContents(text) .setGlossaryConfig(TranslateTextGlossaryConfig.newBuilder() .setGlossary(glossaryName.toString()).build()) // Attach glossary .build(); ...
repos\tutorials-master\google-cloud\src\main\java\com\baeldung\google\cloud\translator\Translator.java
1
请在Spring Boot框架中完成以下Java代码
public String getProductDesc() { return productDesc; } public void setProductDesc(String productDesc) { this.productDesc = productDesc; } public String getRate() { return rate; } public void setRate(String rate) { this.rate = rate; } public String getC...
", subMchId='" + subMchId + '\'' + ", idCardCopy='" + idCardCopy + '\'' + ", idCardNational='" + idCardNational + '\'' + ", idCardName='" + idCardName + '\'' + ", idCardNumber='" + idCardNumber + '\'' + ", idCardValidTime='" + idCardValidTi...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\trade\entity\RpMicroSubmitRecord.java
2
请完成以下Java代码
public long getTimeSinceLastPoll() { return this.timeSinceLastPoll; } /** * The TopicPartitions the container is listening to. * @return the TopicPartition list. */ public @Nullable Collection<TopicPartition> getTopicPartitions() { return this.topicPartitions == null ? null : Collections.unmodifiableList(...
/** * Retrieve the consumer. Only populated if the listener is consumer-aware. * Allows the listener to resume a paused consumer. * @return the consumer. */ public Consumer<?, ?> getConsumer() { return this.consumer; } @Override public String toString() { return "NonResponsiveConsumerEvent [timeSinceLa...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\event\NonResponsiveConsumerEvent.java
1
请完成以下Java代码
public void onParameterChanged(final String parameterName) { if (PARAM_CostTypeId.equals(parameterName)) { final OrderCostType costType = p_costTypeId != null ? orderCostService.getCostTypeById(p_costTypeId) : null; p_CostCalculationMethod = costType != null ? costType.getCalculationMethod() : null; p_IsA...
} private ImmutableSet<OrderAndLineId> getSelectedOrderAndLineIds() { final OrderId orderId = getOrderId(); return getSelectedIncludedRecordIds(I_C_OrderLine.class) .stream() .map(orderLineRepoId -> OrderAndLineId.ofRepoIds(orderId, orderLineRepoId)) .collect(ImmutableSet.toImmutableSet()); } @Non...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\costs\C_Order_CreateCost.java
1
请在Spring Boot框架中完成以下Java代码
public int create(SmsHomeAdvertise advertise) { advertise.setClickCount(0); advertise.setOrderCount(0); return advertiseMapper.insert(advertise); } @Override public int delete(List<Long> ids) { SmsHomeAdvertiseExample example = new SmsHomeAdvertiseExample(); example....
public List<SmsHomeAdvertise> list(String name, Integer type, String endTime, Integer pageSize, Integer pageNum) { PageHelper.startPage(pageNum, pageSize); SmsHomeAdvertiseExample example = new SmsHomeAdvertiseExample(); SmsHomeAdvertiseExample.Criteria criteria = example.createCriteria(); ...
repos\mall-master\mall-admin\src\main\java\com\macro\mall\service\impl\SmsHomeAdvertiseServiceImpl.java
2
请完成以下Java代码
List<UserProfile> getUserProfiles(){ return userProfileDataAccessService.getUserProfile(); } @Async void uploadUserProfileImage(String userProfileId, MultipartFile multipartFile) throws Exception { final File file = convertMultiPartFileToFile(multipartFile); String extensi...
amazonS3Client.putObject(putObjectRequest); } private File convertMultiPartFileToFile(final MultipartFile multipartFile) throws Exception{ final File file = new File(multipartFile.getOriginalFilename()); try (final FileOutputStream outputStream = new FileOutputStream(file)) { ...
repos\Spring-Boot-Advanced-Projects-main\Project-4.SpringBoot-AWS-S3\backend\src\main\java\com\urunov\profile\UserProfileService.java
1
请在Spring Boot框架中完成以下Java代码
public Resource getLocation() { return this.location; } public void setLocation(Resource location) { this.location = location; } public Charset getEncoding() { return this.encoding; } public void setEncoding(Charset encoding) { this.encoding = encoding; } } /** * Git specific info pro...
public Resource getLocation() { return this.location; } public void setLocation(Resource location) { this.location = location; } public Charset getEncoding() { return this.encoding; } public void setEncoding(Charset encoding) { this.encoding = encoding; } } }
repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\info\ProjectInfoProperties.java
2
请完成以下Java代码
protected static class SimplePatternBasedHeaderMatcher implements HeaderMatcher { private static final LogAccessor LOGGER = new LogAccessor(LogFactory.getLog(SimplePatternBasedHeaderMatcher.class)); private final String pattern; private final boolean negate; protected SimplePatternBasedHeaderMatcher(Str...
public boolean matchHeader(String headerName) { String header = headerName.toLowerCase(Locale.ROOT); if (PatternMatchUtils.simpleMatch(this.pattern, header)) { LOGGER.debug(() -> MessageFormat.format( "headerName=[{0}] WILL " + (this.negate ? "NOT " : "") + "be mapped, matched pattern=...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\AbstractKafkaHeaderMapper.java
1
请完成以下Java代码
public void setAD_SchedulerRecipient_ID (int AD_SchedulerRecipient_ID) { if (AD_SchedulerRecipient_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_SchedulerRecipient_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_SchedulerRecipient_ID, Integer.valueOf(AD_SchedulerRecipient_ID)); } /** Get Empfänger. @return ...
public void setAD_User_ID (int AD_User_ID) { if (AD_User_ID < 0) set_Value (COLUMNNAME_AD_User_ID, null); else set_Value (COLUMNNAME_AD_User_ID, Integer.valueOf(AD_User_ID)); } /** Get Ansprechpartner. @return User within the system - Internal or Business Partner Contact */ @Override public int g...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_SchedulerRecipient.java
1
请完成以下Java代码
public WebuiLetter createNewLetter(final WebuiLetterBuilder createRequest) { final WebuiLetter letter = createRequest .letterId(String.valueOf(nextLetterId.getAndIncrement())) .build(); Check.assumeNotNull(letter.getOwnerUserId(), "ownerUserId is not null"); lettersById.put(letter.getLetterId(), new...
{ private WebuiLetter letter; public WebuiLetterEntry(@NonNull final WebuiLetter letter) { this.letter = letter; } public synchronized WebuiLetter getLetter() { return letter; } public synchronized WebuiLetterChangeResult compute(final UnaryOperator<WebuiLetter> modifier) { final WebuiLett...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\letter\WebuiLetterRepository.java
1
请完成以下Java代码
public int signum() {return source.signum();} public CurrencyId getSourceCurrencyId() {return source.getCurrencyId();} private MoneySourceAndAcct newOfSourceAndAcct(@NonNull final Money newSource, @NonNull final Money newAcct) { if (Money.equals(this.source, newSource) && Money.equals(this.acct, newAcct)) { ...
public MoneySourceAndAcct negate() { return newOfSourceAndAcct(source.negate(), acct.negate()); } public MoneySourceAndAcct negateIf(final boolean condition) { return condition ? negate() : this; } public MoneySourceAndAcct toZero() { return newOfSourceAndAcct(source.toZero(), acct.toZero()); } public...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\MoneySourceAndAcct.java
1
请完成以下Java代码
protected Mono<Health> doHealthCheck(Health.Builder builder) { return runHealthCheckQuery() .doOnError(SessionExpiredException.class, (ex) -> logger.warn(Neo4jHealthIndicator.MESSAGE_SESSION_EXPIRED)) .retryWhen(Retry.max(1).filter(SessionExpiredException.class::isInstance)) .map((healthDetails) -> { thi...
*/ private static final class Neo4jHealthDetailsBuilder { private @Nullable Record record; void record(Record record) { this.record = record; } private Neo4jHealthDetails build(ResultSummary summary) { Assert.state(this.record != null, "'record' must not be null"); return new Neo4jHealthDetails(thi...
repos\spring-boot-4.0.1\module\spring-boot-neo4j\src\main\java\org\springframework\boot\neo4j\health\Neo4jReactiveHealthIndicator.java
1
请完成以下Java代码
public void setName(String value) { set(1, value); } /** * Getter for <code>public.BookAuthor.name</code>. */ public String getName() { return (String) get(1); } /** * Setter for <code>public.BookAuthor.country</code>. */ public void setCountry(String value)...
// Constructors // ------------------------------------------------------------------------- /** * Create a detached BookauthorRecord */ public BookauthorRecord() { super(Bookauthor.BOOKAUTHOR); } /** * Create a detached, initialised BookauthorRecord */ public Booka...
repos\tutorials-master\persistence-modules\jooq\src\main\java\com\baeldung\jooq\jointables\public_\tables\records\BookauthorRecord.java
1
请完成以下Java代码
public Timestamp getDateFrom () { return (Timestamp)get_Value(COLUMNNAME_DateFrom); } /** Set Date To. @param DateTo End date of a date range */ public void setDateTo (Timestamp DateTo) { set_Value (COLUMNNAME_DateTo, DateTo); } /** Get Date To. @return End date of a date range */ public Tim...
if (S_Resource_ID < 1) set_ValueNoCheck (COLUMNNAME_S_Resource_ID, null); else set_ValueNoCheck (COLUMNNAME_S_Resource_ID, Integer.valueOf(S_Resource_ID)); } /** Get Resource. @return Resource */ public int getS_Resource_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_S_Resource_ID); if (ii ...
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 String getURI() { return uri; } /** * Sets the value of the uri property. * * @param value * allowed object is * {@link String } * */ public void setURI(String value) { this.uri = value; } /** * Gets the value of the type...
return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } }
repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_440_request\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_440\request\RetrievalMethodType.java
1
请完成以下Java代码
private List<TableRecordReference> extractTableRecordReferences(@NonNull final JsonAttachmentRequest request) { final ImmutableList.Builder<TableRecordReference> tableRecordReferenceBuilder = ImmutableList.builder(); request.getTargets() .stream() .map(target -> extractTableRecordReference(request.getOrgC...
if (!url.getProtocol().equals("file")) { throw new AdempiereException("Protocol " + url.getProtocol() + " not supported!"); } final Path filePath = FileUtil.getFilePath(url); if (!filePath.toFile().isFile()) { throw new AdempiereException("Provided local file with URL: " + url + " is not accessible!")...
repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\v2\attachment\AttachmentRestService.java
1
请在Spring Boot框架中完成以下Java代码
public BigDecimal getQtyEnteredInBPartnerUOM() { return qtyEnteredInBPartnerUOM; } /** * Sets the value of the qtyEnteredInBPartnerUOM property. * * @param value * allowed object is * {@link BigDecimal } * */ public void setQtyEnteredInBPartnerUOM(Bi...
} /** * Sets the value of the externalSeqNo property. * * @param value * allowed object is * {@link BigInteger } * */ public void setExternalSeqNo(BigInteger value) { this.externalSeqNo = value; } }
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_metasfreshinhousev1\de\metas\edi\esb\jaxb\metasfreshinhousev1\EDICctopInvoic500VType.java
2
请完成以下Java代码
public String toString() { return getSql(); } @Override public String getSql() { buildSqlIfNeeded(); return sqlWhereClause; } @Override public List<Object> getSqlParams(final Properties ctx_NOTUSED) { return getSqlParams(); } public List<Object> getSqlParams() { buildSqlIfNeeded(); return sql...
} else { sqlParams = Arrays.asList(lowerBoundValue, upperBoundValue); sqlWhereClause = "NOT ISEMPTY(" + "TSTZRANGE(" + lowerBoundColumnName.getColumnName() + ", " + upperBoundColumnName.getColumnName() + ", '[)')" + " * " + "TSTZRANGE(?, ?, '[)')" + ")"; } } private boolean isConstant...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\DateIntervalIntersectionQueryFilter.java
1
请完成以下Java代码
public boolean isDate() { if (m_displayType == 0) return m_value instanceof Timestamp; return DisplayType.isDate(m_displayType); } // isDate /** * Is Value an ID * @return true if value is an ID */ public boolean isID() { // ID columns are considered numbers - teo_sarca [ 1673363 ] if (DisplayT...
} // equals /** * String representation * @return info */ public String toString() { StringBuffer sb = new StringBuffer(m_columnName).append("=").append(m_value); if (m_isPKey) sb.append("(PK)"); return sb.toString(); } // toString /** * Value Has Key * @return true if value has a key */...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\PrintDataElement.java
1
请完成以下Java代码
public void setM_AttributeSearch(final org.compiere.model.I_M_AttributeSearch M_AttributeSearch) { set_ValueFromPO(COLUMNNAME_M_AttributeSearch_ID, org.compiere.model.I_M_AttributeSearch.class, M_AttributeSearch); } @Override public void setM_AttributeSearch_ID (final int M_AttributeSearch_ID) { if (M_Attribu...
return get_ValueAsString(COLUMNNAME_Value); } @Override public void setValueMax (final @Nullable BigDecimal ValueMax) { set_Value (COLUMNNAME_ValueMax, ValueMax); } @Override public BigDecimal getValueMax() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_ValueMax); return bd != null ? bd : Big...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Attribute.java
1
请完成以下Java代码
public void setC_Channel_ID (int C_Channel_ID) { if (C_Channel_ID < 1) set_ValueNoCheck (COLUMNNAME_C_Channel_ID, null); else set_ValueNoCheck (COLUMNNAME_C_Channel_ID, Integer.valueOf(C_Channel_ID)); } /** Get Channel. @return Sales Channel */ public int getC_Channel_ID () { Integer ii = (Int...
@param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifier of the entity */ public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Channel.java
1
请完成以下Java代码
public BigDecimal getManualActual () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ManualActual); if (bd == null) return Env.ZERO; return bd; } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /...
return 0; return ii.intValue(); } public I_PA_Measure getPA_Measure() throws RuntimeException { return (I_PA_Measure)MTable.get(getCtx(), I_PA_Measure.Table_Name) .getPO(getPA_Measure_ID(), get_TrxName()); } /** Set Measure. @param PA_Measure_ID Concrete Performance Measurement */ public void s...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_Achievement.java
1
请完成以下Java代码
protected EngineClientException exceptionWhileReceivingResponse(HttpRequest httpRequest, RestException e) { return new EngineClientException(exceptionMessage( "001", "Request '{}' returned error: status code '{}' - message: {}", httpRequest, e.getHttpStatusCode(), e.getMessage()), e); } protected EngineC...
return new EngineClientException(exceptionMessage( "006", "Exception while deserializing json object to response dto class '{}'", responseDtoClass), t); } protected <D extends RequestDto> EngineClientException exceptionWhileSerializingJsonObject(D dto, Throwable t) { return new EngineClientException(exce...
repos\camunda-bpm-platform-master\clients\java\client\src\main\java\org\camunda\bpm\client\impl\EngineClientLogger.java
1
请在Spring Boot框架中完成以下Java代码
public class MultiCustomerHUReturnsResult { @NonNull @Singular ImmutableList<CustomerHUReturnsResult> items; public List<I_M_InOut> getCustomerReturns() { return items.stream().map(CustomerHUReturnsResult::getCustomerReturn).collect(Collectors.toList()); } public Set<HuId> getReturnedHUIds() { return items....
@NonNull I_M_InOut customerReturn; @NonNull List<I_M_HU> returnedHUs; private Stream<HuId> streamReturnedHUIds() { return streamReturnedHUs().map(returnedHU -> HuId.ofRepoId(returnedHU.getM_HU_ID())); } private Stream<I_M_HU> streamReturnedHUs() { return returnedHUs.stream(); } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\inout\returns\customer\MultiCustomerHUReturnsResult.java
2
请在Spring Boot框架中完成以下Java代码
public class QuoteCriteria implements Serializable { private static final long serialVersionUID = 1L; private LongFilter id; private StringFilter symbol; private BigDecimalFilter price; private ZonedDateTimeFilter lastTrade; public QuoteCriteria() { } public LongFilter getId() { ...
if (o == null || getClass() != o.getClass()) { return false; } final QuoteCriteria that = (QuoteCriteria) o; return Objects.equals(id, that.id) && Objects.equals(symbol, that.symbol) && Objects.equals(price, that.price) && Objects.equal...
repos\tutorials-master\jhipster-modules\jhipster-uaa\quotes\src\main\java\com\baeldung\jhipster\quotes\service\dto\QuoteCriteria.java
2
请在Spring Boot框架中完成以下Java代码
public void savaMenu(PmsMenu menu) { pmsMenuDao.insert(menu); } /** * 根据父菜单ID获取该菜单下的所有子孙菜单.<br/> * * @param parentId * (如果为空,则为获取所有的菜单).<br/> * @return menuList. */ @SuppressWarnings("rawtypes") public List getListByParent(Long parentId) { return pmsMenuDao.listByParent(parentId); } ...
* 节点名称 * @return */ public List<PmsMenu> getMenuByNameAndIsLeaf(Map<String, Object> map) { return pmsMenuDao.getMenuByNameAndIsLeaf(map); } /** * 根据菜单ID获取菜单. * * @param pid * @return */ public PmsMenu getById(Long pid) { return pmsMenuDao.getById(pid); } /** * 更新菜单. * * @par...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\service\impl\PmsMenuServiceImpl.java
2
请完成以下Java代码
public DeploymentEntity findLatestDeploymentByName(String deploymentName) { List<?> list = getDbEntityManager().selectList("selectDeploymentsByName", deploymentName, 0, 1); if (list!=null && !list.isEmpty()) { return (DeploymentEntity) list.get(0); } return null; } public DeploymentEntity fin...
@Override public void flush() { } // helper ///////////////////////////////////////////////// protected void createDefaultAuthorizations(DeploymentEntity deployment) { if(isAuthorizationEnabled()) { ResourceAuthorizationProvider provider = getResourceAuthorizationProvider(); AuthorizationEntit...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\DeploymentManager.java
1
请完成以下Java代码
public class BM25 { /** * 文档句子的个数 */ int D; /** * 文档句子的平均长度 */ double avgdl; /** * 拆分为[句子[单词]]形式的文档 */ List<List<String>> docs; /** * 文档中每个句子中的每个词与词频 */ Map<String, Integer>[] f; /** * 文档中全部词语与出现在几个句子中 */ Map<String, Integer> ...
for (Map.Entry<String, Integer> entry : df.entrySet()) { String word = entry.getKey(); Integer freq = entry.getValue(); idf.put(word, Math.log(D - freq + 0.5) - Math.log(freq + 0.5)); } } /** * 计算一个句子与一个文档的BM25相似度 * * @param sentence 句子(查询语句) ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\summary\BM25.java
1
请完成以下Java代码
public class NERTagSet extends TagSet { public final String O_TAG = "O"; public final char O_TAG_CHAR = 'O'; public final String B_TAG_PREFIX = "B-"; public final char B_TAG_CHAR = 'B'; public final String M_TAG_PREFIX = "M-"; public final String E_TAG_PREFIX = "E-"; public final String S_TA...
return tag.substring(index + 1); } @Override public boolean load(ByteArray byteArray) { super.load(byteArray); nerLabels.clear(); for (Map.Entry<String, Integer> entry : this) { String tag = entry.getKey(); int index = tag.indexOf('-'); ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\perceptron\tagset\NERTagSet.java
1
请完成以下Java代码
public int getC_PaymentTerm_ID() { return get_ValueAsInt(COLUMNNAME_C_PaymentTerm_ID); } @Override public void setC_PaySchedule_ID (final int C_PaySchedule_ID) { if (C_PaySchedule_ID < 1) set_ValueNoCheck (COLUMNNAME_C_PaySchedule_ID, null); else set_ValueNoCheck (COLUMNNAME_C_PaySchedule_ID, C_Pay...
/** Sunday = 7 */ public static final String NETDAY_Sunday = "7"; /** Monday = 1 */ public static final String NETDAY_Monday = "1"; /** Tuesday = 2 */ public static final String NETDAY_Tuesday = "2"; /** Wednesday = 3 */ public static final String NETDAY_Wednesday = "3"; /** Thursday = 4 */ public static final...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_PaySchedule.java
1
请完成以下Java代码
public static void deleteScheduledSelections() { final ITrxManager trxManager = Services.get(ITrxManager.class); final int maxQuerySelectionToDeleteToProcess = 1; boolean tryRemove = true; while (tryRemove) { final boolean removedSomething = trxManager.callInNewTrx(() -> deleteScheduledSelections0(maxQue...
} // Delete from T_Query_Selection_Pagination { final int count = queryBL.createQueryBuilder(I_T_Query_Selection_Pagination.class) .addInSubQueryFilter( I_T_Query_Selection_Pagination.COLUMN_UUID, I_T_Query_Selection_ToDelete.COLUMN_UUID, selectionToDeleteQuery) .create() .de...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\dao\selection\QuerySelectionToDeleteHelper.java
1
请完成以下Java代码
public static long getTimeDiff(Date date1, Date date2){ if (date1 == null || date1 == null) { return 0L; } long diff = (date1.getTime() - date2.getTime()) > 0 ? (date1.getTime() - date2 .getTime()) : (date2.getTime() - date1.getTime()) ; return diff; } /* * 判断两个时间是不是在一个周中 */ public static boolea...
* 获取几天内日期 return 2014-5-4、2014-5-3 */ public static List<String> getLastDays(int countDay) { List<String> listDate = new ArrayList<String>(); for (int i = 0; i < countDay; i++) { listDate.add(DateUtils.getReqDateyyyyMMdd(DateUtils.getDate(-i))); } return listDate; } /** * 对时间进行格式化 * * @param dat...
repos\roncoo-pay-master\roncoo-pay-common-core\src\main\java\com\roncoo\pay\common\core\utils\DateUtils.java
1
请完成以下Java代码
public class POReplicationTrxLineDraft { private final PO poDraft; private final I_EXP_ReplicationTrxLine trxLineDraft; private final boolean lookup; /** * Creates a POReplicationTrxLineDraft with <code>trxLine=null</code> and <code>doLookup=false</code> * * @param po */ public POReplicationTrxLineDraft(f...
public PO getPODraft() { return poDraft; } public I_EXP_ReplicationTrxLine getTrxLineDraftOrNull() { return trxLineDraft; } public boolean isDoLookup() { return lookup; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\server\rpl\trx\api\impl\POReplicationTrxLineDraft.java
1
请完成以下Java代码
public Criteria andMemberLevelNotBetween(Integer value1, Integer value2) { addCriterion("member_level not between", value1, value2, "memberLevel"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { sup...
public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object v...
repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\SmsCouponExample.java
1
请完成以下Java代码
public List<I_M_DeliveryDay> retrieveDeliveryDays(final I_M_Tour tour, final Timestamp deliveryDate) { final IQueryBL queryBL = Services.get(IQueryBL.class); final IQueryBuilder<I_M_DeliveryDay> queryBuilder = queryBL.createQueryBuilder(I_M_DeliveryDay.class, tour) .addEqualsFilter(I_M_DeliveryDay.COLUMN_M_To...
.addEqualsFilter(I_M_DeliveryDay_Alloc.COLUMN_Record_ID, recordId) .addOnlyActiveRecordsFilter() .create() .firstOnly(I_M_DeliveryDay_Alloc.class); } @Override public boolean hasAllocations(final I_M_DeliveryDay deliveryDay) { Check.assumeNotNull(deliveryDay, "deliveryDay not null"); return Servic...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\tourplanning\api\impl\DeliveryDayDAO.java
1
请完成以下Java代码
public String[] tag(String... words) { POSInstance instance = new POSInstance(words, model.featureMap); return tag(instance); } public String[] tag(POSInstance instance) { instance.tagArray = new int[instance.featureMatrix.length]; model.viterbiDecode(instance, instance...
/** * 在线学习 * * @param wordTags [单词]/[词性]数组 * @return 是否学习成功(失败的原因是参数错误) */ public boolean learn(String... wordTags) { String[] words = new String[wordTags.length]; String[] tags = new String[wordTags.length]; for (int i = 0; i < wordTags.length; i++) { ...
repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\perceptron\PerceptronPOSTagger.java
1
请在Spring Boot框架中完成以下Java代码
public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws BeansException { Class<?> contextSourceClass = getContextSourceClass(); String[] sources = bf.getBeanNamesForType(contextSourceClass, false, false); if (sources.length == 0) { throw new ApplicationContextException("No BaseLdapPathCon...
+ " If you are using LDAP with Spring Security, please ensure that you include the spring-ldap " + "jar file in your application", ex); } } public void setDefaultNameRequired(boolean defaultNameRequired) { this.defaultNameRequired = defaultNameRequired; } @Override public int getOrder() { return LOWES...
repos\spring-security-main\config\src\main\java\org\springframework\security\config\ldap\ContextSourceSettingPostProcessor.java
2
请完成以下Java代码
public ReferenceWalker<T> addPreVisitor(TreeVisitor<T> collector) { this.preVisitor.add(collector); return this; } public ReferenceWalker<T> addPostVisitor(TreeVisitor<T> collector) { this.postVisitor.add(collector); return this; } public T walkWhile() { return walkWhile(new ReferenceWalke...
collector.visit(getCurrentElement()); } } while (!condition.isFulfilled(getCurrentElement())); return getCurrentElement(); } public T getCurrentElement() { return currentElements.isEmpty() ? null : currentElements.get(0); } public interface WalkCondition<S> { boolean isFulfilled(S elemen...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\tree\ReferenceWalker.java
1
请完成以下Java代码
public List<JSONObject> queryUserBySuperQuery(String superQuery, String matchType) { return null; } @Override public JSONObject queryUserById(String id) { return null; } @Override public List<JSONObject> queryDeptBySuperQuery(String superQuery, String matchType) { retur...
public boolean dictTableWhiteListCheckBySql(String selectSql) { return false; } @Override public boolean dictTableWhiteListCheckByDict(String tableOrDictCode, String... fields) { return false; } @Override public void announcementAutoRelease(String dataId, String currentUserName...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-api\jeecg-system-cloud-api\src\main\java\org\jeecg\common\system\api\fallback\SysBaseAPIFallback.java
1
请完成以下Java代码
public void onSuccess(TsKvLatestRemovingResult result) { log.trace("removeLatest onSuccess [{}][{}][{}]", entityId, query.getKey(), query); } @Override public void onFailure(Throwable t) { log.info("removeLatest onFailure [{}][{}][...
return Futures.immediateFuture(Optional.ofNullable(tsKvEntry)); } log.debug("findLatest cache miss [{}][{}]", entityId, key); ListenableFuture<Optional<TsKvEntry>> daoFuture = sqlDao.findLatestOpt(tenantId, entityId, key); return Futures.transform(daoFuture, daoValue -> ...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sqlts\CachedRedisSqlTimeseriesLatestDao.java
1
请完成以下Java代码
void setObserver(Runnable observer) { this.observer = observer; } private Object tryConsume(MethodInvocation invocation, Consumer<MessageAndChannel> successHandler, BiConsumer<MessageAndChannel, Throwable> errorHandler) throws Throwable { MessageAndChannel mac = new MessageAndChannel((Message) ...
MessageProperties props = m.getMessageProperties(); props.setExpiration(String.valueOf(retryQueues.getTimeToWait(retryCount))); props.setHeader("x-retried-count", String.valueOf(retryCount + 1)); props.setHeader("x-original-exchange", props.getReceivedExchange()); props.s...
repos\tutorials-master\messaging-modules\spring-amqp\src\main\java\com\baeldung\springamqp\exponentialbackoff\RetryQueuesInterceptor.java
1
请在Spring Boot框架中完成以下Java代码
public String getNotifyRule() { return notifyRule; } /** 通知规则 */ public void setNotifyRule(String notifyRule) { this.notifyRule = notifyRule; } /** * 获取通知规则的Map<String, Integer>. * @return */ @SuppressWarnings({ "unchecked", "rawtypes" }) public Map<Integer, ...
/** 通知次数 **/ public void setNotifyTimes(Integer notifyTimes) { this.notifyTimes = notifyTimes; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } /** 限制通知次数 **/ public Integer getLim...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\notify\entity\RpOrderResultQueryVo.java
2
请完成以下Java代码
protected String getHealthPath(ServiceInstance instance) { String healthPath = getMetadataValue(instance, KEYS_HEALTH_PATH); if (hasText(healthPath)) { return healthPath; } return this.healthEndpointPath; } protected URI getManagementUrl(ServiceInstance instance) { URI serviceUrl = this.getServiceUrl(in...
protected int getManagementPort(ServiceInstance instance) { String managementPort = getMetadataValue(instance, KEYS_MANAGEMENT_PORT); if (hasText(managementPort)) { return Integer.parseInt(managementPort); } return getServiceUrl(instance).getPort(); } protected String getManagementPath(ServiceInstance ins...
repos\spring-boot-admin-master\spring-boot-admin-server-cloud\src\main\java\de\codecentric\boot\admin\server\cloud\discovery\DefaultServiceInstanceConverter.java
1
请完成以下Java代码
String getShowHelp(final Supplier<String> defaultValueSupplier) { return showHelp != null ? showHelp : defaultValueSupplier.get(); } ProcessDialogBuilder skipResultsPanel() { skipResultsPanel = true; return this; } boolean isSkipResultsPanel() { return skipResultsPanel; } public ProcessDialogBuilder...
this.processExecutionListener = processExecutionListener; return this; } IProcessExecutionListener getProcessExecutionListener() { return processExecutionListener; } public ProcessDialogBuilder setPrintPreview(final boolean printPreview) { this._printPreview = printPreview; return this; } boolean isP...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\process\ui\ProcessDialogBuilder.java
1
请完成以下Java代码
public static IndentingWriterFactory create(Function<Integer, String> defaultIndentingStrategy) { return new IndentingWriterFactory(new Builder(defaultIndentingStrategy)); } /** * Create a {@link IndentingWriterFactory}. * @param defaultIndentingStrategy the default indenting strategy to use * @param factory...
this.defaultIndentingStrategy = defaultIndentingStrategy; } /** * Register an indenting strategy for the specified content. * @param contentId the identifier of the content to configure * @param indentingStrategy the indent strategy for that particular content * @return this for method chaining * @s...
repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\io\IndentingWriterFactory.java
1
请完成以下Java代码
public class VariableListenerSession implements Session { protected CommandContext commandContext; protected Map<String, List<VariableListenerSessionData>> variableData; public void addVariableData(String variableName, String changeType, String scopeId, String scopeType, String scopeDefinitionId)...
@Override public void flush() { } @Override public void close() { } public Map<String, List<VariableListenerSessionData>> getVariableData() { return variableData; } public void setVariableData(Map<String, List<VariableListenerSessionData>> variableData) { this.variab...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\variablelistener\VariableListenerSession.java
1
请完成以下Java代码
public class SocialUser { @Getter private String username; @Getter private List<SocialUser> followers; public SocialUser(String username) { super(); this.username = username; this.followers = new ArrayList<>(); } public SocialUser(String username, List<SocialUser> foll...
} public long getFollowersCount() { return followers.size(); } public void addFollowers(List<SocialUser> followers) { this.followers.addAll(followers); } @Override public boolean equals(Object obj) { return ((SocialUser) obj).getUsername().equals(username);...
repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-6\src\main\java\com\baeldung\algorithms\greedy\SocialUser.java
1
请完成以下Java代码
public java.lang.String getStackTrace() { return get_ValueAsString(COLUMNNAME_StackTrace); } @Override public void setStatisticsInfo (final @Nullable java.lang.String StatisticsInfo) { set_ValueNoCheck (COLUMNNAME_StatisticsInfo, StatisticsInfo); } @Override public java.lang.String getStatisticsInfo() ...
@Override public java.lang.String getSystemStatus() { return get_ValueAsString(COLUMNNAME_SystemStatus); } @Override public void setUserAgent (final @Nullable java.lang.String UserAgent) { set_Value (COLUMNNAME_UserAgent, UserAgent); } @Override public java.lang.String getUserAgent() { return get_Val...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Issue.java
1
请完成以下Java代码
public int getM_Shipper_ID() { return get_ValueAsInt(COLUMNNAME_M_Shipper_ID); } @Override public void setM_ShipperTransportation_ID (final int M_ShipperTransportation_ID) { if (M_ShipperTransportation_ID < 1) set_Value (COLUMNNAME_M_ShipperTransportation_ID, null); else set_Value (COLUMNNAME_M_Shi...
public java.lang.String getPackageDescription() { return get_ValueAsString(COLUMNNAME_PackageDescription); } @Override public void setPdfLabelData (final @Nullable byte[] PdfLabelData) { set_Value (COLUMNNAME_PdfLabelData, PdfLabelData); } @Override public byte[] getPdfLabelData() { return (byte[])ge...
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dhl\src\main\java-gen\de\metas\shipper\gateway\dhl\model\X_DHL_ShipmentOrder.java
1
请完成以下Java代码
public Object invoke(Message<?> message, @Nullable Object... providedArgs) throws Exception { //NOSONAR if (this.invokerHandlerMethod != null) { return this.invokerHandlerMethod.invoke(message, providedArgs); // NOSONAR } else if (Objects.requireNonNull(this.delegatingHandler).hasDefaultHandler()) { // Need...
} } public Object getBean() { if (this.invokerHandlerMethod != null) { return this.invokerHandlerMethod.getBean(); } else { return Objects.requireNonNull(this.delegatingHandler).getBean(); } } @Nullable public InvocationResult getInvocationResultFor(Object result, @Nullable Object inboundPayload) {...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\listener\adapter\HandlerAdapter.java
1
请完成以下Java代码
private static HUQRCodeProductInfo fromJson(@Nullable final JsonHUQRCodeProductInfoV1 json) { if (json == null) { return null; } return HUQRCodeProductInfo.builder() .id(json.getId()) .code(json.getCode()) .name(json.getName()) .build(); } private static JsonHUQRCodeAttributeV1 toJson(@N...
// we will set valueRendered only if it's different from value. .valueRendered( !Objects.equals(attribute.getValue(), attribute.getValueRendered()) ? attribute.getValueRendered() : null) .build(); } private static HUQRCodeAttribute fromJson(@NonNull final JsonHUQRCodeAttributeV1 json) ...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\qrcodes\model\json\v1\JsonConverterV1.java
1
请完成以下Java代码
public boolean apply(IAllocableDocRow row) { return !row.isTaboo(); } }; Ordering<IAllocableDocRow> ORDERING_DocumentDate_DocumentNo = new Ordering<IAllocableDocRow>() { @Override public int compare(IAllocableDocRow row1, IAllocableDocRow row2) { return ComparisonChain.start() .compare(row1.get...
* </ul> */ void setTaboo(boolean taboo); /** @return document's date */ Date getDocumentDate(); // task 09643: separate the accounting date from the transaction date Date getDateAcct(); int getC_BPartner_ID(); /** @return AP Multiplier, i.e. Vendor=-1, Customer=+1 */ BigDecimal getMultiplierAP...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.swingui\src\main\java\de\metas\banking\payment\paymentallocation\model\IAllocableDocRow.java
1
请完成以下Java代码
private ViewRowIdsOrderedSelections addRemoveChangedRows( @NonNull final ViewRowIdsOrderedSelections selections, @NonNull final Set<DocumentId> rowIds, @NonNull final AddRemoveChangedRowIdsCollector changesCollector) { final ViewRowIdsOrderedSelection defaultSelectionBeforeFacetsFiltering = viewDataReposito...
final ViewEvaluationCtx viewEvaluationCtx = getViewEvaluationCtx(); final SqlDocumentFilterConverterContext filterConverterContext = SqlDocumentFilterConverterContext.builder() .userRolePermissionsKey(viewEvaluationCtx.getPermissionsKey()) .build(); return viewDataRepository.createOrderedSelectionFromSelec...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\ViewRowIdsOrderedSelectionsHolder.java
1
请在Spring Boot框架中完成以下Java代码
public class DemoApplicationConfiguration { private Logger logger = LoggerFactory.getLogger(DemoApplicationConfiguration.class); @Bean public UserDetailsService myUserDetailsService() { InMemoryUserDetailsManager inMemoryUserDetailsManager = new InMemoryUserDetailsManager(); String[][] us...
user[0], passwordEncoder().encode(user[1]), authoritiesStrings .stream() .map(s -> new SimpleGrantedAuthority(s)) .collect(Collectors.toList()) ) ); } return inMem...
repos\Activiti-develop\activiti-examples\activiti-api-basic-connector-example\src\main\java\org\activiti\examples\DemoApplicationConfiguration.java
2
请完成以下Java代码
public PrintPackage getPrintPackage() { return printPackage; } public PrintPackageInfo getPrintPackageInfo() { return printPackageInfo; } public PrintRequestAttributeSet getAttributes() { return attributes; } public String getPrintJobName() { return printJobName; } public void setPrintJobName(fi...
public void setPrintable(final Printable printable) { this.printable = printable; } public int getNumPages() { return numPages; } public void setNumPages(final int numPages) { this.numPages = numPages; } @Override public String toString() { return "PrintPackageRequest [" + "printPackage=" + pr...
repos\metasfresh-new_dawn_uat\backend\de.metas.printing.client\src\main\java\de\metas\printing\client\engine\PrintPackageRequest.java
1
请完成以下Java代码
public void sendAppChatSocket(String userId) { } @Override public String getRoleCodeById(String id) { return null; } @Override public List<DictModel> queryRoleDictByCode(String roleCodes) { return null; } @Override public List<JSONObject> queryUserBySuperQ...
public List<String> queryUsernameByDepartPositIds(List<String> positionIds) { return null; } @Override public List<String> queryUserIdsByPositionIds(List<String> positionIds) { return null; } @Override public List<String> getUserAccountsByDepCode(String orgCode) { retur...
repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-api\jeecg-system-cloud-api\src\main\java\org\jeecg\common\system\api\fallback\SysBaseAPIFallback.java
1
请完成以下Java代码
public List<VariableInstanceEntity> findVariableInstancesByExecutionIdAndVariableNames(String executionId, Collection<String> variableNames) { Map<String, Object> parameter = new HashMap<String, Object>(); parameter.put("executionId", executionId); parameter.put("variableNames", variableNames); return g...
return (Long) getDbEntityManager().selectOne("selectVariableInstanceCountByQueryCriteria", variableInstanceQuery); } @SuppressWarnings("unchecked") public List<VariableInstance> findVariableInstanceByQueryCriteria(VariableInstanceQueryImpl variableInstanceQuery, Page page) { configureQuery(variableInstanceQu...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\VariableInstanceManager.java
1
请完成以下Java代码
protected void configureScriptEngines(String language, ScriptEngine scriptEngine) { if (ScriptingEngines.GROOVY_SCRIPTING_LANGUAGE.equals(language)) { configureGroovyScriptEngine(scriptEngine); } if (ScriptingEngines.GRAAL_JS_SCRIPT_ENGINE_NAME.equals(scriptEngine.getFactory().getEngineName())) { ...
ProcessEngineConfigurationImpl config = Context.getProcessEngineConfiguration(); if (config != null) { if (config.isConfigureScriptEngineHostAccess()) { // make sure Graal JS can provide access to the host and can lookup classes scriptEngine.getContext().setAttribute("polyglot.js.allowHostAcce...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\scripting\engine\DefaultScriptEngineResolver.java
1
请在Spring Boot框架中完成以下Java代码
private Optional<JsonOrderPaymentCreateRequest> buildOrderPaymentCreateRequest(@NonNull final ImportOrdersRouteContext context) { final JsonPaymentMethod paymentMethod = context.getCompositeOrderNotNull().getJsonPaymentMethod(); final JsonOrderTransaction orderTransaction = context.getCompositeOrderNotNull().getOr...
final String currencyCode = context.getCurrencyInfoProvider().getIsoCodeByCurrencyIdNotNull(order.getCurrencyId()); final String bPartnerIdentifier = context.getBPExternalIdentifier().getIdentifier(); return Optional.of(JsonOrderPaymentCreateRequest.builder() .orgCode(context.getOrgCode()) ....
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-shopware6\src\main\java\de\metas\camel\externalsystems\shopware6\order\processor\PaymentRequestProcessor.java
2
请完成以下Java代码
public TrackData1 createTrackData1() { return new TrackData1(); } /** * Create an instance of {@link TransactionAgents3 } * */ public TransactionAgents3 createTransactionAgents3() { return new TransactionAgents3(); } /** * Create an instance of {@link Transacti...
} /** * Create an instance of {@link TransactionQuantities2Choice } * */ public TransactionQuantities2Choice createTransactionQuantities2Choice() { return new TransactionQuantities2Choice(); } /** * Create an instance of {@link TransactionReferences3 } * */ ...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\ObjectFactory.java
1
请完成以下Java代码
public Queue findQueueByTenantIdAndTopic(TenantId tenantId, String topic) { return DaoUtil.getData(queueRepository.findByTenantIdAndTopic(tenantId.getId(), topic)); } @Override public Queue findQueueByTenantIdAndName(TenantId tenantId, String name) { return DaoUtil.getData(queueRepository.f...
public List<Queue> findAllQueues() { List<QueueEntity> entities = Lists.newArrayList(queueRepository.findAll()); return DaoUtil.convertDataList(entities); } @Override public PageData<Queue> findQueuesByTenantId(TenantId tenantId, PageLink pageLink) { return DaoUtil.toPageData(queueR...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\queue\JpaQueueDao.java
1
请在Spring Boot框架中完成以下Java代码
public class DataEntry_Section { public DataEntry_Section() { Services.get(IProgramaticCalloutProvider.class).registerAnnotatedCallout(this); } @ModelChange(timings = ModelValidator.TYPE_BEFORE_DELETE) public void deleteChildRecords(@NonNull final I_DataEntry_Section dataEntrySectionRecord) { Services.get(IQ...
if (dataEntrySectionRecord.getDataEntry_SubTab_ID() <= 0) { return; } dataEntrySectionRecord.setSeqNo(maxSeqNo(dataEntrySectionRecord) + 10); } private int maxSeqNo(@NonNull final I_DataEntry_Section dataEntrySectionRecord) { return Services .get(IQueryBL.class) .createQueryBuilder(I_DataEntry_Se...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\dataentry\layout\interceptor\DataEntry_Section.java
2
请完成以下Java代码
public class MaterialTrackingReportBL implements IMaterialTrackingReportBL { @Override public I_M_Material_Tracking_Report_Line createMaterialTrackingReportLine(final I_M_Material_Tracking_Report report, final I_M_InOutLine iol, final String lineAggregationKey) { final I_M_Material_Tracking_Report_Line newLine =...
return resultASI; } @Override public void createMaterialTrackingReportLineAllocation(final I_M_Material_Tracking_Report_Line reportLine, final MaterialTrackingReportAgregationItem items) { final I_M_Material_Tracking_Report_Line_Alloc alloc = InterfaceWrapperHelper.newInstance(I_M_Material_Tracking_Report_Lin...
repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java\de\metas\materialtracking\impl\MaterialTrackingReportBL.java
1
请完成以下Java代码
public void onDeviceDeleted(DeviceSessionContext sessionContext) { destroyDeviceSession(sessionContext); } public void onDeviceProfileUpdated(DeviceProfile deviceProfile, DeviceSessionContext sessionContext) { log.debug("Handling device profile {} update event for device {}", deviceProfile.getI...
} log.trace("Removing deleted SNMP devices: {}", deleted); allSnmpDevicesIds.removeAll(deleted); } public Collection<DeviceSessionContext> getSessions() { return sessions.values(); } @PreDestroy public void destroy() { snmpExecutor.shutdown(); } }
repos\thingsboard-master\common\transport\snmp\src\main\java\org\thingsboard\server\transport\snmp\SnmpTransportContext.java
1
请完成以下Java代码
@Nullable AnsiElement getElement(String postfix) { for (Enum<?> candidate : this.enums) { if (candidate.name().equals(postfix)) { return (AnsiElement) candidate; } } return null; } } /** * {@link Mapping} for {@link Ansi8BitColor}. */ private static class Ansi8BitColorMapping extends Ma...
try { return this.factory.apply(Integer.parseInt(postfix)); } catch (IllegalArgumentException ex) { // Ignore } } return null; } private boolean containsOnlyDigits(String postfix) { for (int i = 0; i < postfix.length(); i++) { if (!Character.isDigit(postfix.charAt(i))) { ret...
repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\ansi\AnsiPropertySource.java
1
请完成以下Java代码
private boolean isEndedContract(@NonNull final I_I_Flatrate_Term importRecord) { final Timestamp contractEndDate = importRecord.getEndDate(); final Timestamp today = SystemTime.asDayTimestamp(); return contractEndDate != null && today.after(contractEndDate); } private void endContractIfNeeded(@NonNull final I...
private void setTaxCategoryAndIsTaxIncluded(@NonNull final I_C_Flatrate_Term newTerm) { final IPricingResult pricingResult = calculateFlatrateTermPrice(newTerm); newTerm.setC_TaxCategory_ID(TaxCategoryId.toRepoId(pricingResult.getTaxCategoryId())); newTerm.setIsTaxIncluded(pricingResult.isTaxIncluded()); } pr...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\flatrate\impexp\FlatrateTermImporter.java
1
请完成以下Java代码
public void setDataEntry_SubTab(de.metas.dataentry.model.I_DataEntry_SubTab DataEntry_SubTab) { set_ValueFromPO(COLUMNNAME_DataEntry_SubTab_ID, de.metas.dataentry.model.I_DataEntry_SubTab.class, DataEntry_SubTab); } /** Set Unterregister. @param DataEntry_SubTab_ID Unterregister */ @Override public void set...
Direct internal record ID */ @Override public void setRecord_ID (int Record_ID) { if (Record_ID < 0) set_ValueNoCheck (COLUMNNAME_Record_ID, null); else set_ValueNoCheck (COLUMNNAME_Record_ID, Integer.valueOf(Record_ID)); } /** Get Datensatz-ID. @return Direct internal record ID */ @Override ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\dataentry\model\X_DataEntry_Record.java
1
请完成以下Java代码
public class TelegramNotifier extends AbstractContentNotifier { private static final String DEFAULT_MESSAGE = "<strong>#{name}</strong>/#{id} is <strong>#{status}</strong>"; private RestTemplate restTemplate; /** * base url for telegram (i.e. https://api.telegram.org) */ private String apiUrl = "https://api....
public void setApiUrl(String apiUrl) { this.apiUrl = apiUrl; } @Nullable public String getChatId() { return chatId; } public void setChatId(@Nullable String chatId) { this.chatId = chatId; } @Nullable public String getAuthToken() { return authToken; } public void setAuthToken(@Nullable String auth...
repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\notify\TelegramNotifier.java
1
请完成以下Java代码
public void close() { // No-op } /** * Get the addTypeInfo property. * @return the addTypeInfo */ public boolean isAddTypeInfo() { return this.addTypeInfo; } /** * Set to false to disable adding type info headers. * @param addTypeInfo true to add headers */ public void setAddTypeInfo(boolean ad...
* Set a charset to use when converting {@link String} to byte[]. Default UTF-8. * @param charset the charset. */ public void setCharset(Charset charset) { Assert.notNull(charset, "'charset' cannot be null"); this.charset = charset; } /** * Get the configured charset. * @return the charset. */ public...
repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\support\serializer\ToStringSerializer.java
1
请完成以下Java代码
public BigDecimal getVolume() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Volume); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setWarehouse_temperature (final @Nullable java.lang.String Warehouse_temperature) { set_Value (COLUMNNAME_Warehouse_temperature, Warehouse_temper...
if (Weight_UOM_ID < 1) set_Value (COLUMNNAME_Weight_UOM_ID, null); else set_Value (COLUMNNAME_Weight_UOM_ID, Weight_UOM_ID); } @Override public int getWeight_UOM_ID() { return get_ValueAsInt(COLUMNNAME_Weight_UOM_ID); } @Override public void setWidthInCm (final int WidthInCm) { set_Value (COLUM...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Product.java
1
请完成以下Java代码
public int getPOD_ID() { return get_ValueAsInt(COLUMNNAME_POD_ID); } @Override public org.compiere.model.I_C_Postal getPOL() { return get_ValueAsPO(COLUMNNAME_POL_ID, org.compiere.model.I_C_Postal.class); } @Override public void setPOL(final org.compiere.model.I_C_Postal POL) { set_ValueFromPO(COLUMNN...
public int getShipper_BPartner_ID() { return get_ValueAsInt(COLUMNNAME_Shipper_BPartner_ID); } @Override public void setShipper_Location_ID (final int Shipper_Location_ID) { if (Shipper_Location_ID < 1) set_Value (COLUMNNAME_Shipper_Location_ID, null); else set_Value (COLUMNNAME_Shipper_Location_ID...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\shipping\model\X_M_ShipperTransportation.java
1
请完成以下Java代码
public I_M_InventoryLine getM_InventoryLine() throws RuntimeException { return (I_M_InventoryLine)MTable.get(getCtx(), I_M_InventoryLine.Table_Name) .getPO(getM_InventoryLine_ID(), get_TrxName()); } /** Set Phys.Inventory Line. @param M_InventoryLine_ID Unique line in an Inventory document */ public...
/** Get Scrapped Quantity. @return The Quantity scrapped due to QA issues */ public BigDecimal getScrappedQty () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ScrappedQty); if (bd == null) return Env.ZERO; return bd; } /** Set Target Quantity. @param TargetQty Target Movement Quantity ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_InOutLineConfirm.java
1
请完成以下Java代码
public boolean isInternationalDelivery() { return get_ValueAsBoolean(COLUMNNAME_InternationalDelivery); } @Override public org.compiere.model.I_M_Package getM_Package() { return get_ValueAsPO(COLUMNNAME_M_Package_ID, org.compiere.model.I_M_Package.class); } @Override public void setM_Package(final org.co...
set_Value (COLUMNNAME_M_ShipperTransportation_ID, null); else set_Value (COLUMNNAME_M_ShipperTransportation_ID, M_ShipperTransportation_ID); } @Override public int getM_ShipperTransportation_ID() { return get_ValueAsInt(COLUMNNAME_M_ShipperTransportation_ID); } @Override public void setNetWeightKg (fi...
repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.dhl\src\main\java-gen\de\metas\shipper\gateway\dhl\model\X_DHL_ShipmentOrder.java
1
请在Spring Boot框架中完成以下Java代码
public class UserService { @Autowired UserRepository userRepository; public ResponseEntity<?> saveUserProfile(UserPrincipal userPrincipal, UserProfile userProfileForm){ Optional<User> userDto = userRepository.findById(userPrincipal.getId()); User user = userDto.orElse(null); if(us...
user.setPhone(userProfileForm.getPhone()); userRepository.save(user); return new ResponseEntity<>(new ApiResponse(true, "change already saved"), HttpStatus.OK); } else { return new ResponseEntity<>( new ApiResponse(false, "Oops, issues! Please update page!...
repos\SpringBoot-Projects-FullStack-master\Part-9.SpringBoot-React-Projects\Project-2.SpringBoot-React-ShoppingMall\fullstack\backend\src\main\java\com\urunov\service\UserService.java
2
请在Spring Boot框架中完成以下Java代码
public class WFProcessHeaderProperty { @NonNull ITranslatableString caption; @NonNull ITranslatableString value; public boolean isValueNotBlank() {return !TranslatableStrings.isBlank(value);} @SuppressWarnings("unused") public static class WFProcessHeaderPropertyBuilder { public WFProcessHeaderPropertyBuilder...
public WFProcessHeaderPropertyBuilder value(final ZonedDateTime value) { return value(TranslatableStrings.dateAndTime(value)); } @NonNull public WFProcessHeaderPropertyBuilder value(@NonNull final LocalDate value) { return value(TranslatableStrings.date(value)); } public WFProcessHeaderPropertyBui...
repos\metasfresh-new_dawn_uat\backend\de.metas.workflow.rest-api\src\main\java\de\metas\workflow\rest_api\model\WFProcessHeaderProperty.java
2
请在Spring Boot框架中完成以下Java代码
public abstract class BatchReportEntryWrapper implements IStatementLineWrapper { @NonNull CurrencyRepository currencyRepository; protected BatchReportEntryWrapper(@NonNull final CurrencyRepository currencyRepository) { this.currencyRepository = currencyRepository; } @Override @NonNull public ImmutableSet<Str...
.map(value -> isCRDT() ? value : value.negate()) .orElse(BigDecimal.ZERO); } @NonNull protected abstract String getUnstructuredRemittanceInfo(@NonNull final String delimiter); @NonNull protected abstract List<String> getUnstructuredRemittanceInfoList(); @NonNull protected abstract String getLi...
repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java\de\metas\banking\camt53\wrapper\BatchReportEntryWrapper.java
2
请在Spring Boot框架中完成以下Java代码
protected Optional<String> getDurableClientId() { return Optional.ofNullable(this.durableClientId) .filter(StringUtils::hasText); } protected Integer getDurableClientTimeout() { return this.durableClientTimeout != null ? this.durableClientTimeout : DEFAULT_DURABLE_CLIENT_TIMEOUT; } protected Boolea...
clientCacheFactoryBean.setReadyForEvents(getReadyForEvents()); }); } @Bean PeerCacheConfigurer peerCacheDurableClientConfigurer() { return (beanName, cacheFactoryBean) -> getDurableClientId().ifPresent(durableClientId -> { Logger logger = getLogger(); if (logger.isWarnEnabled()) { logger.warn("Dura...
repos\spring-boot-data-geode-main\spring-geode-project\spring-geode\src\main\java\org\springframework\geode\config\annotation\DurableClientConfiguration.java
2
请在Spring Boot框架中完成以下Java代码
public String getBankType() { return bankType; } public void setBankType(String bankType) { this.bankType = bankType; } public Date getOrderTime() { return orderTime; } public void setOrderTime(Date orderTime) { this.orderTime = orderTime; } public Date getBankTradeTime() { return bankTradeTime; ...
this.bankTrxNo = bankTrxNo; } public String getBankTradeStatus() { return bankTradeStatus; } public void setBankTradeStatus(String bankTradeStatus) { this.bankTradeStatus = bankTradeStatus; } public BigDecimal getBankAmount() { return bankAmount; } public void setBankAmount(BigDecimal bankAmount) { ...
repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\reconciliation\vo\ReconciliationEntityVo.java
2
请完成以下Java代码
public Builder append(@NonNull final IStringExpression sqlToAppend) { sql.append(sqlToAppend); return this; } public Builder append(@Nullable final String sqlToAppend) { if (sqlToAppend != null) { sql.append(sqlToAppend); } return this; } public Builder appendSqlList(@NonNull final S...
sql.append(sqlToAppend); return this; } public boolean isEmpty() { return sql.isEmpty() && sqlParams.isEmpty(); } public Builder wrap(@NonNull final IStringExpressionWrapper wrapper) { sql.wrap(wrapper); return this; } } }
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\descriptor\SqlAndParamsExpression.java
1
请完成以下Java代码
protected ConditionEvaluationBuilder createConditionEvaluationBuilder(EvaluationConditionDto conditionDto) { RuntimeService runtimeService = getProcessEngine().getRuntimeService(); ObjectMapper objectMapper = getObjectMapper(); VariableMap variables = VariableValueDto.toMap(conditionDto.getVariables(), ge...
} if (conditionDto.getProcessDefinitionId() != null) { builder.processDefinitionId(conditionDto.getProcessDefinitionId()); } if (conditionDto.getTenantId() != null) { builder.tenantId(conditionDto.getTenantId()); } else if (conditionDto.isWithoutTenantId()) { builder.withoutTenantId(...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\ConditionRestServiceImpl.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...
{ Integer ii = (Integer)get_Value(COLUMNNAME_ImpEx_ConnectorType_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanum...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\impex\model\X_ImpEx_Connector.java
1
请完成以下Java代码
private ViewChangesCollector getParentOrNull() { final ViewChangesCollector threadLocalCollector = getCurrentOrNull(); if (threadLocalCollector != null && threadLocalCollector != this) { return threadLocalCollector; } return null; } void flush() { final ImmutableList<ViewChanges> changesList = getA...
if (!autoflush) { return; } flush(); } private ImmutableList<ViewChanges> getAndClean() { if (viewChangesMap.isEmpty()) { return ImmutableList.of(); } final ImmutableList<ViewChanges> changesList = ImmutableList.copyOf(viewChangesMap.values()); viewChangesMap.clear(); return changesList; ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\event\ViewChangesCollector.java
1
请完成以下Java代码
public BigDecimal getValue() { return _netAmtToInvoice; } /** * Asserts aggregated net amount to invoice equals with given expected value (if set). * * The expected amount is set using {@link #setNetAmtToInvoiceExpected(BigDecimal)}. * * @see #assertExpectedNetAmtToInvoice(BigDecimal) */ public void ...
+ "\n Invoice candidates count: " + _countInvoiceCandidates; Loggables.addLog(errmsg); if (isFailIfNetAmtToInvoiceChecksumNotMatch()) { throw new AdempiereException(errmsg); } } } /** * @return true if we shall fail if the net amount to invoice checksum does not match. */ public final boolean ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\ICNetAmtToInvoiceChecker.java
1
请完成以下Java代码
public static void main(String[] args) throws IOException { Selector selector = Selector.open(); ServerSocketChannel serverSocket = ServerSocketChannel.open(); serverSocket.bind(new InetSocketAddress("localhost", 5454)); serverSocket.configureBlocking(false); serverSocket.registe...
int r = client.read(buffer); if (r == -1 || new String(buffer.array()).trim() .equals(POISON_PILL)) { client.close(); System.out.println("Not accepting client messages anymore"); } else { buffer.flip(); client.write(buffer); buffer....
repos\tutorials-master\core-java-modules\core-java-nio\src\main\java\com\baeldung\selector\EchoServer.java
1
请完成以下Java代码
public static IAllocationResult nullResult() { return NullAllocationResult.instance; } /** * Creates an immutable allocation result. For cross-package use. * * @return {@link AllocationResult} */ public static IAllocationResult createQtyAllocationResult(final BigDecimal qtyToAllocate, final BigDecimal...
@Nullable private static BPartnerId getBPartnerId(final IAllocationRequest request) { final Object referencedModel = AllocationUtils.getReferencedModel(request); if (referencedModel == null) { return null; } final Integer bpartnerId = InterfaceWrapperHelper.getValueOrNull(referencedModel, I_M_HU_PI_Item...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\AllocationUtils.java
1
请在Spring Boot框架中完成以下Java代码
SpringCliDistributionController cliDistributionController(InitializrMetadataProvider metadataProvider) { return new SpringCliDistributionController(metadataProvider); } @Bean InitializrModule InitializrJacksonModule() { return new InitializrModule(); } } /** * Initializr cache configuration. */ ...
createMissingCache(cacheManager, "initializr.templates", this::config); } private void createMissingCache(javax.cache.CacheManager cacheManager, String cacheName, Supplier<MutableConfiguration<Object, Object>> config) { boolean cacheExist = StreamSupport.stream(cacheManager.getCacheNames().spliterator(), tr...
repos\initializr-main\initializr-web\src\main\java\io\spring\initializr\web\autoconfigure\InitializrAutoConfiguration.java
2
请完成以下Java代码
public class DefaultInboundEvent implements InboundEvent { protected final Object rawEvent; protected final Map<String, Object> headers; public DefaultInboundEvent(Object rawEvent) { this(rawEvent, Collections.emptyMap()); } public DefaultInboundEvent(Object rawEvent, Map<String, Object> ...
public Object getBody() { return rawEvent; } @Override public Map<String, Object> getHeaders() { return headers; } @Override public String toString() { return "DefaultInboundEvent{" + "rawEvent=" + rawEvent + ", headers=" + headers + ...
repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\DefaultInboundEvent.java
1
请在Spring Boot框架中完成以下Java代码
protected AdmissionReviewData processAnnotations(ObjectNode body, JsonNode annotations) { if (annotations.path(admissionControllerProperties.getAnnotation()) .isMissingNode()) { log.info("[I78] processAnnotations: Annotation {} not found in deployment deployment.", admissionControllerPr...
JsonNode maybeInitContainers = originalSpec.path("initContainers"); ArrayNode initContainers = maybeInitContainers.isMissingNode()? om.createArrayNode():(ArrayNode) maybeInitContainers; // Create the patch array ArrayNode patchArray = om.createArrayNode(); ObjectNode ...
repos\tutorials-master\kubernetes-modules\k8s-admission-controller\src\main\java\com\baeldung\kubernetes\admission\service\AdmissionService.java
2
请在Spring Boot框架中完成以下Java代码
public static Throwable validateRuleNode(RuleNode ruleNode) { String errorPrefix = "'" + ruleNode.getName() + "' node configuration is invalid: "; ConstraintValidator.validateFields(ruleNode, errorPrefix); Object nodeConfig; try { Class<Object> nodeConfigType = ReflectionUtil...
connectionsMap .computeIfAbsent(nodeConnection.getFromIndex(), from -> new HashSet<>()) .add(nodeConnection.getToIndex()); } connectionsMap.keySet().forEach(key -> validateCircles(key, connectionsMap.get(key), connectionsMap)); } private static void valid...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\service\validator\RuleChainDataValidator.java
2
请完成以下Java代码
public class ConversionServiceParameterValueMapper implements ParameterValueMapper { private final ConversionService conversionService; /** * Create a new {@link ConversionServiceParameterValueMapper} instance. */ public ConversionServiceParameterValueMapper() { this(ApplicationConversionService.getSharedIns...
this.conversionService = conversionService; } @Override public @Nullable Object mapParameterValue(OperationParameter parameter, @Nullable Object value) throws ParameterMappingException { try { return this.conversionService.convert(value, parameter.getType()); } catch (Exception ex) { throw new Parame...
repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\endpoint\invoke\convert\ConversionServiceParameterValueMapper.java
1
请完成以下Java代码
public PageData<AlarmCommentInfo> findAlarmComments(TenantId tenantId, AlarmId id, PageLink pageLink) { log.trace("Try to find alarm comments by alarm id using [{}]", id); return DaoUtil.toPageData( alarmCommentRepository.findAllByAlarmId(id.getId(), DaoUtil.toPageable(pageLink))); }...
@Override public PageData<AlarmComment> findAllByTenantId(TenantId tenantId, PageLink pageLink) { return DaoUtil.toPageData(alarmCommentRepository.findByTenantId(tenantId.getId(), DaoUtil.toPageable(pageLink))); } @Override protected Class<AlarmCommentEntity> getEntityClass() { return A...
repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\alarm\JpaAlarmCommentDao.java
1
请在Spring Boot框架中完成以下Java代码
private URI getPermissionsUri(String applicationId) { try { return new URI(this.cloudControllerUrl + "/v2/apps/" + applicationId + "/permissions"); } catch (URISyntaxException ex) { throw new IllegalStateException(ex); } } /** * Return all token keys known by the UAA. * @return a map of token keys ...
} return tokenKeys; } /** * Return the URL of the UAA. * @return the UAA url */ String getUaaUrl() { if (this.uaaUrl == null) { try { Map<?, ?> response = this.restTemplate.getForObject(this.cloudControllerUrl + "/info", Map.class); Assert.state(response != null, "'response' must not be null");...
repos\spring-boot-4.0.1\module\spring-boot-cloudfoundry\src\main\java\org\springframework\boot\cloudfoundry\autoconfigure\actuate\endpoint\servlet\SecurityService.java
2
请在Spring Boot框架中完成以下Java代码
public MADBoilerPlate getDefaultTextPreset() { return DEFAULT_TEXT_PRESET; } /** * @return the title of the process */ @Override public String getExportFilePrefix() { return exportFilePrefix; } @Override public I_AD_User getFrom() { return from; } /** * @return <code>null</code> */ @Overri...
* @return the title of the process */ @Override public String getSubject() { return subject; } /** * @return the title of the process */ @Override public String getTitle() { return title; } @Override public String getTo() { return to; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\org\compiere\report\email\service\impl\BPartnerEmailParams.java
2
请完成以下Java代码
public String getAttribute() { return null; } @Override public int hashCode() { return Objects.hash(this.accessPredicate); } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) {
return false; } if (getClass() != obj.getClass()) { return false; } final AccessPredicateConfigAttribute other = (AccessPredicateConfigAttribute) obj; return Objects.equals(this.accessPredicate, other.accessPredicate); } @Override public String toString()...
repos\grpc-spring-master\grpc-server-spring-boot-starter\src\main\java\net\devh\boot\grpc\server\security\check\AccessPredicateConfigAttribute.java
1
请完成以下Java代码
public SpinFileNotFoundException fileNotFoundException(String filename) { return fileNotFoundException(filename, null); } public SpinRuntimeException unableToReadFromReader(Exception e) { return new SpinRuntimeException(exceptionMessage("003", "Unable to read from reader"), e); } public SpinDataFormat...
} protected void logDataFormat(DataFormat<?> dataFormat) { logInfo("009", "Discovered Spin data format: {}[name = {}]", dataFormat.getClass().getName(), dataFormat.getName()); } public void logDataFormatProvider(DataFormatProvider provider) { if (isInfoEnabled()) { logInfo("010", "Discovered Spin ...
repos\camunda-bpm-platform-master\spin\core\src\main\java\org\camunda\spin\impl\logging\SpinCoreLogger.java
1