instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String execute(CommandContext commandContext) {
DbSqlSessionFactory dbSqlSessionFactory = (DbSqlSessionFactory) commandContext
.getSessionFactories()
.get(DbSqlSession.class);
DbSqlSession dbSqlSession = new DbSqlSession(
... | }
return commandExecutor.execute(config, command);
}
@Override
public <MapperType, ResultType> ResultType executeCustomSql(
CustomSqlExecution<MapperType, ResultType> customSqlExecution
) {
Class<MapperType> mapperClass = customSqlExecution.getMapperClass();
return comma... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\ManagementServiceImpl.java | 1 |
请完成以下Java代码 | public Component getTableCellEditorComponent(final JTable table,
final Object valueModel,
final boolean isSelected,
int rowIndexView,
int columnIndexView)
{
// Set Value
final Object valueEditor = convertToEditorValue(valueModel);
m_editor.setValue(valueEditor);
// Set UI
m_editor.setBorder(null... | {
return super.stopCellEditing();
}
catch (Exception e)
{
final Component comp = (Component)m_editor;
final int windowNo = Env.getWindowNo(comp);
Services.get(IClientUI.class).warn(windowNo, e);
}
return false;
}
@Override
public void cancelCellEditing()
{
super.cancelCellEditing();
}
p... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\compiere\swing\table\AnnotatedTableModelCellEditor.java | 1 |
请完成以下Java代码 | public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.compiere.model.I_M_Shipment_Declaration getM_Shipment_Declaration() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_M_Shipment_Dec... | return 0;
return ii.intValue();
}
/** Set Pck. Gr..
@param PackageSize Pck. Gr. */
@Override
public void setPackageSize (java.lang.String PackageSize)
{
set_Value (COLUMNNAME_PackageSize, PackageSize);
}
/** Get Pck. Gr..
@return Pck. Gr. */
@Override
public java.lang.String getPackageSize ()
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Shipment_Declaration_Line.java | 1 |
请完成以下Java代码 | public ThreadPoolTaskScheduler build() {
return configure(new ThreadPoolTaskScheduler());
}
/**
* Configure the provided {@link ThreadPoolTaskScheduler} instance using this builder.
* @param <T> the type of task scheduler
* @param taskScheduler the {@link ThreadPoolTaskScheduler} to configure
* @return the... | map.from(this.awaitTerminationPeriod).asInt(Duration::getSeconds).to(taskScheduler::setAwaitTerminationSeconds);
map.from(this.threadNamePrefix).to(taskScheduler::setThreadNamePrefix);
map.from(this.taskDecorator).to(taskScheduler::setTaskDecorator);
if (!CollectionUtils.isEmpty(this.customizers)) {
this.custo... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\task\ThreadPoolTaskSchedulerBuilder.java | 1 |
请完成以下Java代码 | public boolean isActive() {
return po.isActive(); // isActive
}
/**
* Get Created
* @return created
*/
public Timestamp getCreated() {
return po.getCreated(); // getCreated
}
/**
* Get Updated
* @return updated
*/
public Timestamp getUpdated() {
return po.getUpdated(); // getUpdated
}
... | * Delete Current Record
* @param force delete also processed records
* @param trxName transaction
*/
public boolean delete(boolean force, String trxName) {
return po.delete(force, trxName); // delete
}
/**************************************************************************
* Lock it.
* @return ... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\model\wrapper\AbstractPOWrapper.java | 1 |
请完成以下Java代码 | public Order shipDate(DateTime shipDate) {
this.shipDate = shipDate;
return this;
}
/**
* Get shipDate
* @return shipDate
**/
@ApiModelProperty(value = "")
public DateTime getShipDate() {
return shipDate;
}
public void setShipDate(DateTime shipDate) {
this.shipDate = shipDate;
}... | return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, o... | repos\tutorials-master\spring-swagger-codegen-modules\spring-swagger-codegen-api-client\src\main\java\com\baeldung\petstore\client\model\Order.java | 1 |
请完成以下Java代码 | public GatewayFilter apply(Config config) {
return new GatewayFilter() {
@Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
String value = ServerWebExchangeUtils.expand(exchange, config.getHost());
ServerHttpRequest request = exchange.getRequest().mutate().header... | public static class Config {
private @Nullable String host;
public @Nullable String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
}
} | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\SetRequestHostHeaderGatewayFilterFactory.java | 1 |
请完成以下Java代码 | public void setLinkURL (String LinkURL)
{
set_Value (COLUMNNAME_LinkURL, LinkURL);
}
/** Get LinkURL.
@return Contains URL to a target
*/
public String getLinkURL ()
{
return (String)get_Value(COLUMNNAME_LinkURL);
}
/** Set Publication Date.
@param PubDate
Date on which this article will / shoul... | }
/** Set Title.
@param Title
Name this entity is referred to as
*/
public void setTitle (String Title)
{
set_Value (COLUMNNAME_Title, Title);
}
/** Get Title.
@return Name this entity is referred to as
*/
public String getTitle ()
{
return (String)get_Value(COLUMNNAME_Title);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_NewsItem.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public boolean isDestroyed() {
return getDelegate().isDestroyed();
}
@Override
public boolean isLocal() {
return getDelegate().isLocal();
}
@Override
public K getKey() {
return getDelegate().getKey();
}
@Override
public Region<K, V> getRegion() {
return getDelegate().getRegion();
}
... | @Override
public Object setUserAttribute(Object userAttribute) {
return getDelegate().setUserAttribute(userAttribute);
}
@Override
public Object getUserAttribute() {
return getDelegate().getUserAttribute();
}
@Override
public V setValue(V value) {
return getDelegate().setValue(value);
}
@O... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\support\PdxInstanceWrapperRegionAspect.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public PickingJobScheduleCollection list(@NonNull final PickingJobScheduleQuery query)
{
return stream(query).collect(PickingJobScheduleCollection.collect());
}
public Stream<PickingJobSchedule> stream(@NonNull final PickingJobScheduleQuery query)
{
return toSqlQuery(query)
.stream()
.map(PickingJobSch... | .addOnlyActiveRecordsFilter();
if (!query.getWorkplaceIds().isEmpty())
{
queryBuilder.addInArrayFilter(I_M_Picking_Job_Schedule.COLUMNNAME_C_Workplace_ID, query.getWorkplaceIds());
}
if (!query.getExcludeJobScheduleIds().isEmpty())
{
queryBuilder.addNotInArrayFilter(I_M_Picking_Job_Schedule.COLUMNNAME... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\picking\job_schedule\repository\PickingJobScheduleRepository.java | 2 |
请完成以下Java代码 | public static synchronized String getSubYouBianCode(String parentCode,String localCode) {
if(localCode!=null && localCode!=""){
// return parentCode + getNextYouBianCode(localCode);
return getNextYouBianCode(localCode);
}else{
parentCode = parentCode + "A"+ getNextStrNum(0);
}
return parentCode;
}
... | }
/**
* 根据数字位数获取最大值
* @param length
* @return
*/
private static int getMaxNumByLength(int length){
if(length==0){
return 0;
}
StringBuilder maxNum = new StringBuilder();
for (int i=0;i<length;i++){
maxNum.append("9");
}
return Integer.parseInt(maxNum.toString());
}
public ... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\YouBianCodeUtil.java | 1 |
请完成以下Java代码 | private String convert (long number)
{
/* special case */
if (number == 0)
{
return "Zero";
}
String prefix = "";
if (number < 0)
{
number = -number;
prefix = "Negative ";
}
String soFar = "";
int place = 0;
do
{
long n = number % 1000;
if (n != 0)
{
String s = convertLess... | }
return sb.toString ();
} // getAmtInWords
/**
* Test Print
* @param amt amount
*/
private void print (String amt)
{
try
{
System.out.println(amt + " = " + getAmtInWords(amt));
}
catch (Exception e)
{
e.printStackTrace();
}
} // print
/**
* Test
* @param args ignored
*/
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\AmtInWords_EN.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int getOrder() {
return 0;
}
@Override
public void customize(GsonBuilder builder) {
GsonProperties properties = this.properties;
PropertyMapper map = PropertyMapper.get();
map.from(properties::getGenerateNonExecutableJson).whenTrue().toCall(builder::generateNonExecutableJson);
map.from(prop... | }
@SuppressWarnings("deprecation")
private Consumer<GsonProperties.Strictness> strictnessOrLeniency(GsonBuilder builder) {
if (ClassUtils.isPresent("com.google.gson.Strictness", getClass().getClassLoader())) {
return (strictness) -> builder.setStrictness(Strictness.valueOf(strictness.name()));
}
retur... | repos\spring-boot-4.0.1\module\spring-boot-gson\src\main\java\org\springframework\boot\gson\autoconfigure\GsonAutoConfiguration.java | 2 |
请完成以下Java代码 | protected final Frame getCallingFrame()
{
final GridField gridField = getContext().getEditor().getField();
if (gridField == null)
{
return null;
}
final int windowNo = gridField.getWindowNo();
final Frame frame = Env.getWindow(windowNo);
return frame;
}
protected final int getAD_Form_ID()
{
retu... | final Properties ctx = context.getCtx();
// Check if user has access to Payment Allocation form
final int adFormId = getAD_Form_ID();
final Boolean formAccess = Env.getUserRolePermissions().checkFormAccess(adFormId);
if (formAccess == null || !formAccess)
{
return null;
}
// Retrieve the form
final... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\ui\OpenFormContextMenuAction.java | 1 |
请完成以下Java代码 | public final BPartnerId getPaymentBPartnerId()
{
final I_C_Payment payment = getC_Payment();
if (payment != null)
{
return BPartnerId.ofRepoId(payment.getC_BPartner_ID());
}
return getBPartnerId();
}
@Nullable
public final BPartnerLocationId getPaymentBPartnerLocationId()
{
final I_C_Payment payme... | if (payment != null)
{
return BPartnerLocationId.ofRepoIdOrNull(payment.getC_BPartner_ID(), payment.getC_BPartner_Location_ID());
}
return getBPartnerLocationId();
}
public boolean isPaymentReceipt()
{
Check.assumeNotNull(paymentReceipt, "payment document exists");
return paymentReceipt;
}
} // D... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\DocLine_Allocation.java | 1 |
请完成以下Java代码 | public int getR_Status_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_R_Status_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Sequence.
@param SeqNo
Method of ordering records; lowest number comes first
*/
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Int... | Integer ii = (Integer)get_Value(COLUMNNAME_TimeoutDays);
if (ii == null)
return 0;
return ii.intValue();
}
public I_R_Status getUpdate_Status() throws RuntimeException
{
return (I_R_Status)MTable.get(getCtx(), I_R_Status.Table_Name)
.getPO(getUpdate_Status_ID(), get_TrxName()); }
/** Set Update St... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_Status.java | 1 |
请完成以下Java代码 | public boolean isWeak()
{
return delegate == null;
}
public PropertyChangeListener getDelegate()
{
if (delegate != null)
{
return delegate;
}
final PropertyChangeListener delegate = delegateRef.get();
return delegate;
}
@Override
public void propertyChange(final PropertyChangeEvent evt)
{
fi... | {
final Reference<?> sourceRef = (Reference<?>)source;
final Object sourceObj = sourceRef.get();
if (sourceObj == null)
{
// reference expired
if (DEBUG)
{
// TODO remove before integrating into base line!!
System.out.println(StringUtils.formatMessage("sourceObj of {0} is expired", this)... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\beans\WeakPropertyChangeListener.java | 1 |
请完成以下Java代码 | public PurchaseOrderItem buildAndAddToParent()
{
final PurchaseOrderItem newItem = innerBuilder.build();
parent.purchaseOrderItems.add(newItem);
return newItem;
}
}
public OrderItemBuilder createOrderItem()
{
return new OrderItemBuilder(this);
}
/**
* Intended to be used by the persistence layer... | public Quantity getPurchasedQty()
{
return purchaseOrderItems.stream()
.map(PurchaseOrderItem::getPurchasedQty)
.reduce(Quantity::add)
.orElseGet(() -> getQtyToPurchase().toZero());
}
public List<PurchaseOrderItem> getPurchaseOrderItems()
{
return ImmutableList.copyOf(purchaseOrderItems);
}
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\PurchaseCandidate.java | 1 |
请完成以下Java代码 | public RuleChain findByTenantIdAndExternalId(UUID tenantId, UUID externalId) {
return DaoUtil.getData(ruleChainRepository.findByTenantIdAndExternalId(tenantId, externalId));
}
@Override
public PageData<RuleChain> findByTenantId(UUID tenantId, PageLink pageLink) {
return findRuleChainsByTena... | @Override
public List<EntityInfo> findByTenantIdAndResource(TenantId tenantId, String reference, int limit) {
return ruleChainRepository.findRuleChainsByTenantIdAndResource(tenantId.getId(), reference, PageRequest.of(0, limit));
}
@Override
public List<EntityInfo> findByResource(String referenc... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\rule\JpaRuleChainDao.java | 1 |
请完成以下Java代码 | protected ScriptEngine getEngineByName(String language) {
ScriptEngine scriptEngine = null;
if (cacheScriptingEngines) {
scriptEngine = cachedEngines.get(language);
if (scriptEngine == null) {
scriptEngine = scriptEngineManager.getEngineByName(language);
... | }
return scriptEngine;
}
/** override to build a spring aware ScriptingEngines */
protected Bindings createBindings(VariableScope variableScope) {
return scriptBindingsFactory.createBindings(variableScope);
}
/** override to build a spring aware ScriptingEngines */
protected Bi... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\scripting\ScriptingEngines.java | 1 |
请完成以下Java代码 | public void run() {
Stage stage = getStage(planItemInstanceEntity);
String oldState = planItemInstanceEntity.getState();
String newState = PlanItemInstanceState.ACTIVE;
planItemInstanceEntity.setState(newState);
CommandContextUtil.getCmmnEngineConfiguration(commandContext).getLi... | CaseInstanceEntity caseInstanceEntity = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getCaseInstanceEntityManager()
.findById(planItemInstanceEntity.getCaseInstanceId());
createPlanItemInstancesForNewOrReactivatedStage(commandContext, caseModel,
stage.getPlanItems()... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\impl\agenda\operation\InitStageInstanceOperation.java | 1 |
请完成以下Java代码 | public void setMessage2 (String Message2)
{
set_Value (COLUMNNAME_Message2, Message2);
}
/** Get Message 2.
@return Optional second part of the EMail Message
*/
public String getMessage2 ()
{
return (String)get_Value(COLUMNNAME_Message2);
}
/** Set Message 3.
@param Message3
Optional third part ... | */
public int getW_MailMsg_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_W_MailMsg_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_W_Store getW_Store() throws RuntimeException
{
return (I_W_Store)MTable.get(getCtx(), I_W_Store.Table_Name)
.getPO(getW_Store_ID(), get_TrxName... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_MailMsg.java | 1 |
请完成以下Java代码 | public abstract class CharacterBasedSegment extends Segment
{
/**
* 查询或猜测一个词语的属性,
* 先查词典,然后对字母、数字串的属性进行判断,最后猜测未登录词
* @param term
* @return
*/
public static CoreDictionary.Attribute guessAttribute(Term term)
{
CoreDictionary.Attribute attribute = CoreDictionary.get(term.word... | }
/**
* 单纯的分词模型实现该方法,仅输出词
* @param sentence
* @return
*/
protected abstract List<Term> roughSegSentence(char[] sentence);
/**
* 将中间结果转换为词网顶点,
* 这样就可以利用基于Vertex开发的功能, 如词性标注、NER等
* @param wordList
* @param appendStart
* @return
*/
protected List<Vertex> ... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\seg\CharacterBasedSegment.java | 1 |
请完成以下Java代码 | public void setType(String type) {
this.type = type;
}
public String getValidUntil() {
return validUntil;
}
public void setValidUntil(String validUntil) {
this.validUntil = validUntil;
}
public Boolean isUnlimited() {
return isUnlimited;
}
public void setUnlimited(Boolean isUnlimited... | public Map<String, String> getFeatures() {
return features;
}
public void setFeatures(Map<String, String> features) {
this.features = features;
}
public String getRaw() {
return raw;
}
public void setRaw(String raw) {
this.raw = raw;
}
} | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\telemetry\dto\LicenseKeyDataImpl.java | 1 |
请完成以下Java代码 | public String getTypeName() {
return TYPE_NAME;
}
@Override
public boolean isCachable() {
return true;
}
@Override
public boolean isAbleToStore(Object value) {
return value instanceof BpmnAggregation;
}
@Override
public boolean isReadOnly() {
return... | if (value instanceof BpmnAggregation) {
valueFields.setTextValue(((BpmnAggregation) value).getExecutionId());
} else {
valueFields.setTextValue(null);
}
}
@Override
public Object getValue(ValueFields valueFields) {
CommandContext commandContext = Context.getC... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\variable\BpmnAggregatedVariableType.java | 1 |
请完成以下Java代码 | public void add(URI uri, HttpCookie cookie) {
store.add(uri, cookie);
}
@Override
public List<HttpCookie> get(URI uri) {
// TODO Auto-generated method stub
return null;
}
@Override
public List<HttpCookie> getCookies() {
// TODO Auto-generated method stub
... | return null;
}
@Override
public boolean remove(URI uri, HttpCookie cookie) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean removeAll() {
// TODO Auto-generated method stub
return false;
}
} | repos\tutorials-master\core-java-modules\core-java-networking-5\src\main\java\com\baeldung\networking\cookies\PersistentCookieStore.java | 1 |
请完成以下Java代码 | public void run(@Nullable String contextName, Runnable runnable) {
try {
bind(contextName);
runnable.run();
}
finally {
unbind(contextName);
}
}
/**
* Bind the context.
* @param contextName the name of the context for the connection factory.
*/
private void bind(@Nullable String contextName) ... | SimpleResourceHolder.bind(this.connectionFactory, contextName);
}
}
/**
* Unbind the context.
* @param contextName the name of the context for the connection factory.
*/
private void unbind(@Nullable String contextName) {
if (StringUtils.hasText(contextName)) {
SimpleResourceHolder.unbind(this.connecti... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\connection\ConnectionFactoryContextWrapper.java | 1 |
请完成以下Java代码 | public static class Builder {
private int amount;
public Builder amount(int amount) {
this.amount = amount;
return this;
}
private double price;
public Builder price(double price) {
this.price = price;
return this;
}
... | }
public Market getMarket() {
return market;
}
public Currency getCurrency() {
return currency;
}
public String getSymbol() {
return symbol;
}
@Override
public String toString() {
return new StringJoiner(", ", MarketData.class.getSimpleName() + "[", "]... | repos\tutorials-master\libraries-3\src\main\java\com\baeldung\sbe\MarketData.java | 1 |
请完成以下Java代码 | public class X_M_AttributeSearch extends PO implements I_M_AttributeSearch, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20090915L;
/** Standard Constructor */
public X_M_AttributeSearch (Properties ctx, int M_AttributeSearch_ID, String trxName)
{
super (ctx, M_Attribu... | {
if (M_AttributeSearch_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_AttributeSearch_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_AttributeSearch_ID, Integer.valueOf(M_AttributeSearch_ID));
}
/** Get Attribute Search.
@return Common Search Attribute
*/
public int getM_AttributeSearch_ID ()
{
Integ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_AttributeSearch.java | 1 |
请完成以下Java代码 | private IPricingResult computeFlatrateTermPrice(@NonNull final FlatrateTermPriceRequest request)
{
return FlatrateTermPricing.builder()
.term(request.getFlatrateTerm())
.termRelatedProductId(request.getProductId())
.priceDate(request.getPriceDate())
.qty(BigDecimal.ONE)
.build()
.computeOrThr... | }
return nextFTsBuilder.build();
}
@Override
public final boolean existsTermForOrderLine(final I_C_OrderLine ol)
{
return Services.get(IQueryBL.class)
.createQueryBuilder(I_C_Flatrate_Term.class, ol)
.addOnlyActiveRecordsFilter()
.addEqualsFilter(I_C_Flatrate_Term.COLUMN_C_OrderLine_Term_ID, ol.ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\impl\FlatrateBL.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class UserService {
private EventStore repository;
public UserService(EventStore repository) {
this.repository = repository;
}
public void createUser(String userId, String firstName, String lastName) {
repository.addEvent(userId, new UserCreatedEvent(userId, firstName, lastName... | public Set<Contact> getContactByType(String userId, String contactType) throws Exception {
User user = UserUtility.recreateUserState(repository, userId);
if (user == null)
throw new Exception("User does not exist.");
return user.getContacts()
.stream()
.filter... | repos\tutorials-master\patterns-modules\cqrs-es\src\main\java\com\baeldung\patterns\es\service\UserService.java | 2 |
请完成以下Java代码 | public void setUserAgent (String UserAgent)
{
set_Value (COLUMNNAME_UserAgent, UserAgent);
}
/** Get User Agent.
@return Browser Used
*/
public String getUserAgent ()
{
return (String)get_Value(COLUMNNAME_UserAgent);
}
public I_W_ClickCount getW_ClickCount() throws RuntimeException
{
return (I_... | return ii.intValue();
}
/** Set Web Click.
@param W_Click_ID
Individual Web Click
*/
public void setW_Click_ID (int W_Click_ID)
{
if (W_Click_ID < 1)
set_ValueNoCheck (COLUMNNAME_W_Click_ID, null);
else
set_ValueNoCheck (COLUMNNAME_W_Click_ID, Integer.valueOf(W_Click_ID));
}
/** Get Web Clic... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Click.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SqlDocumentFilterConverterContext
{
@Nullable ViewId viewId;
@Nullable UserRolePermissionsKey userRolePermissionsKey;
@NonNull ImmutableMap<String, Object> parameters;
boolean queryIfNoFilters;
@Builder
private SqlDocumentFilterConverterContext(
@Nullable final ViewId viewId,
@Nullable final U... | }
public SqlDocumentFilterConverterContext withViewId(@Nullable final ViewId viewId)
{
return !ViewId.equals(this.viewId, viewId)
? new SqlDocumentFilterConverterContext(viewId, this.userRolePermissionsKey, this.parameters, this.queryIfNoFilters)
: this;
}
public SqlDocumentFilterConverterContext withUs... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\sql\SqlDocumentFilterConverterContext.java | 2 |
请完成以下Java代码 | private void actionButton()
{
if (!m_button.isEnabled())
{
return;
}
throw new UnsupportedOperationException();
}
@Override
public void propertyChange(final PropertyChangeEvent evt)
{
final String propertyName = evt.getPropertyName();
if (propertyName.equals(org.compiere.model.GridField.PROPERTY... | else if (propertyName.equals(org.compiere.model.GridField.REQUEST_FOCUS))
{
requestFocus();
}
}
@Override
public boolean isAutoCommit()
{
return true;
}
@Override
public void addMouseListener(final MouseListener l)
{
m_text.addMouseListener(l);
}
} // VPAttribute | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VPAttribute.java | 1 |
请完成以下Java代码 | public String getReferrer ()
{
return (String)get_Value(COLUMNNAME_Referrer);
}
/** Set Remote Addr.
@param Remote_Addr
Remote Address
*/
public void setRemote_Addr (String Remote_Addr)
{
set_Value (COLUMNNAME_Remote_Addr, Remote_Addr);
}
/** Get Remote Addr.
@return Remote Address
*/
public... | public I_W_CounterCount getW_CounterCount() throws RuntimeException
{
return (I_W_CounterCount)MTable.get(getCtx(), I_W_CounterCount.Table_Name)
.getPO(getW_CounterCount_ID(), get_TrxName()); }
/** Set Counter Count.
@param W_CounterCount_ID
Web Counter Count Management
*/
public void setW_CounterCo... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Counter.java | 1 |
请完成以下Spring Boot application配置 | spring:
thymeleaf:
cache: true # set to false, this if you are working on UI
prefix: file:main-app/main-webapp/src/main/resources/templates/ #directly serve from src folder instead of target
web:
resources:
static-locations:
- file:src/main/resources/static/ ... | ls.LoggerListener: DEBUG
org.springframework.security: INFO
org.springframework.security.web: INFO
org.springframework.cloud: INFO
# org.hibernate.SQL: debug
# org.hibernate.type: TRACE
'org.hibernate.engine.internal.StatisticalLoggingSessionEventListener': info | repos\spring-boot-web-application-sample-master\main-app\main-webapp\src\main\resources\application-local.yml | 2 |
请完成以下Java代码 | public String getTaskId() {
return taskId;
}
public String getJobId() {
return jobId;
}
public String getJobDefinitionId() {
return jobDefinitionId;
}
public String getBatchId() {
return batchId;
}
public String getUserId() {
return userId;
}
public Date getTimestamp() {
... | public String getEntityType() {
return entityType;
}
public String getProperty() {
return property;
}
public String getOrgValue() {
return orgValue;
}
public String getNewValue() {
return newValue;
}
public Date getRemovalTime() {
return removalTime;
}
public String getRootP... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\UserOperationLogEntryDto.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_S_Resource getPP_Plant()
{
return get_ValueAsPO(COLUMNNAME_PP_Plant_ID, org.compiere.model.I_S_Resource.class);
}
@Override
public void setPP_Plant(final org.compiere.model.I_S_Resource PP_Plant)
{
set_ValueFromPO(COLUMNNAME_PP_Plant_ID, org.compiere.model.I_S_Resource.class, PP_Pl... | {
set_ValueFromPO(COLUMNNAME_PP_Product_BOMLine_ID, org.eevolution.model.I_PP_Product_BOMLine.class, PP_Product_BOMLine);
}
@Override
public void setPP_Product_BOMLine_ID (final int PP_Product_BOMLine_ID)
{
if (PP_Product_BOMLine_ID < 1)
set_Value (COLUMNNAME_PP_Product_BOMLine_ID, null);
else
set_Va... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java-gen\de\metas\material\dispo\model\X_MD_Candidate_Prod_Detail.java | 1 |
请完成以下Java代码 | public I_M_Product getM_Product() throws RuntimeException
{
return (I_M_Product)MTable.get(getCtx(), I_M_Product.Table_Name)
.getPO(getM_Product_ID(), get_TrxName()); }
/** Set Product.
@param M_Product_ID
Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID... | else
set_Value (COLUMNNAME_M_ProductMember_ID, Integer.valueOf(M_ProductMember_ID));
}
/** Get Membership.
@return Product used to deternine the price of the membership for the topic type
*/
public int getM_ProductMember_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_ProductMember_ID);
if (ii =... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_B_TopicType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getAuthor() {
return author;
}
public void setA... | return type;
}
public void setType(String type) {
this.type = type;
}
public boolean isSaveProcessInstanceId() {
return saveProcessInstanceId;
}
public void setSaveProcessInstanceId(boolean saveProcessInstanceId) {
this.saveProcessInstanceId = saveProcessInstanceId;
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\engine\CommentRequest.java | 2 |
请完成以下Java代码 | public boolean isAttachmentStorable(@NonNull final AttachmentEntry attachmentEntry)
{
return appliesTo(attachmentEntry);
}
@Override
public URI storeAttachment(@NonNull final AttachmentEntry attachmentEntry)
{
final boolean attachmentIsStoredForThefirstTime = !attachmentEntry
.getTags()
.toMap()
.... | final String xsdName = XmlIntrospectionUtil.extractXsdValueOrNull(new ByteArrayInputStream(attachmentData));
final CrossVersionRequestConverter converter = crossVersionServiceRegistry.getRequestConverterForXsdName(xsdName);
Check.assumeNotNull(converter, "Missing CrossVersionRequestConverter for XSD={}; attachmentE... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_base\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\base\store\StoreForumDatenaustauschAttachmentService.java | 1 |
请完成以下Java代码 | public JsonInventoryLineHU toJson(final InventoryLineHU lineHU, InventoryLine line)
{
final ProductInfo product = products.getById(line.getProductId());
final HuId huId = lineHU.getHuId();
final String productName = product.getProductName().translate(adLanguage);
final String huDisplayName = huId != null ? ha... | .uom(lineHU.getUOMSymbol())
.qtyBooked(lineHU.getQtyBook().toBigDecimal())
.qtyCount(lineHU.getQtyCount().toBigDecimal())
.countStatus(computeCountStatus(lineHU))
.attributes(loadAllDetails ? JsonAttribute.of(asis.getById(lineHU.getAsiId()), adLanguage) : null)
.build();
}
public JsonInventoryLin... | repos\metasfresh-new_dawn_uat\backend\de.metas.inventory.mobileui\src\main\java\de\metas\inventory\mobileui\rest_api\mappers\JsonInventoryJobMapper.java | 1 |
请完成以下Java代码 | public String evaluate(final Evaluatee ctx, final OnVariableNotFound onVariableNotFound) throws ExpressionEvaluationException
{
try
{
return StringExpressionsHelper.evaluateParam(parameter, ctx, onVariableNotFound);
}
catch (final Exception e)
{
throw ExpressionEvaluationException.wrapIfNeeded(e)
... | try
{
final String value = StringExpressionsHelper.evaluateParam(parameter, ctx, OnVariableNotFound.ReturnNoResult);
if (value == null || value == EMPTY_RESULT)
{
return this;
}
return ConstantStringExpression.of(value);
}
catch (final Exception e)
{
throw ExpressionEvaluationException.wr... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\SingleParameterStringExpression.java | 1 |
请完成以下Java代码 | public class JsonConverter {
public static JSONObject objectToJSONObject(Object object) {
try {
String jsonString = new ObjectMapper().writeValueAsString(object);
return new JSONObject(jsonString);
} catch (JSONException | JsonProcessingException e) {
e.printStack... | } catch (JSONException | JsonProcessingException e) {
e.printStackTrace();
return null;
}
}
public static <T> T jsonObjectToObject(Object jsonObject, Class<T> clazz) {
try {
// List<Car> listCar = objectMapper.readValue(jsonCarArray, new TypeReference<List<Ca... | repos\SpringBootBucket-master\springboot-socketio\src\main\java\com\xncoding\jwt\common\JsonConverter.java | 1 |
请完成以下Java代码 | protected void sendCancelEvent(JobEntity jobToDelete) {
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Context.getProcessEngineConfiguration()
.getEventDispatcher()
.dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventTyp... | JobEntity job = commandContext.getJobEntityManager().findById(jobId);
if (job == null) {
throw new ActivitiObjectNotFoundException("No job found with id '" + jobId + "'", Job.class);
}
// We need to check if the job was locked, ie acquired by the job acquisition thread
// Th... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\cmd\DeleteJobCmd.java | 1 |
请完成以下Java代码 | public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
} | public String getServiceRendered() {
return serviceRendered;
}
public void setServiceRendered(String serviceRendered) {
this.serviceRendered = serviceRendered;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.addres... | repos\tutorials-master\spring-boot-modules\spring-boot-keycloak-adapters\src\main\java\com\baeldung\keycloak\Customer.java | 1 |
请完成以下Java代码 | public class FieldExtensionParser extends BaseChildElementParser {
@Override
public String getElementName() {
return ELEMENT_FIELD;
}
@Override
public boolean accepts(BaseElement element) {
return ((element instanceof FlowableListener) || (element instanceof ServiceTask) || (elemen... | xtr.next();
if (xtr.isStartElement() && ELEMENT_FIELD_STRING.equalsIgnoreCase(xtr.getLocalName())) {
extension.setStringValue(xtr.getElementText().trim());
} else if (xtr.isStartElement() && ATTRIBUTE_FIELD_EXPRESSION.equalsIgnoreCase(xtr.getLocalName()))... | repos\flowable-engine-main\modules\flowable-bpmn-converter\src\main\java\org\flowable\bpmn\converter\child\FieldExtensionParser.java | 1 |
请完成以下Java代码 | public Response convertToPublish(TransportProtos.AttributeUpdateNotificationMsg msg) throws AdaptorException {
return getObserveNotification(msg.toByteArray());
}
@Override
public Response convertToPublish(TransportProtos.ToDeviceRpcRequestMsg rpcRequest, DynamicMessage.Builder rpcRequestDynamicMes... | return response;
}
}
}
private Response getObserveNotification(byte[] notification) {
Response response = new Response(CoAP.ResponseCode.CONTENT);
response.setPayload(notification);
return response;
}
@Override
public int getContentFormat() {
ret... | repos\thingsboard-master\common\transport\coap\src\main\java\org\thingsboard\server\transport\coap\adaptors\ProtoCoapAdaptor.java | 1 |
请完成以下Java代码 | public List<String> readMultiLines(@NonNull final File file, @NonNull final Charset charset) throws IOException
{
return Files.readLines(file, charset, new MultiLineProcessor());
}
public List<String> readMultiLines(@NonNull final byte[] data, @NonNull final Charset charset) throws IOException
{
return ByteSou... | {
return ByteSource.wrap(data).asCharSource(charset).readLines(new SingleLineProcessor());
}
/**
* Build the preview from the loaded lines
*
* @param lines
* @return
*/
public String buildDataPreview(@NonNull final List<String> lines)
{
String dataPreview = lines.stream()
.limit(MAX_LOADED_LINES)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\impexp\parser\FileImportReader.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SyncWeeklySupply implements IConfirmableDTO
{
String uuid;
boolean deleted;
long syncConfirmationId;
String bpartner_uuid;
String product_uuid;
LocalDate weekDay;
String trend;
int version;
@Builder(toBuilder = true)
@JsonCreator
public SyncWeeklySupply(
@JsonProperty("uuid") final String u... | this.bpartner_uuid = bpartner_uuid;
this.product_uuid = product_uuid;
this.weekDay = weekDay;
this.trend = trend;
this.version = version;
}
@Override
public String toString()
{
return "SyncWeeklySupply ["
+ "bpartner_uuid=" + bpartner_uuid
+ ", product_uuid=" + product_uuid
+ ", weekDay=" + w... | repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-procurement\src\main\java\de\metas\common\procurement\sync\protocol\dto\SyncWeeklySupply.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable String getUsername() {
return this.username;
}
public void setUsername(@Nullable String username) {
this.username = username;
}
public @Nullable String getPassword() {
return this.password;
}
public void setPassword(@Nullable String password) {
this.password = password;
}
public @Nu... | public static class Sniffer {
/**
* Whether the sniffer is enabled.
*/
private boolean enabled;
/**
* Interval between consecutive ordinary sniff executions.
*/
private Duration interval = Duration.ofMinutes(5);
/**
* Delay of a sniff execution scheduled after a failure.
*/
... | repos\spring-boot-4.0.1\module\spring-boot-elasticsearch\src\main\java\org\springframework\boot\elasticsearch\autoconfigure\ElasticsearchProperties.java | 2 |
请完成以下Java代码 | public ProductId getProductId()
{
return getCostSegmentAndElement().getProductId();
}
public UomId getUomId()
{
return getPrice().getUomId();
}
public CostElementId getCostElementId()
{
return getCostSegmentAndElement().getCostElementId();
}
public boolean isInboundCost()
{
return !getTrxType().isO... | final boolean qtyIsPositiveOrZero = qty.signum() >= 0;
if (amtIsNotZero && amtIsPositiveOrZero != qtyIsPositiveOrZero )
{
throw new AdempiereException("Amount and Quantity shall have the same sign: " + amt + ", " + qty);
}
final Quantity accumulatedQty = getAccumulatedQty();
final Quantity qtyConv = uomCo... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\PPOrderCost.java | 1 |
请完成以下Java代码 | public class FlatrateTermRefund_Handler
implements ConditionTypeSpecificInvoiceCandidateHandler
{
@Override
public String getConditionsType()
{
return X_C_Flatrate_Term.TYPE_CONDITIONS_Refund;
}
/**
* @return an empty iterator; invoice candidates that need to be there are created from {@link CandidateAssign... | return Quantity.of(ONE, uomRecord);
}
/**
* @return {@link PriceAndTax#NONE} because the tax remains unchanged and the price is updated in {@link CandidateAssignmentService}.
*/
@Override
public PriceAndTax calculatePriceAndTax(@NonNull final I_C_Invoice_Candidate invoiceCandidateRecord)
{
return PriceAndTa... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\refund\invoicecandidatehandler\FlatrateTermRefund_Handler.java | 1 |
请完成以下Java代码 | public class PDF2WordExample {
private static final String FILENAME = "src/main/resources/pdf.pdf";
public static void main(String[] args) {
try {
generateDocFromPDF(FILENAME);
} catch (IOException e) {
e.printStackTrace();
}
}
private static void generateDocFromPDF(String filename) throws IOExceptio... | PdfReaderContentParser parser = new PdfReaderContentParser(reader);
for (int i = 1; i <= reader.getNumberOfPages(); i++) {
TextExtractionStrategy strategy = parser.processContent(i, new SimpleTextExtractionStrategy());
String text = strategy.getResultantText();
XWPFParagraph p = doc.createParagraph();
XW... | repos\tutorials-master\text-processing-libraries-modules\pdf\src\main\java\com\baeldung\pdf\PDF2WordExample.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void persistAuthors() {
List<Author> authors = new ArrayList<>();
for (int i = 0; i < 100; i++) {
Author author = new Author();
author.setName("Name_" + i);
author.setGenre("Genre_" + i);
author.setAge((int) ((Math.random() + 0.1) * 100)); ... | authorRepository.deleteInBatch(authors);
}
// good if you want an alternative to deleteInBatch()
@Transactional
public void deleteAuthorsViaDeleteInBulk() {
List<Author> authors = authorRepository.findByAgeLessThan(60);
authorRepository.deleteInBulk(authors);
}
// good if... | repos\Hibernate-SpringBoot-master\HibernateSpringBootBatchDeleteSingleEntity\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | public void setC_BPartner_ID (final int C_BPartner_ID)
{
if (C_BPartner_ID < 1)
set_Value (COLUMNNAME_C_BPartner_ID, null);
else
set_Value (COLUMNNAME_C_BPartner_ID, C_BPartner_ID);
}
@Override
public int getC_BPartner_ID()
{
return get_ValueAsInt(COLUMNNAME_C_BPartner_ID);
}
@Override
public v... | @Override
public int getM_Picking_Job_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Picking_Job_ID);
}
@Override
public void setM_PickingSlot_ID (final int M_PickingSlot_ID)
{
if (M_PickingSlot_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_PickingSlot_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_PickingSlo... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\picking\model\X_M_PickingSlot.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private void sendFailureResponse(HttpServletResponse response, SecurityResponse securityResponse) {
try {
response.sendError(securityResponse.getStatus().value(), securityResponse.getMessage());
}
catch (Exception ex) {
logger.debug("Failed to send error response", ex);
}
}
}
/**
* {@link Se... | @Override
public @Nullable Object handle(HttpServletRequest request, @Nullable Map<String, String> body) {
SecurityResponse securityResponse = this.securityInterceptor.preHandle(request, this.endpointId);
if (!securityResponse.getStatus().equals(HttpStatus.OK)) {
return new ResponseEntity<Object>(securityRe... | repos\spring-boot-4.0.1\module\spring-boot-cloudfoundry\src\main\java\org\springframework\boot\cloudfoundry\autoconfigure\actuate\endpoint\servlet\CloudFoundryWebEndpointServletHandlerMapping.java | 2 |
请完成以下Java代码 | private static Executor createAsyncExecutor()
{
final CustomizableThreadFactory asyncThreadFactory = new CustomizableThreadFactory(LookupCacheInvalidationDispatcher.class.getSimpleName());
asyncThreadFactory.setDaemon(true);
return Executors.newSingleThreadExecutor(asyncThreadFactory);
}
@PostConstruct
priv... | .stream()
.filter(request -> !request.isAll()) // not relevant for our lookups
.map(CacheInvalidateRequest::getTableNameEffective)
.filter(Objects::nonNull)
.collect(ImmutableSet.toImmutableSet());
}
private void resetNow(final Set<String> tableNames)
{
if (tableNames.isEmpty())
{
return;
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\model\lookup\LookupCacheInvalidationDispatcher.java | 1 |
请完成以下Java代码 | public int getLink_BankStatementLine_ID()
{
return get_ValueAsInt(COLUMNNAME_Link_BankStatementLine_ID);
}
@Override
public void setMemo (final @Nullable java.lang.String Memo)
{
set_Value (COLUMNNAME_Memo, Memo);
}
@Override
public java.lang.String getMemo()
{
return get_ValueAsString(COLUMNNAME_Mem... | @Override
public java.lang.String getReferenceNo()
{
return get_ValueAsString(COLUMNNAME_ReferenceNo);
}
@Override
public void setStatementLineDate (final java.sql.Timestamp StatementLineDate)
{
set_Value (COLUMNNAME_StatementLineDate, StatementLineDate);
}
@Override
public java.sql.Timestamp getStateme... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-gen\org\compiere\model\X_C_BankStatementLine.java | 1 |
请完成以下Java代码 | public class QueueProcessorFactory implements IQueueProcessorFactory
{
private final QueueProcessorDescriptorIndex queueProcessorDescriptorIndex = QueueProcessorDescriptorIndex.getInstance();
private final IWorkPackageQueueFactory workPackageQueueFactory = Services.get(IWorkPackageQueueFactory.class);
private IWork... | private IQueueProcessorEventDispatcher queueProcessorEventDispatcher = new DefaultQueueProcessorEventDispatcher();
@Override
public IQueueProcessorEventDispatcher getQueueProcessorEventDispatcher()
{
return queueProcessorEventDispatcher;
}
@Override
public IQueueProcessor createAsynchronousQueueProcessor(@Non... | repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\impl\QueueProcessorFactory.java | 1 |
请完成以下Java代码 | public int getC_DocType_PrintOptions_ID()
{
return get_ValueAsInt(COLUMNNAME_C_DocType_PrintOptions_ID);
}
@Override
public void setDescription (final java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
@Override
public java.lang.String getDescription()
{
return get_Val... | {
set_Value (COLUMNNAME_PRINTER_OPTS_IsPrintLogo, PRINTER_OPTS_IsPrintLogo);
}
@Override
public boolean isPRINTER_OPTS_IsPrintLogo()
{
return get_ValueAsBoolean(COLUMNNAME_PRINTER_OPTS_IsPrintLogo);
}
@Override
public void setPRINTER_OPTS_IsPrintTotals (final boolean PRINTER_OPTS_IsPrintTotals)
{
set_V... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DocType_PrintOptions.java | 1 |
请完成以下Java代码 | class InOutCostsViewFilterHelper
{
public static final String FILTER_ID = "default";
public static String PARAM_C_BPartner_ID = "C_BPartner_ID";
public static String PARAM_C_Order_ID = "C_Order_ID";
public static String PARAM_C_Cost_Type_ID = I_C_Cost_Type.COLUMNNAME_C_Cost_Type_ID;
public static DocumentFilterD... | private static DocumentFilterParamDescriptor.Builder newParamDescriptor(final String fieldName)
{
return DocumentFilterParamDescriptor.builder()
.fieldName(fieldName)
.displayName(TranslatableStrings.adElementOrMessage(fieldName));
}
public static InOutCostQuery toInOutCostQuery(
@NonNull final SOTrx s... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\invoice\match_inout_costs\InOutCostsViewFilterHelper.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class LastInvoiceCostingMethodHandler extends CostingMethodHandlerTemplate
{
public LastInvoiceCostingMethodHandler(@NonNull final CostingMethodHandlerUtils utils)
{
super(utils);
}
@Override
public CostingMethod getCostingMethod()
{
return CostingMethod.LastInvoice;
}
@Override
protected CostDeta... | protected CostDetailCreateResult createOutboundCostDefaultImpl(final CostDetailCreateRequest request)
{
final CurrentCost currentCosts = utils.getCurrentCost(request);
final CostDetailPreviousAmounts previousCosts = CostDetailPreviousAmounts.of(currentCosts);
final CostDetailCreateResult result = utils.createCo... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\methods\LastInvoiceCostingMethodHandler.java | 2 |
请完成以下Java代码 | public void setQuery(String query) {
this.query = query;
}
public @Nullable String getQuery() {
return this.query;
}
public void setOperationName(@Nullable String operationName) {
this.operationName = operationName;
}
@Override
public @Nullable String getOperationName() {
return this.operationName;
}... | }
@Override
public String getDocument() {
if (this.query == null) {
if (this.extensions.get("persistedQuery") != null) {
return PersistedQuerySupport.PERSISTED_QUERY_MARKER;
}
throw new ServerWebInputException("No 'query'");
}
return this.query;
}
@Override
public Map<String, Object> toMap() {... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\server\support\SerializableGraphQlRequest.java | 1 |
请完成以下Java代码 | public org.compiere.model.I_C_ElementValue getUser1()
{
return get_ValueAsPO(COLUMNNAME_User1_ID, org.compiere.model.I_C_ElementValue.class);
}
@Override
public void setUser1(final org.compiere.model.I_C_ElementValue User1)
{
set_ValueFromPO(COLUMNNAME_User1_ID, org.compiere.model.I_C_ElementValue.class, User... | @Override
public void setUserFlag (final @Nullable java.lang.String UserFlag)
{
set_Value (COLUMNNAME_UserFlag, UserFlag);
}
@Override
public java.lang.String getUserFlag()
{
return get_ValueAsString(COLUMNNAME_UserFlag);
}
@Override
public void setExternalSystem_ID (final int ExternalSystem_ID)
{
if... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Invoice.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MyInvocationSecurityMetadataSourceService implements FilterInvocationSecurityMetadataSource {
@Autowired
private PermissionMapper permissionMapper;
/**
* 每一个资源所需要的角色 Collection<ConfigAttribute>决策器会用到
*/
private static HashMap<String, Collection<ConfigAttribute>> map =null;
... | }
/**
* 初始化 所有资源 对应的角色
*/
public void loadResourceDefine() {
map = new HashMap<>(16);
//权限资源 和 角色对应的表 也就是 角色权限 中间表
List<RolePermisson> rolePermissons = permissionMapper.getRolePermissions();
//某个资源 可以被哪些角色访问
for (RolePermisson rolePermisson : rolePermissons) ... | repos\SpringBootLearning-master (1)\springboot-jwt\src\main\java\com\gf\config\MyInvocationSecurityMetadataSourceService.java | 2 |
请完成以下Java代码 | protected static boolean isBoolean(Object obj) {
return obj instanceof Boolean;
}
protected static boolean isDate(Object obj) {
return (obj instanceof Date || obj instanceof DateTime || obj instanceof LocalDate || obj instanceof java.time.LocalDate || obj instanceof LocalDateTime
... | if (entry.getValue() == null) {
// do nothing
} else if (entry.getValue() instanceof Long) {
newValue = Long.valueOf(((Long) entry.getValue()).longValue());
} else if (entry.getValue() instanceof Double) {
newValue = Double.valu... | repos\flowable-engine-main\modules\flowable-dmn-api\src\main\java\org\flowable\dmn\api\DecisionExecutionAuditContainer.java | 1 |
请完成以下Java代码 | public void setUserAgent (String UserAgent)
{
set_Value (COLUMNNAME_UserAgent, UserAgent);
}
/** Get User Agent.
@return Browser Used
*/
public String getUserAgent ()
{
return (String)get_Value(COLUMNNAME_UserAgent);
}
public I_W_CounterCount getW_CounterCount() throws RuntimeException
{
return... | {
Integer ii = (Integer)get_Value(COLUMNNAME_W_CounterCount_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Web Counter.
@param W_Counter_ID
Individual Count hit
*/
public void setW_Counter_ID (int W_Counter_ID)
{
if (W_Counter_ID < 1)
set_ValueNoCheck (COLUMNNAME_W_Counter_I... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_Counter.java | 1 |
请完成以下Java代码 | public class WordFilter extends java.util.Hashtable<String, Object> implements Filter
{
/**
*
*/
private static final long serialVersionUID = 7530768970669548477L;
public WordFilter()
{
super(4);
}
/** Returns the name of the filter */
public String getInfo()
{
return "WordFil... | }
/**
Get rid of a current filter.
*/
public Filter removeAttribute(String attribute)
{
try
{
remove(attribute);
}
catch(NullPointerException exc)
{ // don't really care if this throws a null pointer exception
}
return(this);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\tools\src\main\java-legacy\org\apache\ecs\filter\WordFilter.java | 1 |
请完成以下Java代码 | public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final ArchiveSetDataRequest other = (ArchiveSetDataRequest)obj;
if (adArchiveId != other.adArchiveId)
{
return false;
... | public int getSessionId()
{
return sessionId;
}
public void setSessionId(final int sessionId)
{
this.sessionId = sessionId;
}
public int getAdArchiveId()
{
return adArchiveId;
}
public void setAdArchiveId(final int adArchiveId)
{
this.adArchiveId = adArchiveId;
}
public byte[] getData()
{
ret... | repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive.api\src\main\java\de\metas\document\archive\esb\api\ArchiveSetDataRequest.java | 1 |
请完成以下Java代码 | public String getAmiId() {
return amiId;
}
public String getHostname() {
return hostname;
}
public String getInstanceType() {
return instanceType;
}
public String getServiceDomain() {
return serviceDomain;
}
public String getName() {
return nam... | StringBuilder builder = new StringBuilder();
builder.append("EC2Metadata [amiId=");
builder.append(amiId);
builder.append(", hostname=");
builder.append(hostname);
builder.append(", instanceType=");
builder.append(instanceType);
builder.append(", serviceDomain=");... | repos\tutorials-master\spring-cloud-modules\spring-cloud-aws\src\main\java\com\baeldung\spring\cloud\aws\ec2\EC2Metadata.java | 1 |
请完成以下Java代码 | public class URLTokenizer
{
/**
* 预置分词器
*/
public static final Segment SEGMENT = HanLP.newSegment();
private static final Pattern WEB_URL = Pattern.compile("((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:... | List<Term> termList = new LinkedList<Term>();
Matcher matcher = WEB_URL.matcher(text);
int begin = 0;
int end;
while (matcher.find())
{
end = matcher.start();
termList.addAll(SEGMENT.seg(text.substring(begin, end)));
termList.add(new Term(match... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\tokenizer\URLTokenizer.java | 1 |
请完成以下Java代码 | public class ByteArrayValueSerializer extends PrimitiveValueSerializer<BytesValue> {
public ByteArrayValueSerializer() {
super(ValueType.BYTES);
}
public BytesValue convertToTypedValue(UntypedValueImpl untypedValue) {
Object value = untypedValue.getValue();
if (value instanceof byte[]) {
retur... | public BytesValue readValue(ValueFields valueFields, boolean asTransientValue) {
return Variables.byteArrayValue(valueFields.getByteArrayValue(), asTransientValue);
}
public void writeValue(BytesValue variableValue, ValueFields valueFields) {
valueFields.setByteArrayValue(variableValue.getValue());
}
... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\variable\serializer\ByteArrayValueSerializer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MqttTransportHealthChecker extends TransportHealthChecker<MqttTransportMonitoringConfig> {
private MqttClient mqttClient;
private static final String DEVICE_TELEMETRY_TOPIC = "v1/devices/me/telemetry";
protected MqttTransportHealthChecker(MqttTransportMonitoringConfig config, TransportMonito... | mqttClient.publish(DEVICE_TELEMETRY_TOPIC, message);
}
@Override
protected void destroyClient() throws Exception {
if (mqttClient != null) {
mqttClient.disconnect();
mqttClient = null;
log.info("Disconnected MQTT client");
}
}
@Override
prote... | repos\thingsboard-master\monitoring\src\main\java\org\thingsboard\monitoring\service\transport\impl\MqttTransportHealthChecker.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public InMemoryUserDetailsManager userDetailsService() {
UserDetails user1 = User.withUsername("user1")
.password("user1Pass")
.roles("USER")
.build();
UserDetails user2 = User.withUsername("user2")
.password("user2Pass")
.roles("USER")
... | .loginProcessingUrl("/perform_login")
.defaultSuccessUrl("/homepage.html", true)
.failureUrl("/login.html?error=true")
.and()
.logout()
.logoutUrl("/perform_logout")
.deleteCookies("JSESSIONID")
.logoutSuccessHandler(logoutSuccessHandle... | repos\tutorials-master\spring-security-modules\spring-security-web-login-2\src\main\java\com\baeldung\spring\ChannelSecSecurityConfig.java | 2 |
请完成以下Java代码 | public static StockQtyAndUOMQty toZeroIfPositive(@NonNull final StockQtyAndUOMQty stockQtyAndUOMQty)
{
return stockQtyAndUOMQty.signum() > 0
? stockQtyAndUOMQty.toZero()
: stockQtyAndUOMQty;
}
public Quantity getQtyInUOM(@NonNull final UomId uomId, @NonNull final QuantityUOMConverter converter)
{
if (u... | {
return uomQty.switchToSource();
}
}
if (UomId.equals(stockQty.getUomId(), uomId))
{
return stockQty;
}
else if (UomId.equals(stockQty.getSourceUomId(), uomId))
{
return stockQty.switchToSource();
}
return converter.convertQuantityTo(stockQty, productId, uomId);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\quantity\StockQtyAndUOMQty.java | 1 |
请完成以下Java代码 | public class OAuth2ClientRegistrationAuthenticationToken extends AbstractAuthenticationToken {
@Serial
private static final long serialVersionUID = 7135429161909989115L;
@Nullable
private final Authentication principal;
private final OAuth2ClientRegistration clientRegistration;
/**
* Constructs an {@code OA... | return this.principal;
}
@Override
public Object getCredentials() {
return "";
}
/**
* Returns the client registration.
* @return the client registration
*/
public OAuth2ClientRegistration getClientRegistration() {
return this.clientRegistration;
}
} | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\OAuth2ClientRegistrationAuthenticationToken.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getTypeName() {
return TYPE_NAME;
}
@Override
public boolean isCachable() {
return true;
}
@Override
public boolean isAbleToStore(Object value) {
if (value == null) {
return true;
}
return LocalDate.class.isAssignableFrom(value.... | "Using Joda-Time LocalDate has been deprecated and will be removed in a future version. Task Variable {} in task {} was a Joda-Time LocalDate. ",
valueFields.getName(), valueFields.getTaskId());
} else if (valueFields.getProcessInstanceId() != null) {
JodaDeprecationL... | repos\flowable-engine-main\modules\flowable-variable-service\src\main\java\org\flowable\variable\service\impl\types\JodaDateType.java | 2 |
请完成以下Java代码 | public void setM_HU_PI_Version(final de.metas.handlingunits.model.I_M_HU_PI_Version M_HU_PI_Version)
{
set_ValueFromPO(COLUMNNAME_M_HU_PI_Version_ID, de.metas.handlingunits.model.I_M_HU_PI_Version.class, M_HU_PI_Version);
}
@Override
public void setM_HU_PI_Version_ID (final int M_HU_PI_Version_ID)
{
if (M_HU_... | }
@Override
public int getM_Locator_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Locator_ID);
}
@Override
public void setSnapshot_UUID (final java.lang.String Snapshot_UUID)
{
set_Value (COLUMNNAME_Snapshot_UUID, Snapshot_UUID);
}
@Override
public java.lang.String getSnapshot_UUID()
{
return get_Valu... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Snapshot.java | 1 |
请完成以下Java代码 | public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
@Override
public String getRootProcessInstanceId() {
return rootProcessInstanceId;
}
public void setRootProcessInstanceId(String rootProcessInstanceId) {
this.rootProc... | @Override
public String toString() {
return this.getClass().getSimpleName()
+ "[id=" + id
+ ", type=" + type
+ ", userId=" + userId
+ ", time=" + time
+ ", taskId=" + taskId
+ ", processInstanceId=" + processInstanceId
+ ", rootProcessIn... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\CommentEntity.java | 1 |
请完成以下Java代码 | public void updateBPartnerAddressOverride(final I_M_ReceiptSchedule sched)
{
final IReceiptScheduleBL receiptScheduleBL = Services.get(IReceiptScheduleBL.class);
receiptScheduleBL.updateBPartnerAddressOverride(sched);
}
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE }... | @ModelChange(timings = { ModelValidator.TYPE_BEFORE_NEW, ModelValidator.TYPE_BEFORE_CHANGE },
ifColumnsChanged = { I_M_ReceiptSchedule.COLUMNNAME_IsActive,
I_M_ReceiptSchedule.COLUMNNAME_M_Warehouse_Override_ID,
I_M_ReceiptSchedule.COLUMNNAME_DeliveryRule_Override,
I_M_ReceiptSchedule.COLUMNNAME_Prior... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\modelvalidator\M_ReceiptSchedule.java | 1 |
请完成以下Java代码 | public TableMetaData getTableMetaData(String tableName) {
TableMetaData result = new TableMetaData();
try {
result.setTableName(tableName);
DatabaseMetaData metaData = getDbSqlSession().getSqlSession().getConnection().getMetaData();
if ("postgres".equals(getDbSqlSess... | String columnName = resultSet.getMetaData().getColumnName(i + 1);
if ("TABLE_SCHEM".equalsIgnoreCase(columnName) || "TABLE_SCHEMA".equalsIgnoreCase(columnName)) {
if (
!schema.equalsIgnoreCase(
result... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\TableDataManagerImpl.java | 1 |
请完成以下Java代码 | public I_AD_ReportView getAD_ReportView() throws RuntimeException
{
return (I_AD_ReportView)MTable.get(getCtx(), I_AD_ReportView.Table_Name)
.getPO(getAD_ReportView_ID(), get_TrxName()); }
/** Set Report View.
@param AD_ReportView_ID
View used to generate this report
*/
public void setAD_ReportView_... | set_Value (COLUMNNAME_FunctionColumn, FunctionColumn);
}
/** Get Function Column.
@return Overwrite Column with Function
*/
public String getFunctionColumn ()
{
return (String)get_Value(COLUMNNAME_FunctionColumn);
}
/** Set SQL Group Function.
@param IsGroupFunction
This function will generate a G... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ReportView_Col.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static class LogEntriesQuery
{
public static LogEntriesQuery of(@NonNull final TableRecordReference tableRecordReference)
{
return LogEntriesQuery.builder()
.tableRecordReference(tableRecordReference)
.followLocationIdChanges(false)
.build();
}
@Singular
List<TableRecordReference> t... | * <li>{@code Created}, but note that the {@code C_Location} record's {@code Created} value is used in the {@link RecordChangeLogEntry}
* <li>{@code CreatedBy} same as {@code Created}
* <li>{@code Updated} and {@code UpdatedBy}: since {@code C_Location} is immutable, they don't matter anyways
* <li>{@code IsA... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\LogEntriesRepository.java | 2 |
请完成以下Java代码 | private final boolean isEmpty()
{
return facets.isEmpty() && facetCategories.isEmpty();
}
public Builder<ModelType> addFacetCategory(final IFacetCategory facetCategory)
{
Check.assumeNotNull(facetCategory, "facetCategory not null");
facetCategories.add(facetCategory);
return this;
}
public Bui... | /** @return true if there was added at least one facet */
public boolean hasFacets()
{
return !facets.isEmpty();
}
public Builder<ModelType> addFacetCollectorResult(final IFacetCollectorResult<ModelType> facetCollectorResult)
{
// NOTE: we need to add the categories first, to make sure we preserve the ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\facet\impl\FacetCollectorResult.java | 1 |
请完成以下Java代码 | public static String printAnIsoscelesTriangleUsingStringUtils(int N) {
StringBuilder result = new StringBuilder();
for (int r = 1; r <= N; r++) {
result.append(StringUtils.repeat(' ', N - r));
result.append(StringUtils.repeat('*', 2 * r - 1));
result.append(System.li... | for (int r = 0; r < N; r++) {
result.append(helperString.substring(r, N + 2 * r));
result.append(System.lineSeparator());
}
return result.toString();
}
public static void main(String[] args) {
System.out.println(printARightTriangle(5));
System.out.println... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-3\src\main\java\com\baeldung\algorithms\printtriangles\PrintTriangleExamples.java | 1 |
请完成以下Spring Boot application配置 | spring.jpa.properties.hibernate.globally_quoted_identifiers=true
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.hibernate.ddl-auto=update
# Disable Hibernate validation
spring.jpa.pro | perties.jakarta.persistence.validation.mode=none
com.baeldung.tenant.channels[0]=retail
com.baeldung.tenant.channels[1]=wholesale | repos\tutorials-master\spring-boot-modules\spring-boot-validation\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public void setReversal_ID (final int Reversal_ID)
{
if (Reversal_ID < 1)
set_Value (COLUMNNAME_Reversal_ID, null);
else
set_Value (COLUMNNAME_Reversal_ID, Reversal_ID);
}
@Override
public int getReversal_ID()
{
return get_ValueAsInt(COLUMNNAME_Reversal_ID);
}
@Override
public void setUpdateQty... | @Override
public org.compiere.model.I_C_ElementValue getUser2()
{
return get_ValueAsPO(COLUMNNAME_User2_ID, org.compiere.model.I_C_ElementValue.class);
}
@Override
public void setUser2(final org.compiere.model.I_C_ElementValue User2)
{
set_ValueFromPO(COLUMNNAME_User2_ID, org.compiere.model.I_C_ElementValue.... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_Inventory.java | 1 |
请完成以下Java代码 | private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws Exception {
Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
if (workbook != null);
downLoadExcel(fileName, response, workbook);
}
public static ... | public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws Exception {
if (file == null){
return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(heade... | repos\springboot-demo-master\eaypoi\src\main\java\com\et\easypoi\Util\FileUtil.java | 1 |
请完成以下Java代码 | private JsonExternalReferenceLookupResponse createResponseFromRepoResult(
@NonNull final ImmutableMap<JsonExternalReferenceLookupItem, ExternalReferenceQuery> item2Query,
@NonNull final ExternalReferenceQueriesResult externalReferences)
{
final JsonExternalReferenceLookupResponse.JsonExternalReferenceLookupRes... | else
{
responseItem = JsonExternalReferenceItem.builder()
.lookupItem(lookupItem)
.metasfreshId(JsonMetasfreshId.of(externalReference.getRecordId()))
.externalReference(externalReference.getExternalReference())
.version(externalReference.getVersion())
.externalReferenceUrl(externalR... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalreference\src\main\java\de\metas\externalreference\rest\v2\ExternalReferenceRestControllerService.java | 1 |
请完成以下Java代码 | private static Method getDumpHeapMethod(Class<?> mxBeanClass) {
Method method = ReflectionUtils.findMethod(mxBeanClass, "triggerDumpToFile", String.class, String.class);
Assert.state(method != null, "'method' must not be null");
return method;
}
@Override
public File dumpHeap(@Nullable Boolean live) thr... | }
@Override
public InputStream getInputStream() throws IOException {
return new FilterInputStream(super.getInputStream()) {
@Override
public void close() throws IOException {
closeThenDeleteFile(this.in);
}
};
}
private void closeThenDeleteFile(Closeable closeable) throws IOException ... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\management\HeapDumpWebEndpoint.java | 1 |
请完成以下Java代码 | protected boolean afterSave(boolean newRecord, boolean success)
{
// Update Fields
if (!newRecord)
{
if (is_ValueChanged(MColumn.COLUMNNAME_Name)
|| is_ValueChanged(MColumn.COLUMNNAME_Description)
|| is_ValueChanged(MColumn.COLUMNNAME_Help))
{
StringBuilder sql = new StringBuilder("UPDATE AD_... | }
catch (SQLException e)
{
s_log.error(SQL, e);
retValue = -1;
}
return retValue;
}
// end vpj-cd e-evolution
/**
* Get Table Id for a column
*
* @param ctx context
* @param AD_Column_ID id
* @param trxName transaction
* @return MColumn
*/
public static int getTable_ID(Properties ctx, i... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MColumn.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public static class ResponseParam {
private int code;
priv... | public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
} | repos\spring-boot-leaning-master\2.x_42_courses\第 2-9 课:Spring Boot 中使用 Swagger2 构建 RESTful APIs\spring-boot-swagger\src\main\java\com\neo\config\BaseResult.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class EjbProcessEngineService implements ProcessEngineService {
@EJB
protected EjbBpmPlatformBootstrap ejbBpmPlatform;
/** the processEngineServiceDelegate */
protected ProcessEngineService processEngineServiceDelegate;
@PostConstruct
protected void initProcessEngineServiceDelegate() {
p... | }
public List<ProcessEngine> getProcessEngines() {
return processEngineServiceDelegate.getProcessEngines();
}
public Set<String> getProcessEngineNames() {
return processEngineServiceDelegate.getProcessEngineNames();
}
public ProcessEngine getProcessEngine(String name) {
return processEngineServ... | repos\camunda-bpm-platform-master\javaee\ejb-service\src\main\java\org\camunda\bpm\container\impl\ejb\EjbProcessEngineService.java | 2 |
请完成以下Java代码 | public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getSystemHost() {
return systemHost;
}
public void setSystemHost(String systemHost) {
this.systemHost = systemHost;
}
public String getStatus() {
return status;
}
public void setStatus(... | public void setLastAccessTime(Date lastAccessTime) {
this.lastAccessTime = lastAccessTime;
}
public Long getTimeout() {
return timeout;
}
public void setTimeout(Long timeout) {
this.timeout = timeout;
}
} | repos\SpringAll-master\17.Spring-Boot-Shiro-Session\src\main\java\com\springboot\pojo\UserOnline.java | 1 |
请完成以下Java代码 | public String getPropagationType()
{
return X_M_HU_PI_Attribute.PROPAGATIONTYPE_NoPropagation;
}
/**
* @return {@link NullAggregationStrategy#instance}.
*/
@Override
public IAttributeAggregationStrategy retrieveAggregationStrategy()
{
return NullAggregationStrategy.instance;
}
/**
* @return {@link N... | return false;
}
/**
* @return our attribute instance's {@code M_Attribute_ID}.
*/
@Override
public int getDisplaySeqNo()
{
return attributeInstance.getM_Attribute_ID();
}
/**
* @return {@code true}
*/
@Override
public boolean isUseInASI()
{
return true;
}
/**
* @return {@code false}, since ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\attribute\storage\AIAttributeValue.java | 1 |
请完成以下Java代码 | static void validateAndAddDPoPParametersIfAvailable(HttpServletRequest request,
Map<String, Object> additionalParameters) {
final String dPoPProofHeaderName = OAuth2AccessToken.TokenType.DPOP.getValue();
String dPoPProof = request.getHeader(dPoPProofHeaderName);
if (StringUtils.hasText(dPoPProof)) {
if (Col... | throw new OAuth2AuthenticationException(error);
}
static String normalizeUserCode(String userCode) {
Assert.hasText(userCode, "userCode cannot be empty");
StringBuilder sb = new StringBuilder(userCode.toUpperCase(Locale.ENGLISH).replaceAll("[^A-Z\\d]+", ""));
Assert.isTrue(sb.length() == 8, "userCode must be e... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\web\authentication\OAuth2EndpointUtils.java | 1 |
请完成以下Java代码 | public static OrderLinePriceUpdateRequestBuilder prepare(final org.compiere.model.I_C_OrderLine orderLine)
{
return builder()
.updateLineNetAmt(true)
.orderLine(InterfaceWrapperHelper.create(orderLine, I_C_OrderLine.class))
.resultUOM(ResultUOM.PRICE_UOM_IF_ORDERLINE_IS_NEW);
}
public enum ResultUOM
... | //
// Updating the order line options
boolean updatePriceEnteredAndDiscountOnlyIfNotAlreadySet; // task 06727
boolean updateLineNetAmt;
@Default
boolean applyPriceLimitRestrictions = true;
boolean updateProfitPriceActual;
//
//
//
public static class OrderLinePriceUpdateRequestBuilder
{
public OrderLi... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\OrderLinePriceUpdateRequest.java | 1 |
请完成以下Java代码 | protected DockerComposeFile getComposeFile() {
DockerComposeFile composeFile = (CollectionUtils.isEmpty(this.properties.getFile()))
? DockerComposeFile.find(this.workingDirectory) : DockerComposeFile.of(this.properties.getFile());
Assert.state(composeFile != null, () -> "No Docker Compose file found in director... | private boolean isIgnored(RunningService service) {
return service.labels().containsKey(IGNORE_LABEL);
}
/**
* Publish a {@link DockerComposeServicesReadyEvent} directly to the event listeners
* since we cannot call {@link ApplicationContext#publishEvent} this early.
* @param event the event to publish
*/
... | repos\spring-boot-4.0.1\core\spring-boot-docker-compose\src\main\java\org\springframework\boot\docker\compose\lifecycle\DockerComposeLifecycleManager.java | 1 |
请完成以下Java代码 | public void actionPerformed(ActionEvent e)
{
log.info(e.toString());
// Add new Node
if (e.getSource() == m_NewMenuNode)
{
log.info("Create New Node");
String nameLabel = Util.cleanAmp(msgBL.getMsg(Env.getCtx(), "Name"));
String name = JOptionPane.showInputDialog(this,
nameLabel, // m... | /**
* The Line
*/
private final WorkflowNodeTransitionModel m_line;
/**
* The Next Node ID
*/
private final WFNodeId nodeToId;
/**
* Execute
*/
public void execute()
{
// Add Line
if (m_node != null && nodeToId != null)
{
final I_AD_WF_NodeNext newLine = InterfaceWrapperHelpe... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\wf\WFContentPanel.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.