instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public void setSalesRep_ID (int SalesRep_ID)
{
if (SalesRep_ID < 1)
set_Value (COLUMNNAME_SalesRep_ID, null);
else
set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
}
/** Get Aussendienst.
@return Aussendienst */
@Override
public int getSalesRep_ID ()
{
Integer ii = (Integer)ge... | @return Gültig ab inklusiv (erster Tag)
*/
@Override
public java.sql.Timestamp getValidFrom ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Gültig bis.
@param ValidTo
Gültig bis inklusiv (letzter Tag)
*/
@Override
public void setValidTo (java.sql.Timestamp ValidTo)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.materialtracking\src\main\java-gen\de\metas\materialtracking\model\X_M_Material_Tracking.java | 1 |
请完成以下Java代码 | public void setMD_Available_For_Sales_ID (final int MD_Available_For_Sales_ID)
{
if (MD_Available_For_Sales_ID < 1)
set_ValueNoCheck (COLUMNNAME_MD_Available_For_Sales_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MD_Available_For_Sales_ID, MD_Available_For_Sales_ID);
}
@Override
public int getMD_Availa... | @Override
public void setQtyToBeShipped (final @Nullable BigDecimal QtyToBeShipped)
{
set_Value (COLUMNNAME_QtyToBeShipped, QtyToBeShipped);
}
@Override
public BigDecimal getQtyToBeShipped()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyToBeShipped);
return bd != null ? bd : BigDecimal.ZERO;... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_MD_Available_For_Sales.java | 1 |
请完成以下Java代码 | public String getRdesc() {
return rdesc;
}
public void setRdesc(String rdesc) {
this.rdesc = rdesc;
}
public String getRval() {
return rval;
}
public void setRval(String rval) {
this.rval = rval;
}
public Date getCreated() { | return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getUpdated() {
return updated;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
} | repos\spring-boot-quick-master\quick-spring-shiro\src\main\java\com\shiro\entity\Role.java | 1 |
请完成以下Java代码 | public class HRCreatePeriods extends JavaProcess
{
/**
* Prepare
*/
protected void prepare ()
{
// prepare
}
/**
* Process
* @return info
* @throws Exception
*/
protected String doIt ()
throws Exception
{
int year_ID = getRecord_ID(); | MHRYear year = new MHRYear (getCtx(), getRecord_ID(), get_TrxName());
if (year.get_ID() <= 0 || year.get_ID() != year_ID)
return "Year not exist";
else if(year.isProcessed())
return "No Created, The Period's exist";
log.info(year.toString());
//
if (year.createPeriods())
{
//arhipac: Cristina Ghi... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.libero.liberoHR\src\main\java\org\eevolution\process\HRCreatePeriods.java | 1 |
请完成以下Java代码 | public class C_Payment_Reservation_AuthorizePayPalOrder extends JavaProcess implements IProcessPrecondition
{
private final PayPal paypal = SpringContextHolder.instance.getBean(PayPal.class);
@Override
public ProcessPreconditionsResolution checkPreconditionsApplicable(IProcessPreconditionsContext context)
{
fina... | return ProcessPreconditionsResolution.accept();
}
@Override
protected String doIt()
{
final PaymentReservationId reservationId = getPaymentReservationId();
paypal.authorizePayPalReservation(reservationId);
return MSG_OK;
}
private PaymentReservationId getPaymentReservationId()
{
return PaymentReservati... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.paypal\src\main\java\de\metas\payment\paypal\ui\process\C_Payment_Reservation_AuthorizePayPalOrder.java | 1 |
请完成以下Java代码 | public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Received Inquiry Reply.
@param ReceiveInquiryReply Received Inquiry Reply */
public void setReceiveInquiryReply (boolean ReceiveInquiryReply)
{
set_Value (COLUMNNAME_ReceiveInquiryReply, Boolean.value... | @return Quantity Availability Inquiry
*/
public boolean isSendInquiry ()
{
Object oo = get_Value(COLUMNNAME_SendInquiry);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Send Order.
@param SendOrder Se... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_BP_EDI.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setConsumerBatchEnabled(boolean consumerBatchEnabled) {
this.consumerBatchEnabled = consumerBatchEnabled;
if (consumerBatchEnabled) {
setBatchListener(true);
}
}
/**
* Set to {@code true} to enforce {@link com.rabbitmq.client.Channel#basicAck(long, boolean)}
* for {@link org.springframework.... | concurrency = endpoint.getConcurrency();
javaUtils.acceptIfNotNull(concurrency, instance::setConcurrency);
}
javaUtils
.acceptIfCondition(concurrency == null && this.concurrentConsumers != null, this.concurrentConsumers,
instance::setConcurrentConsumers)
.acceptIfCondition((concurrency == null || !... | repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\config\SimpleRabbitListenerContainerFactory.java | 2 |
请完成以下Java代码 | private static WarehouseInfo fromRecord(final I_M_Warehouse record)
{
return WarehouseInfo.builder()
.warehouseId(WarehouseId.ofRepoId(record.getM_Warehouse_ID()))
.warehouseName(record.getName())
.build();
}
public String getLocatorName(final LocatorId locatorId)
{
return getWarehouseLocators(loca... | .locators(dao.getLocators(warehouseId)
.stream()
.map(WarehousesLoadingCache::fromRecord)
.collect(ImmutableList.toImmutableList()))
.build();
}
private static LocatorInfo fromRecord(final I_M_Locator record)
{
return LocatorInfo.builder()
.locatorId(LocatorId.ofRepoId(record.getM_Wareh... | repos\metasfresh-new_dawn_uat\backend\de.metas.inventory.mobileui\src\main\java\de\metas\inventory\mobileui\deps\warehouse\WarehousesLoadingCache.java | 1 |
请完成以下Java代码 | public void complete() {
this.asyncContext.complete();
}
@Override
public void start(Runnable run) {
this.asyncContext.start(new DelegatingSecurityContextRunnable(run));
}
@Override
public void addListener(AsyncListener listener) {
this.asyncContext.addListener(listener);
}
@Override
publi... | @Override
public <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException {
return this.asyncContext.createListener(clazz);
}
@Override
public long getTimeout() {
return this.asyncContext.getTimeout();
}
@Override
public void setTimeout(long timeout) {
this.asyncContex... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\servletapi\HttpServlet3RequestFactory.java | 1 |
请完成以下Java代码 | private Mono<Void> save() {
return Mono.defer(() -> saveChangeSessionId().then(saveDelta()).doOnSuccess((aVoid) -> this.isNew = false));
}
private Mono<Void> saveDelta() {
if (this.delta.isEmpty()) {
return Mono.empty();
}
String sessionKey = getSessionKey(getId());
Mono<Boolean> update = React... | this.originalSessionId = sessionId;
s.onComplete();
};
if (this.isNew) {
return Mono.from(replaceSessionId);
}
else {
String originalSessionKey = getSessionKey(this.originalSessionId);
String sessionKey = getSessionKey(sessionId);
return ReactiveRedisSessionRepository.this.sessionRedis... | repos\spring-session-main\spring-session-data-redis\src\main\java\org\springframework\session\data\redis\ReactiveRedisSessionRepository.java | 1 |
请完成以下Java代码 | public final class ImmutableModelCacheInvalidateRequestFactoriesList
{
private final ImmutableSetMultimap<String, ModelCacheInvalidateRequestFactory> factoriesByTableName;
@Getter private final TableNamesGroup tableNamesToEnableRemoveCacheInvalidation;
@Builder
private ImmutableModelCacheInvalidateRequestFactories... | public String toString()
{
return MoreObjects.toStringHelper(this)
.add("size", factoriesByTableName.size())
.add("factories", factoriesByTableName)
.toString();
}
public int size() {return factoriesByTableName.size();}
public Set<ModelCacheInvalidateRequestFactory> getFactoriesByTableName(@NonNull ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\model\ImmutableModelCacheInvalidateRequestFactoriesList.java | 1 |
请完成以下Java代码 | public void onSuccess(WriteRequest request, WriteResponse response) {
client.getSharedAttributes().put(versionedId, tsKvProto);
super.onSuccess(request, response);
}
});
} else if (logFailedUpdateOfNonChangedValue) {
log.warn("Didn'... | ResourceModel.Type expectedType = helper.getResourceModelTypeEqualsKvProtoValueType(currentType, pathIdVer);
if (!resourceValue.isMultiInstances()) {
return LwM2mValueConverterImpl.getInstance().convertValue(resourceValue.getValue(), currentType, expectedType,
new LwM... | repos\thingsboard-master\common\transport\lwm2m\src\main\java\org\thingsboard\server\transport\lwm2m\server\attributes\DefaultLwM2MAttributesService.java | 1 |
请完成以下Java代码 | public class HibernateUtil {
private static SessionFactory sessionFactory;
private static String PROPERTY_FILE_NAME;
public static SessionFactory getSessionFactory(String propertyFileName) throws IOException {
PROPERTY_FILE_NAME = propertyFileName;
if (sessionFactory == null) {
... | return metadata.getSessionFactoryBuilder();
}
private static ServiceRegistry configureServiceRegistry() throws IOException {
Properties properties = getProperties();
return new StandardServiceRegistryBuilder().applySettings(properties)
.build();
}
private static Properties... | repos\tutorials-master\persistence-modules\hibernate5\src\main\java\com\baeldung\hibernate\proxy\HibernateUtil.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8094
servlet:
session:
timeout: 30m
spring:
application:
name: roncoo-pay-web-sample-shop
mvc:
view:
pref | ix: /
suffix: .jsp
logging:
config: classpath:logback.xml | repos\roncoo-pay-master\roncoo-pay-web-sample-shop\src\main\resources\application.yml | 2 |
请在Spring Boot框架中完成以下Java代码 | public synchronized void doUpdate(Map<EntityId, EntityData> newDataMap) {
this.updateLatestTsData(this.data);
List<Integer> subIdsToCancel = new ArrayList<>();
List<TbSubscription> subsToAdd = new ArrayList<>();
Set<EntityId> currentSubs = new HashSet<>();
subToEntityIdMap.forEac... | );
}
}
}
subIdsToCancel.forEach(subId -> localSubscriptionService.cancelSubscription(getTenantId(), getSessionId(), subId));
subsToAdd.forEach(subscription -> localSubscriptionService.addSubscription(subscription, sessionRef));
sendWsMsg(new EntityDataUpdate(c... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\subscription\TbEntityDataSubCtx.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class Post {
@Id
private Long id;
private String title;
private LocalDate publicationDate;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title; | }
public void setTitle(String title) {
this.title = title;
}
public LocalDate getPublicationDate() {
return publicationDate;
}
public void setPublicationDate(LocalDate publicationDate) {
this.publicationDate = publicationDate;
}
} | repos\tutorials-master\persistence-modules\spring-data-jpa-repo-3\src\main\java\com\baeldung\spring\data\jpa\listrepositories\lastrecord\Post.java | 2 |
请完成以下Java代码 | public Object getAttribute(String name) {
checkState();
return this.session.getAttribute(name);
}
@Override
public Enumeration<String> getAttributeNames() {
checkState();
return Collections.enumeration(this.session.getAttributeNames());
}
@Override
public void setAttribute(String name, Object value) {
... | ((HttpSessionBindingListener) oldValue).valueUnbound(new HttpSessionBindingEvent(this, name, oldValue));
}
catch (Throwable th) {
logger.error("Error invoking session binding event listener", th);
}
}
}
@Override
public void invalidate() {
checkState();
this.invalidated = true;
}
@Override
pu... | repos\spring-session-main\spring-session-core\src\main\java\org\springframework\session\web\http\HttpSessionAdapter.java | 1 |
请完成以下Java代码 | public KotlinPropertyDeclaration empty() {
return new KotlinPropertyDeclaration(this);
}
@Override
protected VarBuilder self() {
return this;
}
}
/**
* Builder for a property accessor.
*
* @param <T> the type of builder
*/
public static final class AccessorBuilder<T extends Builder<T>> {
... | public AccessorBuilder<?> withBody(CodeBlock code) {
this.code = code;
return this;
}
/**
* Builds the accessor.
* @return the parent getter / setter
*/
public T buildAccessor() {
this.accessorFunction.accept(new Accessor(this));
return this.parent;
}
}
static final class Accessor impl... | repos\initializr-main\initializr-generator\src\main\java\io\spring\initializr\generator\language\kotlin\KotlinPropertyDeclaration.java | 1 |
请完成以下Java代码 | public void removeActiveSessionId(final WebuiSessionId sessionId)
{
activeSessions.remove(sessionId);
logger.debug("Removed sessionId '{}' to {}", sessionId, this);
}
public boolean hasActiveSessions()
{
return !activeSessions.isEmpty();
}
/* package */void addNotification(@NonNull final UserNotification ... | logger.trace("Marking all notifications as read (if any) for {}...", this);
notificationsRepo.markAllAsReadByUserId(getUserId());
fireEventOnWebsocket(JSONNotificationEvent.eventReadAll());
}
public int getUnreadCount()
{
return notificationsRepo.getUnreadCountByUserId(getUserId());
}
public void setLangua... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\notification\UserNotificationsQueue.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Task {
private @Id @GeneratedValue Long id;
private String description;
private String assignee;
public Task() {
}
public Task(String description, String assignee) {
this.description = description;
this.assignee = assignee;
}
public Long getId() {
... | }
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAssignee() {
return assignee;
}
public void setAssignee(String assignee) {
this.assignee = assignee... | repos\tutorials-master\spring-security-modules\spring-security-core-2\src\main\java\com\baeldung\app\entity\Task.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable SQLDialect getSqlDialect() {
return this.sqlDialect;
}
public void setSqlDialect(@Nullable SQLDialect sqlDialect) {
this.sqlDialect = sqlDialect;
}
public @Nullable Resource getConfig() {
return this.config;
}
public void setConfig(@Nullable Resource config) {
this.config = config;
} | /**
* Determine the {@link SQLDialect} to use based on this configuration and the primary
* {@link DataSource}.
* @param dataSource the data source
* @return the {@code SQLDialect} to use for that {@link DataSource}
*/
public SQLDialect determineSqlDialect(DataSource dataSource) {
if (this.sqlDialect != nu... | repos\spring-boot-4.0.1\module\spring-boot-jooq\src\main\java\org\springframework\boot\jooq\autoconfigure\JooqProperties.java | 2 |
请完成以下Java代码 | private Connector httpToHttpsRedirectConnector() {
Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
connector.setScheme("http");
connector.setPort(8082);
connector.setSecure(false);
connector.setRedirectPort(8443);
return connector;
... | * Question 3 : how long is the best expiration time?
*
* Question 4 : will you talk on how to implement remember me and session timeout in jwt.
*
* Question 5: you've user maven oauth0 dependency, is it the best for jwt? Because I saw that some others have used io.
* JSON WEB Token dependency ', how to choose?
*
... | repos\SpringBoot-Projects-FullStack-master\Part-6 Spring Boot Security\11.SpringSecurityJwt\src\main\java\spring\security\SecurityApplication.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public SimpleUrlLogoutSuccessHandler successLogoutHandler() {
SimpleUrlLogoutSuccessHandler successLogoutHandler = new SimpleUrlLogoutSuccessHandler();
successLogoutHandler.setDefaultTargetUrl("/");
return successLogoutHandler;
}
@Bean
public SecurityContextLogoutHandler logoutHandl... | new LogoutHandler[] { logoutHandler() });
}
@Bean
public HTTPPostBinding httpPostBinding() {
return new HTTPPostBinding(parserPool(), VelocityFactory.getEngine());
}
@Bean
public HTTPRedirectDeflateBinding httpRedirectDeflateBinding() {
return new HTTPRedirectDeflateBinding... | repos\tutorials-master\spring-security-modules\spring-security-saml\src\main\java\com\baeldung\saml\config\SamlSecurityConfig.java | 2 |
请完成以下Java代码 | public Builder expiresAt(Instant expiresAt) {
return this.claim(IdTokenClaimNames.EXP, expiresAt);
}
/**
* Use this issued-at timestamp in the resulting {@link OidcIdToken}
* @param issuedAt The issued-at timestamp to use
* @return the {@link Builder} for further configurations
*/
public Builder i... | /**
* Use this subject in the resulting {@link OidcIdToken}
* @param subject The subject to use
* @return the {@link Builder} for further configurations
*/
public Builder subject(String subject) {
return this.claim(IdTokenClaimNames.SUB, subject);
}
/**
* Build the {@link OidcIdToken}
* @ret... | repos\spring-security-main\oauth2\oauth2-core\src\main\java\org\springframework\security\oauth2\core\oidc\OidcIdToken.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ContractLine extends AbstractEntity
{
@ManyToOne(fetch = FetchType.EAGER)
@NonNull
private Contract contract;
@ManyToOne
@NonNull
private Product product;
@Override
protected void toString(final MoreObjects.ToStringHelper toStringHelper)
{
toStringHelper
.add("product", product);
}
publi... | public Contract getContract()
{
return contract;
}
public Product getProduct()
{
return product;
}
public void setProduct(final Product product)
{
this.product = product;
}
} | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\model\ContractLine.java | 2 |
请完成以下Java代码 | public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder().include(Benchmarking.class.getSimpleName())
.forks(1)
.build();
new Runner(opt).run();
}
private static final IsNumeric subject = new IsNumeric();
@State(Scope.Thread... | }
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public void usingRegularExpressions(ExecutionPlan plan) {
plan.validate(subject::usingPreCompiledRegularExpressions);
}
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOS... | repos\tutorials-master\core-java-modules\core-java-string-operations\src\main\java\com\baeldung\isnumeric\Benchmarking.java | 1 |
请完成以下Java代码 | public static void main(String[] args) throws IOException, InterruptedException {
DataSet allData;
try (RecordReader recordReader = new CSVRecordReader(0, ',')) {
recordReader.initialize(new FileSplit(new ClassPathResource("iris.txt").getFile()));
DataSetIterator iterator = new... | .nIn(3).nOut(CLASSES_COUNT).build())
.backpropType(BackpropType.Standard).pretrain(false)
.build();
MultiLayerNetwork model = new MultiLayerNetwork(configuration);
model.init();
model.fit(trainingData);
INDArray output = model.output(testData.getFeatures... | repos\tutorials-master\deeplearning4j\src\main\java\com\baeldung\deeplearning4j\IrisClassifier.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OrderHeader
{
private final H100 h100;
private final List<H110> h110Lines = new ArrayList<H110>();
private final List<H120> h120Lines = new ArrayList<H120>();
private final List<H130> h130Lines = new ArrayList<H130>();
private final List<OrderLine> orderLines = new ArrayList<OrderLine>();
private fi... | }
public H100 getH100()
{
return h100;
}
public List<H110> getH110Lines()
{
return h110Lines;
}
public List<H120> getH120Lines()
{
return h120Lines;
}
public List<H130> getH130Lines()
{
return h130Lines;
}
public List<OrderLine> getOrderLines()
{
return orderLines;
}
public List<T100> ge... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java\de\metas\edi\esb\ordersimport\OrderHeader.java | 2 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public int getUrc() {
return urc;
}
public void setUrc(int urc) {
this.urc = urc;
}
public String getName() {
return name;
}
public void setName(String nam... | if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Publisher other = (Publisher) obj;
if (this.urc != other.urc) {
return false;
}
if (!Objects.equals(this.nam... | repos\Hibernate-SpringBoot-master\HibernateSpringBootCompositeKeyEmbeddableMapRel\src\main\java\com\bookstore\entity\Publisher.java | 1 |
请完成以下Java代码 | public Object getParameterDefaultValue(final IProcessDefaultParameter parameter)
{
final String parameterName = parameter.getColumnName();
if (PARAM_M_Product_ID.equals(parameterName))
{
final IQueryFilter<I_M_DiscountSchemaBreak> selectionQueryFilter = getProcessInfo().getQueryFilterOrElse(ConstantQueryFilte... | }
final boolean allowCopyToSameSchema = true;
final CopyDiscountSchemaBreaksRequest request = CopyDiscountSchemaBreaksRequest.builder()
.filter(queryFilter)
.pricingConditionsId(PricingConditionsId.ofRepoId(p_PricingConditionsId))
.productId(ProductId.ofRepoId(p_ProductId))
.allowCopyToSameSchema(... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pricing\process\M_DiscountSchemaBreak_CopyToOtherSchema_Product.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DefaultEdqsApiService implements EdqsApiService {
private final EdqsPartitionService edqsPartitionService;
private final EdqsClientQueueFactory queueFactory;
private TbQueueRequestTemplate<TbProtoQueueMsg<ToEdqsMsg>, TbProtoQueueMsg<FromEdqsMsg>> requestTemplate;
@PostConstruct
privat... | ListenableFuture<TbProtoQueueMsg<FromEdqsMsg>> resultFuture = requestTemplate.send(new TbProtoQueueMsg<>(key, requestMsg.build()), partition);
return Futures.transform(resultFuture, msg -> {
TransportProtos.EdqsResponseMsg responseMsg = msg.getValue().getResponseMsg();
return JacksonUtil... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\edqs\DefaultEdqsApiService.java | 2 |
请完成以下Java代码 | public void setCode (java.lang.String Code)
{
set_Value (COLUMNNAME_Code, Code);
}
/** Get Validation code.
@return Validation Code
*/
@Override
public java.lang.String getCode ()
{
return (java.lang.String)get_Value(COLUMNNAME_Code);
}
/** Set Name.
@param Name
Alphanumeric identifier of the e... | public static final String TYPE_RuleEngine = "R";
/** Set Type.
@param Type
Type of Validation (SQL, Java Script, Java Language)
*/
@Override
public void setType (java.lang.String Type)
{
set_Value (COLUMNNAME_Type, Type);
}
/** Get Type.
@return Type of Validation (SQL, Java Script, Java Language)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\letters\model\X_AD_BoilerPlate_Var.java | 1 |
请完成以下Java代码 | private void setCompanyDetailsIfNotNull(
@NonNull final InvoiceWithDetails.InvoiceWithDetailsBuilder invoiceWithDetails,
@NonNull final String labelPrefix,
@Nullable final XmlCompany billerCompany)
{
if (billerCompany != null)
{
setPhoneIfNotNull(invoiceWithDetails, billerCompany.getTelecom(), labelPre... | }
private void setEmailIfNotNull(
@NonNull final InvoiceWithDetails.InvoiceWithDetailsBuilder invoiceWithDetails,
@Nullable final XmlOnline online,
@NonNull final String detailItemLabel)
{
if (online != null)
{
final List<String> emails = online.getEmails();
if (emails != null && !emails.isEmpty()... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\export\HealthcareXMLToInvoiceDetailPersister.java | 1 |
请完成以下Java代码 | public int toInt()
{
return value;
}
public boolean isZero() { return value == 0; }
public boolean isGreaterThanZero() { return value > 0; }
public boolean isGreaterThanOne() { return value > 1; }
public PrintCopies minimumOne()
{
return isZero() ? ONE : this;
} | public PrintCopies plus(@NonNull final PrintCopies other)
{
if (other.isZero())
{
return this;
}
else if (isZero())
{
return other;
}
else
{
return ofInt(this.value + other.value);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\report\PrintCopies.java | 1 |
请完成以下Java代码 | public ILUTUConfigurationEditor edit(final Function<I_M_HU_LUTU_Configuration, I_M_HU_LUTU_Configuration> lutuConfigurationEditor)
{
assertEditing();
Check.assumeNotNull(lutuConfigurationEditor, "lutuConfigurationEditor not null");
final I_M_HU_LUTU_Configuration lutuConfigurationEditing = getEditingLUTUConfig... | //
// Check if we need to use the new configuration or we are ok with the old one
final I_M_HU_LUTU_Configuration lutuConfigurationToUse;
if (InterfaceWrapperHelper.isNew(lutuConfigurationInitial))
{
lutuFactory.save(lutuConfigurationEditing);
lutuConfigurationToUse = lutuConfigurationEditing;
}
else ... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\LUTUConfigurationEditor.java | 1 |
请完成以下Java代码 | public class SaleGoods {
private Integer id;
private String goodsName;
private float weight;
private int type;
private Boolean onSale;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getGoodsName() {
retu... | public void setOnSale(Boolean onSale) {
this.onSale = onSale;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
@Override
public String toString() {
return "SaleGoods{" +
"id=" + id +
",... | repos\spring-boot-projects-main\玩转SpringBoot系列案例源码\spring-boot-message-converter\src\main\java\cn\lanqiao\springboot3\entity\SaleGoods.java | 1 |
请完成以下Java代码 | void transferAttributes(Map<String, Object> attributes, HttpSession newSession) {
if (attributes != null) {
attributes.forEach(newSession::setAttribute);
}
}
@SuppressWarnings("unchecked")
private HashMap<String, Object> createMigratedAttributeMap(HttpSession session) {
HashMap<String, Object> attributesTo... | /**
* Defines whether attributes should be migrated to a new session or not. Has no
* effect if you override the {@code extractAttributes} method.
* <p>
* Attributes used by Spring Security (to store cached requests, for example) will
* still be retained by default, even if you set this value to {@code false}... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\session\SessionFixationProtectionStrategy.java | 1 |
请完成以下Java代码 | public final class BeanUtil {
/**
* 此类不需要实例化
*/
private BeanUtil() {
}
/**
* 判断对象是否为null
*
* @param object 需要判断的对象
* @return 是否为null
*/
public static boolean isNull(Object object) {
return null == object;
}
/**
* 判断对象是否不为null
* | * @param object 需要判断的对象
* @return 是否不为null
*/
public static boolean nonNull(Object object) {
return null != object;
}
/**
* 判断对象是否为空,如果为空,直接抛出异常
*
* @param object 需要检查的对象
* @param errorMessage 异常信息
* @return 非空的对象
*/
public static Object requireNonN... | repos\spring-boot-quick-master\quick-wx-public\src\main\java\com\wx\pn\api\utils\BeanUtil.java | 1 |
请完成以下Java代码 | public ProcessPreconditionsResolution checkPreconditionsApplicable(final @NonNull IProcessPreconditionsContext context)
{
if (context.isNoSelection())
{
return ProcessPreconditionsResolution.rejectBecauseNoSelection();
}
if (context.isMoreThanOneSelected())
{
return ProcessPreconditionsResolution.rej... | openOrder(order, orderWindowId);
}
protected void openOrder(@NonNull final I_C_Order order, @Nullable final AdWindowId orderWindowId)
{
if (orderWindowId == null)
{
log.warn("Skip opening {} because no window found for it", order);
return;
}
getResult().setRecordToOpen(
TableRecordReference.of(or... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\order\process\C_Order_CreationProcess.java | 1 |
请完成以下Java代码 | private void processInTrx_unpackHU(@NonNull final PickingCandidate pickingCandidate)
{
final HuId packedToHUId = pickingCandidate.getPackedToHuId();
if (packedToHUId == null)
{
return;
}
final I_M_HU packedToHU = handlingUnitsBL.getById(packedToHUId);
if (handlingUnitsBL.isDestroyed(packedToHU))
{
... | pickingCandidate.changeStatusToDraft();
pickingCandidateRepository.save(pickingCandidate);
huShipmentScheduleBL.deleteByTopLevelHUAndShipmentScheduleId(packedToHUId, pickingCandidate.getShipmentScheduleId());
}
@NonNull
private ProductId getProductId(final PickingCandidate pickingCandidate)
{
final I_M_Ship... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\candidate\commands\UnProcessPickingCandidatesCommand.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class SpinDataFormatConfigurationJdk8 {
@Bean
@ConditionalOnMissingBean(name = "spinDataFormatConfiguratorJdk8")
public static CamundaJacksonFormatConfiguratorJdk8 spinDataFormatConfiguratorJdk8() {
return new CamundaJacksonFormatConfiguratorJdk8();
}
}
@ConditionalOnClass(SpinProces... | return new ConnectProcessEnginePlugin();
}
}
/*
Provide option to apply application context classloader switch when Spring
Spring Developer tools are enabled
For more details: https://jira.camunda.com/browse/CAM-9043
*/
@ConditionalOnInitializedRestarter
@Configuration
static class Initia... | repos\camunda-bpm-platform-master\spring-boot-starter\starter\src\main\java\org\camunda\bpm\spring\boot\starter\CamundaBpmPluginConfiguration.java | 2 |
请完成以下Java代码 | public class PP_Order_Weighting_Run_Process extends JavaProcess implements IProcessPrecondition
{
private final PPOrderWeightingRunService ppOrderWeightingRunService = SpringContextHolder.instance.getBean(PPOrderWeightingRunService.class);
@Override
public ProcessPreconditionsResolution checkPreconditionsApplicable... | {
return ProcessPreconditionsResolution.rejectWithInternalReason("Already processed");
}
return ProcessPreconditionsResolution.accept();
}
@Override
protected String doIt() throws Exception
{
final PPOrderWeightingRunId weightingRunId = PPOrderWeightingRunId.ofRepoId(getRecord_ID());
ppOrderWeightingRu... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\de\metas\manufacturing\order\weighting\run\process\PP_Order_Weighting_Run_Process.java | 1 |
请完成以下Java代码 | public static I_C_Location createLocation(@NonNull final Address pickupAddress)
{
final I_C_Location pickupFromLocation = InterfaceWrapperHelper.newInstance(I_C_Location.class);
pickupFromLocation.setAddress1(pickupAddress.getStreet1() + " " + pickupAddress.getHouseNo());
pickupFromLocation.setAddress2(pickupAdd... | final I_C_BPartner pickupFromBPartner = InterfaceWrapperHelper.newInstance(I_C_BPartner.class);
pickupFromBPartner.setName(pickupAddress.getCompanyName1());
pickupFromBPartner.setName2(pickupAddress.getCompanyName2());
return pickupFromBPartner;
}
public static void dumpPdfToDisk(final byte[] pdf)
{
try
{... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.commons\src\main\java\de\metas\shipper\gateway\commons\ShipperTestHelper.java | 1 |
请完成以下Java代码 | public void setInvoiceLineAttributes(@NonNull final List<IInvoiceLineAttribute> invoiceLineAttributes)
{
this.invoiceLineAttributes = ImmutableList.copyOf(invoiceLineAttributes);
}
@Override
public List<IInvoiceLineAttribute> getInvoiceLineAttributes()
{
return invoiceLineAttributes;
}
@Override
public Li... | }
@Override
public int getC_PaymentTerm_ID()
{
return C_PaymentTerm_ID;
}
@Override
public void setC_PaymentTerm_ID(final int paymentTermId)
{
C_PaymentTerm_ID = paymentTermId;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceLineImpl.java | 1 |
请完成以下Java代码 | public static <T> Set<T> copyBySetAddAll(Set<T> original) {
Set<T> copy = new HashSet<>();
copy.addAll(original);
return copy;
}
// Set.clone
public static <T> Set<T> copyBySetClone(HashSet<T> original) {
Set<T> copy = (Set<T>) original.clone();
return copy;
}
... | public static <T extends Serializable> Set<T> copyByApacheCommonsLang(Set<T> original) {
Set<T> copy = new HashSet<>();
for (T item : original) {
copy.add((T) SerializationUtils.clone(item));
}
return copy;
}
// Collectors.toSet
public static <T extends Serializa... | repos\tutorials-master\core-java-modules\core-java-collections-set-2\src\main\java\com\baeldung\set\CopySets.java | 1 |
请完成以下Java代码 | public class SAP_GLJournal_OpenItems_Launcher extends JavaProcess implements IProcessPrecondition
{
private final SAPGLJournalService sapglJournalService = SpringContextHolder.instance.getBean(SAPGLJournalService.class);
private final IViewsRepository viewsFactory = SpringContextHolder.instance.getBean(IViewsReposito... | final SAPGLJournalId sapglJournalId = getSelectedSAPGLJournalId();
final ViewId viewId = viewsFactory.createView(OIViewFactory.createViewRequest(sapglJournalId))
.getViewId();
getResult().setWebuiViewToOpen(ProcessExecutionResult.WebuiViewToOpen.builder()
.viewId(viewId.getViewId())
.target(ProcessExe... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.webui\src\main\java\de\metas\acct\gljournal_sap\select_open_items\SAP_GLJournal_OpenItems_Launcher.java | 1 |
请完成以下Java代码 | public class ProcessValidatorImpl implements ProcessValidator {
protected List<ValidatorSet> validatorSets;
protected ValidationErrorDecorator validationErrorDecorator;
public ProcessValidatorImpl() {
this.validationErrorDecorator = new ValidationErrorDecorator();
}
@Override
public L... | }
}
return allErrors;
}
public List<ValidatorSet> getValidatorSets() {
return validatorSets;
}
public void setValidatorSets(List<ValidatorSet> validatorSets) {
this.validatorSets = validatorSets;
}
public void addValidatorSet(ValidatorSet validatorSet) {
... | repos\Activiti-develop\activiti-core\activiti-process-validation\src\main\java\org\activiti\validation\ProcessValidatorImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SendToFileRouteBuilder extends RouteBuilder
{
public static final String SEND_TO_FILE_ROUTE_ID = "LeichUndMehl-sendToFile";
@Override
public void configure() throws Exception
{
//@formatter:off
errorHandler(defaultErrorHandler());
onException(Exception.class)
.to(direct(MF_ERROR_ROUTE_ID));
... | }
@VisibleForTesting
static String extractFilename(@NonNull final String pluTemplateFilename)
{
final int lastIndexOfDot = pluTemplateFilename.lastIndexOf('.');
if (lastIndexOfDot == -1)
{
return pluTemplateFilename + "_" + SystemTime.millis();
}
return pluTemplateFilename.substring(0, lastIndexOfDot... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-leichundmehl\src\main\java\de\metas\camel\externalsystems\leichundmehl\to_leichundmehl\file\SendToFileRouteBuilder.java | 2 |
请完成以下Java代码 | static CostingDocumentRef extractDocumentRef(final I_M_CostDetail record)
{
if (record.getM_MatchPO_ID() > 0)
{
return CostingDocumentRef.ofMatchPOId(record.getM_MatchPO_ID());
}
else if (record.getM_MatchInv_ID() > 0)
{
return CostingDocumentRef.ofMatchInvoiceId(record.getM_MatchInv_ID());
}
else ... | throw new AdempiereException("Cannot determine " + CostingDocumentRef.class + " for " + record);
}
}
@Override
public boolean hasCostDetailsByProductId(@NonNull final ProductId productId)
{
return toSqlQuery(CostDetailQuery.builder().productId(productId).build())
.anyMatch();
}
@Override
public Stream<... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costing\impl\CostDetailRepository.java | 1 |
请完成以下Java代码 | default boolean removeListener(Listener<K, V> listener) {
return false;
}
/**
* Add a listener at a specific index.
* @param index the index (list position).
* @param listener the listener.
* @since 2.5.3
*/
default void addListener(int index, Listener<K, V> listener) {
}
/**
* Add a listener.
* ... | /**
* Remove the specified key from the configuration map.
* @param configKey the key to remove.
* @since 2.7
*/
default void removeConfig(String configKey) {
}
/**
* Called whenever a consumer is added or removed.
*
* @param <K> the key type.
* @param <V> the value type.
*
* @since 2.5
*
*/... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\core\ConsumerFactory.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private Collection<InvoiceId> getInvoiceIdsForVerificationSet(@NonNull final InvoiceVerificationSetId verificationSetId)
{
return new ArrayList<>(queryBL.createQueryBuilder(I_C_Invoice_Verification_SetLine.class)
.addEqualsFilter(I_C_Invoice_Verification_SetLine.COLUMNNAME_C_Invoice_Verification_Set_ID, ... | @NonNull
Tax invoiceTax;
@Nullable
Tax resultingTax;
@NonNull
InvoiceVerificationSetLineId setLineId;
@NonNull
OrgId orgId;
@Nullable
String log;
@Builder
public InvoiceVerificationRunResult(final @NonNull Tax invoiceTax,
final @Nullable Tax resultingTax,
final @NonNull InvoiceVerific... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\service\impl\InvoiceVerificationBL.java | 2 |
请完成以下Java代码 | public class AdviseDeliveryOrderWorkpackageProcessor extends WorkpackageProcessorAdapter
{
public static void enqueueOnTrxCommit(
@NonNull final ShipmentScheduleId shipmentScheduleId,
@Nullable final AsyncBatchId asyncBatchId)
{
final IWorkPackageQueueFactory workPackageQueueFactory = Services.get(IWorkPacka... | public boolean isRunInTransaction()
{
return false;
}
@Override
public Result processWorkPackage(final I_C_Queue_WorkPackage workPackage, final String localTrxName_NOTUSED)
{
final int shipmentSchedule = getParameters().getParameterAsInt(PARAM_ShipmentScheduleId, -1);
CarrierAdviseCommand.of(ShipmentSchedul... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.commons\src\main\java\de\metas\shipper\gateway\commons\async\AdviseDeliveryOrderWorkpackageProcessor.java | 1 |
请完成以下Java代码 | public boolean setValue(final String columnName, final Object value)
{
final Object valueToSet = POWrapper.checkZeroIdValue(columnName, value);
final POInfo poInfo = po.getPOInfo();
if (!poInfo.isColumnUpdateable(columnName))
{
// If the column is not updateable we need to use set_ValueNoCheck
// becaus... | {
throw new IllegalArgumentException("Invalid method arguments to be used for equals(): " + methodArgs);
}
return po.equals(methodArgs[0]);
}
@Override
public Object invokeParent(final Method method, final Object[] methodArgs) throws Exception
{
return method.invoke(po, methodArgs);
}
@Override
public... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\wrapper\POModelInternalAccessor.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8888
spring:
application:
name: djl-image-classification-demo
servlet:
multipart:
max-file-size: 100MB
max-request-size: | 100MB
mvc:
pathmatch:
matching-strategy: ant_path_matcher | repos\springboot-demo-master\djl\src\main\resources\application.yaml | 2 |
请在Spring Boot框架中完成以下Java代码 | public void start() {
// Do nothing
}
@Override
public void stop() {
// Do nothing
}
@Override
public Scope lockScope() {
return NoopScope.INSTANCE;
}
@Override
public void lockError(Throwable lockException) {... | @Override
public void executionError(Throwable exception) {
// Do nothing
}
}
static class NoopScope implements JobExecutionObservation.Scope {
static final NoopScope INSTANCE = new NoopScope();
@Override
public void close() {
// Do nothing
... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\asyncexecutor\NoopJobExecutionObservationProvider.java | 2 |
请完成以下Java代码 | public org.compiere.model.I_C_ValidCombination getWriteOff_A() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_WriteOff_Acct, org.compiere.model.I_C_ValidCombination.class);
}
@Override
public void setWriteOff_A(org.compiere.model.I_C_ValidCombination WriteOff_A)
{
set_ValueFromPO(COLUMNNAME_WriteOf... | {
set_Value (COLUMNNAME_WriteOff_Acct, Integer.valueOf(WriteOff_Acct));
}
/** Get Forderungsverluste.
@return Konto für Forderungsverluste
*/
@Override
public int getWriteOff_Acct ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_WriteOff_Acct);
if (ii == null)
return 0;
return ii.intValue();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_AcctSchema_Default.java | 1 |
请完成以下Java代码 | public int remove(Filter filter)
{
int size = trie.size();
for (Map.Entry<String, V> entry : entrySet())
{
if (filter.remove(entry))
{
trie.remove(entry.getKey());
}
}
return size - trie.size();
}
public interface ... | boolean remove(Map.Entry<String, V> entry);
}
/**
* 向中加入单词
* @param key
* @param value
*/
public void add(String key, V value)
{
trie.put(key, value);
}
public int size()
{
return trie.size();
}
} | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\corpus\dictionary\SimpleDictionary.java | 1 |
请完成以下Java代码 | public String getRequestedTokenType() {
return this.requestedTokenType;
}
/**
* Returns the subject token.
* @return the subject token
*/
public String getSubjectToken() {
return this.subjectToken;
}
/**
* Returns the subject token type.
* @return the subject token type
*/
public String getSubje... | return this.actorTokenType;
}
/**
* Returns the requested resource URI(s).
* @return the requested resource URI(s), or an empty {@code Set} if not available
*/
public Set<String> getResources() {
return this.resources;
}
/**
* Returns the requested audience value(s).
* @return the requested audience ... | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\authentication\OAuth2TokenExchangeAuthenticationToken.java | 1 |
请完成以下Java代码 | public Set<String> getFieldNames() {return values.getFieldNames();}
@Override
public ViewRowFieldNameAndJsonValues getFieldNameAndJsonValues() {return values.get(this);}
public OIRow withSelected(final boolean selected)
{
return this.selected != selected
? toBuilder().selected(selected).build()
: this;
... | .selected(selected)
.build();
}
else
{
return null;
}
}
public OIRow withUserInput(@Nullable final OIRowUserInputPart userInput)
{
final boolean selectedNew = userInput != null && userInput.isSelected();
return this.selected != selectedNew
? toBuilder().selected(selectedNew).build()
: t... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.webui\src\main\java\de\metas\acct\gljournal_sap\select_open_items\OIRow.java | 1 |
请完成以下Java代码 | public void setNextPaymentDate (java.sql.Timestamp NextPaymentDate)
{
set_ValueNoCheck (COLUMNNAME_NextPaymentDate, NextPaymentDate);
}
/** Get Next Payment Date.
@return Next Payment Date */
@Override
public java.sql.Timestamp getNextPaymentDate ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_Next... | {
if (SalesRep_ID < 1)
set_Value (COLUMNNAME_SalesRep_ID, null);
else
set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
}
/** Get Aussendienst.
@return Aussendienst */
@Override
public int getSalesRep_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID);
if (ii == n... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java-gen\de\metas\banking\model\X_C_RecurrentPaymentLine.java | 1 |
请完成以下Java代码 | public void putOtherProperty(final String name, final Object jsonValue)
{
otherProperties.put(name, jsonValue);
}
public JSONDocumentField putDebugProperty(final String name, final Object jsonValue)
{
otherProperties.put("debug-" + name, jsonValue);
return this;
}
public void putDebugProperties(final Map<... | }
public JSONDocumentField setViewEditorRenderMode(final ViewEditorRenderMode viewEditorRenderMode)
{
this.viewEditorRenderMode = viewEditorRenderMode != null ? viewEditorRenderMode.toJson() : null;
return this;
}
public void setFieldWarning(@Nullable final JSONDocumentFieldWarning fieldWarning)
{
this.fie... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\datatypes\json\JSONDocumentField.java | 1 |
请完成以下Java代码 | public class PlayerDTO {
private Long id;
private String name;
private GameDTO currentGame;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
} | public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public GameDTO getCurrentGame() {
return this.currentGame;
}
public void setCurrentGame(GameDTO currentGame) {
this.currentGame = currentGame;
}
} | repos\tutorials-master\libraries-data\src\main\java\com\baeldung\modelmapper\dto\PlayerDTO.java | 1 |
请完成以下Java代码 | public class CompositeAggregationKeyBuilder<ModelType> implements IAggregationKeyBuilder<ModelType>
{
private final String tableName;
private final List<String> columnNames = new ArrayList<>();
private final List<String> columnNamesRO = Collections.unmodifiableList(columnNames);
private final CopyOnWriteArrayList<... | }
final List<String> keyParts = new ArrayList<>();
final Set<AggregationId> aggregationIds = new HashSet<>();
for (final IAggregationKeyBuilder<ModelType> aggregationKeyBuilder : aggregationKeyBuilders)
{
final AggregationKey keyPart = aggregationKeyBuilder.buildAggregationKey(model);
keyParts.add(keyPar... | repos\metasfresh-new_dawn_uat\backend\de.metas.aggregation\src\main\java\de\metas\aggregation\api\CompositeAggregationKeyBuilder.java | 1 |
请完成以下Java代码 | public Optional<User> get(long id) {
return Optional.ofNullable(entityManager.find(User.class, id));
}
@Override
public List<User> getAll() {
Query query = entityManager.createQuery("SELECT e FROM User e");
return query.getResultList();
}
@Override
public void s... | }
private void executeInsideTransaction(Consumer<EntityManager> action) {
final EntityTransaction tx = entityManager.getTransaction();
try {
tx.begin();
action.accept(entityManager);
tx.commit();
}
catch (RuntimeException e) {
tx.... | repos\tutorials-master\patterns-modules\design-patterns-architectural\src\main\java\com\baeldung\daopattern\daos\JpaUserDao.java | 1 |
请完成以下Java代码 | public class MD_Cockpit_SetProcurementStatus extends MaterialCockpitViewBasedProcess
{
private final IQueryBL queryBL = Services.get(IQueryBL.class);
private final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);
private static final String PARAM_PROCUREMENT_STATUS = X_M_Product.COLUMNNAME_ProcurementSta... | .addInArrayFilter(I_M_Product.COLUMNNAME_M_Product_ID, productIds)
.create()
.updateDirectly(updater);
productIds.forEach(this::cacheResetProduct);
invalidateView();
invalidateParentView();
return MSG_OK;
}
private void cacheResetProduct(final ProductId productId)
{
CacheMgt.get().reset(I_M_Prod... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\material\cockpit\process\MD_Cockpit_SetProcurementStatus.java | 1 |
请完成以下Java代码 | public abstract class InstanceConsumer
{
private static char[] tableChar;
static
{
tableChar = new char[CharTable.CONVERT.length];
System.arraycopy(CharTable.CONVERT, 0, tableChar, 0, tableChar.length);
for (int c = 0; c <= 32; ++c)
{
tableChar[c] = '&'; // 也可以考虑... | @Override
public boolean process(Sentence sentence)
{
Utility.normalize(sentence);
Instance instance = createInstance(sentence, model.featureMap);
IOUtility.evaluate(instance, model, stat);
return false;
}
});
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\model\perceptron\InstanceConsumer.java | 1 |
请完成以下Java代码 | private static IStringExpression computeSqlWhereClause(@NonNull final ImmutableList<SqlLookupFilter> filters)
{
if (filters.isEmpty())
{
return IStringExpression.NULL;
}
final CompositeStringExpression.Builder builder = IStringExpression.composer();
for (SqlLookupFilter filter : filters)
{
final IS... | return builder.build();
}
private static ImmutableSet<String> computeDependsOnTableNames(final ImmutableList<SqlLookupFilter> filters)
{
return filters.stream()
.flatMap(filter -> filter.getDependsOnTableNames().stream())
.collect(ImmutableSet.toImmutableSet());
}
private static ImmutableSet<String> co... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\sql\CompositeSqlLookupFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getAccountNo() {
return accountNo;
}
public void setAccountNo(String accountNo) {
this.accountNo = accountNo == null ? null : accountNo.trim();
}
... | public String getTrxType() {
return trxType;
}
public void setTrxType(String trxType) {
this.trxType = trxType == null ? null : trxType.trim();
}
public String getTrxTypeDesc() {
return TrxTypeEnum.getEnum(this.getTrxType()).getDesc();
}
public Integer getRiskDay() {
... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\account\entity\RpAccountHistory.java | 2 |
请完成以下Java代码 | private PriceListId retrievePriceListForTerm()
{
final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);
final IPriceListDAO priceListDAO = Services.get(IPriceListDAO.class);
final PricingSystemId pricingSystemIdToUse = CoalesceUtil.coalesceSuppliersNotNull(
() -> PricingSystemId.ofRepoIdOrNull(t... | qty,
isSOTrx);
pricingCtx.setPriceDate(priceDate);
pricingCtx.setPriceListId(priceListId);
final IPricingResult result = pricingBL.calculatePrice(pricingCtx);
throwExceptionIfNotCalculated(result);
return result;
}
private void throwExceptionIfNotCalculated(@NonNull final IPricingResult result)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\FlatrateTermPricing.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ByteArrayRef getExceptionByteArrayRef() {
return exceptionByteArrayRef;
}
@Override
public String getExceptionStacktrace() {
return getJobByteArrayRefAsString(exceptionByteArrayRef);
}
@Override
public void setExceptionStacktrace(String exception) {
if (exception... | }
@Override
public String getScopeType() {
return scopeType;
}
@Override
public void setScopeType(String scopeType) {
this.scopeType = scopeType;
}
protected String getJobByteArrayRefAsString(ByteArrayRef jobByteArrayRef) {
if (jobByteArrayRef == null) {
... | repos\flowable-engine-main\modules\flowable-job-service\src\main\java\org\flowable\job\service\impl\persistence\entity\HistoryJobEntityImpl.java | 2 |
请完成以下Java代码 | private void createMissingValues()
{
String sql = "SELECT ra.A_RegistrationAttribute_ID "
+ "FROM A_RegistrationAttribute ra"
+ " LEFT OUTER JOIN A_RegistrationProduct rp ON (rp.A_RegistrationAttribute_ID=ra.A_RegistrationAttribute_ID)"
+ " LEFT OUTER JOIN A_Registration r ON (r.M_Product_ID=rp.M_Product_ID... | }
catch (Exception e)
{
log.error(null, e);
}
try
{
if (pstmt != null)
pstmt.close();
pstmt = null;
}
catch (Exception e)
{
pstmt = null;
}
} // createMissingValues
} // MRegistration | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MRegistration.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public BankStatementLineReference createBankStatementLineRef(@NonNull final BankStatementLineRefCreateRequest request)
{
final I_C_BankStatementLine_Ref record = newInstance(I_C_BankStatementLine_Ref.class);
record.setAD_Org_ID(request.getOrgId().getRepoId());
record.setC_BankStatement_ID(request.getBankStateme... | .addEqualsFilter(I_C_BankStatementLine.COLUMNNAME_C_BankStatement_ID, bankStatementId)
.create()
.updateDirectly()
.addSetColumnValue(I_C_BankStatementLine.COLUMNNAME_Processed, processed)
.execute();
queryBL.createQueryBuilder(I_C_BankStatementLine_Ref.class)
.addEqualsFilter(I_C_BankStatementLi... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.base\src\main\java\de\metas\banking\service\impl\BankStatementDAO.java | 2 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setAttributesKey (final @Nullable java.lang.String AttributesKey)
{
set_ValueNoCheck (COLUMNNAME_AttributesKey, AttributesKey);
}
@Override
public java.lang.St... | @Override
public void setM_Warehouse_ID (final int M_Warehouse_ID)
{
if (M_Warehouse_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Warehouse_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Warehouse_ID, M_Warehouse_ID);
}
@Override
public int getM_Warehouse_ID()
{
return get_ValueAsInt(COLUMNNAME_M_Wareho... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\cockpit\src\main\java-gen\de\metas\material\cockpit\model\X_MD_Stock_From_HUs_V.java | 1 |
请完成以下Java代码 | public void customizeConnection(final Connection c) throws DBException
{
if (Adempiere.isUnitTestMode())
{
logger.debug("doing nothing because we are in unit test mode");
return;
}
final boolean wasAlreadyInMethod = inMethod.get();
if (wasAlreadyInMethod)
{
return;
}
try
{
inMethod.set(... | DLMConnectionUtils.setSearchPathForDLM(c);
DLMConnectionUtils.changeDLMLevel(c, getDlmLevel());
DLMConnectionUtils.changeDLMCoalesceLevel(c, getDlmCoalesceLevel());
}
catch (final SQLException e)
{
throw DBException.wrapIfNeeded(e);
}
finally
{
inMethod.set(false);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.dlm\base\src\main\java\de\metas\dlm\connection\AbstractDLMCustomizer.java | 1 |
请完成以下Java代码 | public String toString()
{
StringBuilder sb = new StringBuilder ("CTabbedPane [");
sb.append(super.toString());
MFColor bg = getBackgroundColor();
if (bg != null)
sb.append(bg.toString());
sb.append("]");
return sb.toString();
} // toString
/** Select Action Text */
private static final String ... | String key = getName();
if (!key.equals(ACTION_SELECT)
|| !(e.getSource() instanceof CTabbedPane))
return;
CTabbedPane pane = (CTabbedPane)e.getSource();
String command = e.getActionCommand();
if (command == null || command.length() != 1)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\swing\CTabbedPane.java | 1 |
请完成以下Java代码 | public static DecisionEntityManager getDecisionEntityManager(CommandContext commandContext) {
return getDmnEngineConfiguration(commandContext).getDecisionEntityManager();
}
public static HistoricDecisionExecutionEntityManager getHistoricDecisionExecutionEntityManager() {
return getHistoricD... | public static DmnRepositoryService getDmnRepositoryService(CommandContext commandContext) {
return getDmnEngineConfiguration(commandContext).getDmnRepositoryService();
}
public static DmnEngineAgenda getAgenda() {
return getAgenda(getCommandContext());
}
public static DmnEngineAgenda g... | repos\flowable-engine-main\modules\flowable-dmn-engine\src\main\java\org\flowable\dmn\engine\impl\util\CommandContextUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Xlief4H {
@XmlElement(name = "HEADER", required = true)
protected HEADERXlief header;
@XmlElement(name = "TRAILR", required = true)
protected TRAILR trailr;
/**
* Gets the value of the header property.
*
* @return
* possible object is
* {@link HEADERX... | * possible object is
* {@link TRAILR }
*
*/
public TRAILR getTRAILR() {
return trailr;
}
/**
* Sets the value of the trailr property.
*
* @param value
* allowed object is
* {@link TRAILR }
*
*/
public void setTRAILR(TR... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\Xlief4H.java | 2 |
请完成以下Java代码 | public String getStylePath() {
return stylePath;
}
public void setStylePath(String stylePath) {
this.stylePath = stylePath;
}
public String[] getVueStyle() {
return vueStyle;
}
public void setVueStyle(String[] vueStyle) {
this.vueStyle = vueStyle;
}
/*... | * @return
*/
public static List<Map<String, Object>> getJspModelList(int type) {
List<Map<String, Object>> ls = new ArrayList<Map<String, Object>>();
for (CgformEnum e : CgformEnum.values()) {
if (e.type == type) {
Map<String, Object> map = new HashMap<String, Object... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\constant\enums\CgformEnum.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getTaskUrl() {
return taskUrl;
}
public void setTaskUrl(String taskUrl) {
this.taskUrl = taskUrl;
}
@ApiModelProperty(example = "2013-04-17T10:17:43.902+0000")
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time =... | this.revision = revision;
}
public RestVariable getVariable() {
return variable;
}
public void setVariable(RestVariable variable) {
this.variable = variable;
}
@ApiModelProperty(example = "null")
public String getPropertyId() {
return propertyId;
}
public ... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\history\HistoricDetailResponse.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void setAMOUNT(String value) {
this.amount = value;
}
/**
* Gets the value of the currency property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCURRENCY() {
return currency;
}
/**
* Sets the ... | * Sets the value of the taxcategory property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTAXCATEGORY(String value) {
this.taxcategory = value;
}
/**
* Gets the value of the taxamount property.
*
* @return
... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_stepcom_desadv\de\metas\edi\esb\jaxb\stepcom\desadv\DALCH1.java | 2 |
请完成以下Java代码 | protected void loadDocumentDetails()
{
setDateDoc(costRevaluation.getDateAcct());
setDateAcct(costRevaluation.getDateAcct());
setDocLines(loadDocLines());
}
private ImmutableList<DocLine_CostRevaluation> loadDocLines()
{
return costRevaluationRepository.streamAllLineRecordsByCostRevaluationId(costRevaluati... | .setDocLine(docLine)
.setAccount(docLine.getAccount(ProductAcctType.P_Revenue_Acct, acctSchema))
.setAmtSource(null, costs)
// .locatorId(line.getM_Locator_ID()) // N/A atm
.buildAndAdd();
}
//
// Expense
// ------------------------------------
// Product Asset CR
// Expense ... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java-legacy\org\compiere\acct\Doc_CostRevaluation.java | 1 |
请完成以下Java代码 | public ProcessPreconditionsResolution checkPreconditionsApplicable(final @NonNull IProcessPreconditionsContext context)
{
if (context.getSelectionSize().isNoSelection())
{
return ProcessPreconditionsResolution.rejectBecauseNoSelection();
}
return ProcessPreconditionsResolution.accept();
}
@NonNull
priva... | {
selectedApiRequestsQueryBuilder.addEqualsFilter(I_API_Request_Audit.COLUMNNAME_Status, Status.ERROR.getCode());
}
final IQueryOrderBy orderBy = queryBL.createQueryOrderByBuilder(I_API_Request_Audit.class)
.addColumnAscending(I_API_Request_Audit.COLUMNNAME_Time)
.createQueryOrderBy();
final Iterator... | repos\metasfresh-new_dawn_uat\backend\de.metas.util.web\src\main\java\de\metas\util\web\audit\process\API_Audit_Repeat.java | 1 |
请完成以下Java代码 | public static boolean isDeployable(String filename) {
return hasSuffix(filename, BpmnDeployer.BPMN_RESOURCE_SUFFIXES)
|| hasSuffix(filename, CmmnDeployer.CMMN_RESOURCE_SUFFIXES)
|| hasSuffix(filename, DecisionDefinitionDeployer.DMN_RESOURCE_SUFFIXES);
}
public static boolean isDeployable(String fil... | }
/**
* Checks, whether a filename is a diagram for the given modelFileName.
*
* @param fileName filename to check.
* @param modelFileName model file name.
* @param diagramSuffixes suffixes of the diagram files.
* @param modelSuffixes suffixes of model files.
* @return true, if a file is a diagr... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\container\impl\deployment\scanning\ProcessApplicationScanningUtil.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Crawler implements CommandLineRunner {
@Autowired
private DataCache dataCache;
@Override
public void run(String... strings) {
new VWCrawler.Builder().setUrl("https://blog.csdn.net/qqHJQS").setHeader("User-Agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ... | pageObj.setUrlMd5(Md5Util.getMD5(pageObj.getUrl().getBytes()));
/**
* todo 评论列表还未处理
*/
}
@Override
public void save(Blog pageObj) {
dataCache.save(pageObj);
}
}).build().start();
}
} | repos\spring-boot-quick-master\quick-vw-crawler\src\main\java\com\crawler\vw\init\Crawler.java | 2 |
请完成以下Java代码 | public class GCDImplementation {
public static int gcdByBruteForce(int n1, int n2) {
int gcd = 1;
for (int i = 1; i <= n1 && i <= n2; i++) {
if (n1 % i == 0 && n2 % i == 0) {
gcd = i;
}
}
return gcd;
}
public static int gcdByEuclidsAl... | while ((n1 & 1) == 0) {
n1 >>= 1;
}
do {
while ((n2 & 1) == 0) {
n2 >>= 1;
}
if (n1 > n2) {
int temp = n1;
n1 = n2;
n2 = temp;
}
n2 = (n2 - n1);
} while (n2 !... | repos\tutorials-master\core-java-modules\core-java-lang-math-5\src\main\java\com\baeldung\algorithms\gcd\GCDImplementation.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void configureGlobal(AuthenticationManagerBuilder auth,
UserDetailsService userDetailsService) throws Exception {
auth
.userDetailsService(userDetailsService)
.passwordEncoder(new BCryptPasswordEncoder());
}
// @formatter:on
// @formatter:off
@Bean
WebSecurityCustomizer ignoringCustomizer() {
... | @Bean
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
return http
.authorizeHttpRequests((authorize) -> authorize
.requestMatchers(PathRequest.toStaticResources().atCommonLocations()).permitAll()
.anyRequest().authenticated()
)
.formLogin((formLogin) -> formLogin
.p... | repos\spring-session-main\spring-session-samples\spring-session-sample-boot-websocket\src\main\java\sample\config\WebSecurityConfig.java | 2 |
请完成以下Java代码 | public GroupDto getGroup(UriInfo context) {
Group dbGroup = findGroupObject();
if(dbGroup == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Group with id " + resourceId + " does not exist");
}
GroupDto group = GroupDto.fromGroup(dbGroup);
return group;
}
public ResourceOp... | public void deleteGroup() {
ensureNotReadOnly();
identityService.deleteGroup(resourceId);
}
public GroupMembersResource getGroupMembersResource() {
return new GroupMembersResourceImpl(getProcessEngine().getName(), resourceId, rootResourcePath, getObjectMapper());
}
protected Group findGroupObject(... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\identity\impl\GroupResourceImpl.java | 1 |
请完成以下Java代码 | public BatchInformation2 getBtch() {
return btch;
}
/**
* Sets the value of the btch property.
*
* @param value
* allowed object is
* {@link BatchInformation2 }
*
*/
public void setBtch(BatchInformation2 value) {
this.btch = value;
}
... | * <p>
* For example, to add a new item, do as follows:
* <pre>
* getTxDtls().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link EntryTransaction2 }
*
*
*/
public List<EntryTransaction2> getTxDtls() {... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_02\EntryDetails1.java | 1 |
请完成以下Java代码 | public ResponseEntity<Object> createFile(@RequestParam String name, @RequestParam("file") MultipartFile file){
localStorageService.create(name, file);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@ApiOperation("上传图片")
@PostMapping("/pictures")
public ResponseEntity<LocalStorage> u... | @ApiOperation("修改文件")
@PreAuthorize("@el.check('storage:edit')")
public ResponseEntity<Object> updateFile(@Validated @RequestBody LocalStorage resources){
localStorageService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除文件")
@DeleteMapping
@Ap... | repos\eladmin-master\eladmin-tools\src\main\java\me\zhengjie\rest\LocalStorageController.java | 1 |
请完成以下Java代码 | public abstract class ExternalTaskCmd implements Command<Void> {
/**
* The corresponding external task id.
*/
protected String externalTaskId;
public ExternalTaskCmd(String externalTaskId) {
this.externalTaskId = externalTaskId;
}
@Override
public Void execute(CommandContext commandContext) {
... | propertyChanges == null || propertyChanges.isEmpty() ?
Collections.singletonList(PropertyChange.EMPTY_CHANGE) : propertyChanges);
}
}
protected String getUserOperationLogOperationType() {
return null;
}
protected List<PropertyChange> getUserOperationLogPropertyChanges(ExternalTaskEn... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\ExternalTaskCmd.java | 1 |
请完成以下Java代码 | public void onIsAttributeDependent(final I_M_ProductPrice productPrice)
{
if (!productPrice.isAttributeDependant())
{
return;
}
if (productPrice.getSeqNo() <= 0)
{
final int nextMatchSeqNo = Services.get(IPriceListDAO.class).retrieveNextMatchSeqNo(productPrice);
productPrice.setMatchSeqNo(nextMatch... | static void setTaxCategoryIdFromPriceListVersion(final I_M_ProductPrice productPrice)
{
final PriceListVersionId priceListVersionId = PriceListVersionId.ofRepoIdOrNull(productPrice.getM_PriceList_Version_ID());
if (priceListVersionId == null)
{
return;
}
final IPriceListDAO priceListsRepo = Services.get(... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\pricing\callout\M_ProductPrice.java | 1 |
请完成以下Java代码 | private boolean isASIValid(final I_C_BPartner_Product bpProduct, final AttributeSetInstanceId attributeSetInstanceId)
{
final IAttributeSetInstanceBL asiBL = Services.get(IAttributeSetInstanceBL.class);
if (bpProduct.getM_AttributeSetInstance_ID() <= 0)
{
return true;
}
final AttributeSetInstanceId bpPr... | final GTIN gtin = GTIN.ofNullableString(record.getGTIN());
bpartnerProductBL.setProductCodeFieldsFromGTIN(record, gtin);
}
else if (InterfaceWrapperHelper.isValueChanged(record, I_C_BPartner_Product.COLUMNNAME_EAN_CU))
{
final EAN13 ean13 = EAN13.ofNullableString(record.getEAN_CU());
final GTIN gtin = ea... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\bpartner_product\interceptor\C_BPartner_Product.java | 1 |
请完成以下Java代码 | public class WordAnalogy extends AbstractClosestVectors
{
protected WordAnalogy(String file)
{
super(file);
}
static void usage()
{
System.err.printf("Usage: java %s <FILE>\nwhere FILE contains word projections in the text format\n",
WordAnalogy.class.getN... | }
float[] vec = new float[size];
double len = 0;
for (int j = 0; j < size; j++)
{
vec[j] = vectorsReader.getMatrixElement(bi[1], j) -
vectorsReader.getMatrixElement(bi[0], j) + vectorsReader.getMatrixElement(bi[2], j);
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\WordAnalogy.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8888
spring:
application:
name: gateway-application
cloud:
# Spring Cloud Gateway 配置项,对应 GatewayProperties 类
gateway:
# 路由配置项,对应 RouteDefinition 数组
routes:
- id: yudaoyuanma # 路由的编号
uri: http://www.iocoder.cn # 路由到的目标地址
predicates: # 断言,作为路由的匹配条件... | 集成,对应 DiscoveryLocatorProperties 类
discovery:
locator:
enabled: true # 是否开启,默认为 false 关闭
url-expression: "'lb://' + serviceId" # 路由的目标地址的表达式,默认为 "'lb://' + serviceId"
# Nacos 作为注册中心的配置项
nacos:
discovery:
server-addr: 127.0.0.1:8848 # Nacos 服务器地址 | repos\SpringBoot-Labs-master\labx-08-spring-cloud-gateway\labx-08-sc-gateway-demo02-registry\src\main\resources\application.yaml | 2 |
请完成以下Java代码 | public Quantity getQtyPicked()
{
return byActualHUIdPicked.values()
.stream()
.map(DDOrderMoveSchedulePickedHU::getQtyPicked)
.reduce(Quantity::add)
.orElseThrow(() -> new IllegalStateException("empty list: " + this));
}
public boolean isDroppedTo()
{
return byActualHUIdPicked.values().stream()... | else if (inTransitLocatorIds.size() == 1)
{
final LocatorId inTransitLocatorId = inTransitLocatorIds.iterator().next();
return ExplainedOptional.of(inTransitLocatorId);
}
else
{
// shall not happen
return ExplainedOptional.emptyBecause("More than one in transit locator found: " + inTransitLocatorIds... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\distribution\ddorder\movement\schedule\DDOrderMoveSchedulePickedHUs.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public CaseDefinitionEntity findLatestDefinitionByKey(String key) {
return findLatestCaseDefinitionByKey(key);
}
@Override
public CaseDefinitionEntity findLatestDefinitionById(String id) {
return findCaseDefinitionById(id);
}
@Override
public CaseDefinitionEntity getCachedResourceDefinitionEntity(... | @Override
public CaseDefinitionEntity findDefinitionByKeyVersionTagAndTenantId(String definitionKey, String definitionVersionTag, String tenantId) {
throw new UnsupportedOperationException("Currently finding case definition by version tag and tenant is not implemented.");
}
@Override
public CaseDefinitionE... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmmn\entity\repository\CaseDefinitionManager.java | 2 |
请完成以下Java代码 | public ShipmentScheduleReferencedLine provideFor(@NonNull final I_M_ShipmentSchedule shipmentSchedule)
{
final OrderAndLineId orderAndLineId = extractOrderAndLineId(shipmentSchedule);
return provideFor(orderAndLineId);
}
private ShipmentScheduleReferencedLine provideFor(@NonNull final OrderAndLineId orderAndLin... | // Fetch it from order line if possible
final ZonedDateTime datePromised = TimeUtil.asZonedDateTime(orderLine.getDatePromised());
if (datePromised != null)
{
return datePromised;
}
// Fetch it from order header if possible
final ZonedDateTime datePromisedFromOrder = TimeUtil.asZonedDateTime(order.getDat... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\spi\impl\ShipmentScheduleOrderReferenceProvider.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class JsonMappingConfig
{
int seqNo;
@Nullable String shipperProductExternalId;
@NonNull String attributeType;
@Nullable String groupKey;
@Nullable String attributeKey;
@NonNull String attributeValue;
@Nullable String mappingRule;
@Nullable String mappingRuleValue;
@JsonIgnore
public boolean isConfigF... | {
case DeliveryMappingConstants.MAPPING_RULE_RECEIVER_COUNTRY_CODE:
return valueProvider.apply(DeliveryMappingConstants.ATTRIBUTE_VALUE_RECEIVER_COUNTRY_CODE)
.equals(mappingRuleValue);
default:
throw new IllegalArgumentException("Unknown mappingRule: " + mappingRule);
}
}
@JsonIgnore
private ... | repos\metasfresh-new_dawn_uat\misc\de-metas-common\de-metas-common-delivery\src\main\java\de\metas\common\delivery\v1\json\request\JsonMappingConfig.java | 2 |
请在Spring Boot框架中完成以下Java代码 | class DefaultMatchInvListener implements MatchInvListener
{
private final IMatchPOBL matchPOBL = Services.get(IMatchPOBL.class);
private final MatchInvoiceService matchInvoiceService;
private final OrderCostService orderCostService;
DefaultMatchInvListener(
@NonNull final MatchInvoiceService matchInvoiceService... | for (final MatchInv matchInv : matchInvs)
{
final MatchInvType type = matchInv.getType();
if (type.isMaterial())
{
clearInvoiceLineFromMatchPOs(matchInv);
}
else if (type.isCost())
{
final MatchInvCostPart matchInvCost = matchInv.getCostPartNotNull();
orderCostService.updateInOutCostById... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\matchinv\listeners\DefaultMatchInvListener.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class Article {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String content;
private String slug;
public Article(Long id, String name, String content, String slug) {
this.id = id;
this.name = name;
this.cont... | public void setName(String name) {
this.name = name;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getSlug() {
return slug;
}
public void setSlug(String slug) {
... | repos\tutorials-master\patterns-modules\vertical-slice-architecture\src\main\java\com\baeldung\hexagonal\persistence\entity\Article.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.