instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | public String getSuperProcessInstanceId() {
return superProcessInstanceId;
}
public void setSuperProcessInstanceId(String superProcessInstanceId) {
this.superProcessInstanceId = superProcessInstanceId;
}
@Override
public String getTenantId() {
return tenantId;
}
pu... | @Override
public void setLocalizedDescription(String localizedDescription) {
this.localizedDescription = localizedDescription;
}
@Override
public Map<String, Object> getProcessVariables() {
Map<String, Object> variables = new HashMap<>();
if (queryVariables != null) {
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\HistoricProcessInstanceEntity.java | 1 |
请完成以下Java代码 | private final List<I_AD_Field_ContextMenu> retrieveContextMenuForClient(@CacheCtx final Properties ctx, final int adClientId)
{
return Services.get(IQueryBL.class).createQueryBuilder(I_AD_Field_ContextMenu.class, ctx, ITrx.TRXNAME_None)
.addInArrayOrAllFilter(I_AD_Field_ContextMenu.COLUMN_AD_Client_ID, 0, adClie... | @Override
public IContextMenuActionContext createContext(final VEditor editor)
{
final VTable vtable = null;
final int viewRow = IContextMenuActionContext.ROW_NA;
final int viewColumn = IContextMenuActionContext.COLUMN_NA;
return createContext(editor, vtable, viewRow, viewColumn);
}
@Override
public ICont... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\org\adempiere\ui\impl\ContextMenuProvider.java | 1 |
请完成以下Java代码 | private @Nullable HttpSession createNewSessionIfAllowed(SecurityContext context) {
if (this.httpSessionExistedAtStartOfRequest) {
this.logger.debug("HttpSession is now null, but was not null at start of request; "
+ "session was invalidated, so do not create a new session");
return null;
}
if (!H... | try {
HttpSession session = this.request.getSession(true);
this.logger.debug("Created HttpSession as SecurityContext is non-default");
return session;
}
catch (IllegalStateException ex) {
// Response must already be committed, therefore can't create a new
// session
this.logger.warn("Faile... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\context\HttpSessionSecurityContextRepository.java | 1 |
请完成以下Java代码 | private void assignHUsFromReceiptLine(final I_M_MovementLine movementLine)
{
//
// Particular case: movement generated from Receipt Line (to move Qty to destination warehouse)
final I_M_InOutLine receiptLine = InterfaceWrapperHelper.create(movementLine.getM_InOutLine(), I_M_InOutLine.class);
if (receiptLine ==... | // Assign them to movement line
Services.get(IHUMovementBL.class).setAssignedHandlingUnits(movementLine, hus);
}
@DocValidate(timings = ModelValidator.TIMING_BEFORE_COMPLETE)
public void moveHandlingUnits(final I_M_Movement movement)
{
final boolean doReversal = false;
huMovementBL.moveHandlingUnits(movement... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\model\validator\M_Movement.java | 1 |
请完成以下Java代码 | public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
} | @Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("Address [locality=").append(locality).append(", city=").append(city).append(", zip=").append(zip).append("]");
return builder.toString();
}
public Address(String locality, String city, ... | repos\tutorials-master\libraries-apache-commons-collections\src\main\java\com\baeldung\commons\collections\collectionutils\Address.java | 1 |
请完成以下Java代码 | public static void setCursors(Component[] components, boolean waiting) {
for( int i = 0; i < components.length; i++) {
setCursor(components[i], waiting);
}
}
public synchronized static void setCursorsFromParent(Container parent, boolean waiting) {
Container con = parent;
for(int i = 0; i < con... | private void setOpaque(Component c) {
//ignores all selectable items, like buttons
if(c instanceof ItemSelectable) {
return;
}
// sets transparent
else if(c instanceof JComponent) {
((JComponent)c).setOpaque(opaque);
}
// recursively calls this method for all container ... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\tools\swing\SwingTool.java | 1 |
请完成以下Java代码 | public String toString()
{
return MoreObjects.toStringHelper(this)
.addValue(paramsRO)
.toString();
}
public boolean isCollecting()
{
return params != null;
}
/**
* Directly append all sqlParams from the given {@code sqlQueryFilter}.
*
* @param sqlQueryFilter
*
*/
public void collectAll... | * The internal list won't be affected, because it does not exist.
*/
public String placeholder(@Nullable final Object sqlValue)
{
if (params == null)
{
return DB.TO_SQL(sqlValue);
}
else
{
params.add(sqlValue);
return "?";
}
}
/** @return readonly live list */
public List<Object> toList()
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\sql\SqlParamsCollector.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setC_POS_Order_ID (final int C_POS_Order_ID)
{
if (C_POS_Order_ID < 1)
set_Value (COLUMNNAME_C_POS_Order_ID, null);
else
set_Value (COLUMNNAME_C_POS_Order_ID, C_POS_Order_ID);
}
@Override
public int getC_POS_Order_ID()
{
return get_ValueAsInt(COLUMNNAME_C_POS_Order_ID);
}
@Override
... | return get_ValueAsString(COLUMNNAME_Description);
}
/**
* Type AD_Reference_ID=541892
* Reference name: C_POS_JournalLine_Type
*/
public static final int TYPE_AD_Reference_ID=541892;
/** CashPayment = CASH_PAY */
public static final String TYPE_CashPayment = "CASH_PAY";
/** CardPayment = CARD_PAY */
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.pos.base\src\main\java-gen\de\metas\pos\repository\model\X_C_POS_JournalLine.java | 2 |
请完成以下Java代码 | public Segment getSegment()
{
return segment;
}
@Override
public IDependencyParser setSegment(Segment segment)
{
this.segment = segment;
return this;
}
@Override
public Map<String, String> getDeprelTranslator()
{
return deprelTranslater;
}
@... | {
String[] args = iterator.next().split("\\s");
deprelTranslater.put(args[0], args[1]);
}
if (deprelTranslater.size() == 0)
{
deprelTranslater = null;
}
GlobalObjectPool.put(deprelTranslatorPath, deprelTranslater);
return this;
}
... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dependency\AbstractDependencyParser.java | 1 |
请完成以下Java代码 | public abstract class AbstractTransactionContext implements TransactionContext {
public final static TransactionLogger LOG = ProcessEngineLogger.TX_LOGGER;
@Override
public void commit() {
// managed transaction, ignore
}
@Override
public void rollback() {
// managed transaction, mark rollback-on... | if(isRolledBack(status) && TransactionState.ROLLED_BACK.equals(transactionState)) {
transactionListener.execute(commandContext);
} else if(isCommitted(status) && TransactionState.COMMITTED.equals(transactionState)) {
transactionListener.execute(commandContext);
}
}
protected abstrac... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cfg\jta\AbstractTransactionContext.java | 1 |
请完成以下Java代码 | public String getKeyword ()
{
return (String)get_Value(COLUMNNAME_Keyword);
}
public I_R_RequestProcessor getR_RequestProcessor() throws RuntimeException
{
return (I_R_RequestProcessor)MTable.get(getCtx(), I_R_RequestProcessor.Table_Name)
.getPO(getR_RequestProcessor_ID(), get_TrxName()); }
/** Set Re... | else
set_Value (COLUMNNAME_R_RequestType_ID, Integer.valueOf(R_RequestType_ID));
}
/** Get Request Type.
@return Type of request (e.g. Inquiry, Complaint, ..)
*/
public int getR_RequestType_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_R_RequestType_ID);
if (ii == null)
return 0;
return ii... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_RequestProcessor_Route.java | 1 |
请完成以下Java代码 | private String getSql()
{
final I_M_Product product = Services.get(IProductDAO.class).getById(getRecord_ID());
final StringBuffer sb = new StringBuffer();
sb.append("SELECT productName, CustomerLabelName, additional_produktinfos, productValue, UPC, weight, country, guaranteedaysmin, ")
.append("warehouse_t... | columnHeaders.add("M_Product_Nutrition_ID");
columnHeaders.add("NutritionQty");
return columnHeaders;
}
@Override
public ProcessPreconditionsResolution checkPreconditionsApplicable(final IProcessPreconditionsContext context)
{
if (!context.isSingleSelection())
{
return ProcessPreconditionsResolution.re... | repos\metasfresh-new_dawn_uat\backend\de.metas.fresh\de.metas.fresh.base\src\main\java\de\metas\fresh\product\process\ExportProductSpecifications.java | 1 |
请完成以下Java代码 | public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Process Now */
public boole... | set_Value (COLUMNNAME_Value, Value);
}
/** Get Search Key.
@return Search key for the record in the format required - must be unique
*/
public String getValue ()
{
return (String)get_Value(COLUMNNAME_Value);
}
/** Set Version.
@param Version
Version of the table definition
*/
public void setVer... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_EXP_Format.java | 1 |
请完成以下Java代码 | public Long countByTenantId(TenantId tenantId) {
return assetRepository.countByTenantId(tenantId.getId());
}
@Override
public Asset findByTenantIdAndExternalId(UUID tenantId, UUID externalId) {
return DaoUtil.getData(assetRepository.findByTenantIdAndExternalId(tenantId, externalId));
}
... | @Override
public PageData<Asset> findAllByTenantId(TenantId tenantId, PageLink pageLink) {
return findByTenantId(tenantId.getId(), pageLink);
}
@Override
public List<AssetFields> findNextBatch(UUID uuid, int batchSize) {
return assetRepository.findAllFields(uuid, Limit.of(batchSize));
... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sql\asset\JpaAssetDao.java | 1 |
请完成以下Java代码 | public OAuth2TokenValidatorResult validate(Jwt jwt) {
Map<String, Object> confirmationMethodClaim = jwt.getClaim("cnf");
String x509CertificateThumbprintClaim = null;
if (!CollectionUtils.isEmpty(confirmationMethodClaim) && confirmationMethodClaim.containsKey("x5t#S256")) {
x509CertificateThumbprintClaim = (St... | byte[] digest = md.digest(x509Certificate.getEncoded());
return Base64.getUrlEncoder().withoutPadding().encodeToString(digest);
}
private static final class DefaultX509CertificateSupplier implements Supplier<X509Certificate> {
@Override
public X509Certificate get() {
RequestAttributes requestAttributes = R... | repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\X509CertificateThumbprintValidator.java | 1 |
请完成以下Java代码 | public class City {
private Integer id;
private String name;
private String countrycode;
private String district;
private Integer population;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
... | return countrycode;
}
public void setCountrycode(String countrycode) {
this.countrycode = countrycode == null ? null : countrycode.trim();
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district == null ? n... | repos\spring-boot-quick-master\quick-modules\dao\src\main\java\com\modules\entity\City.java | 1 |
请完成以下Java代码 | public RetryTopicConfigurationBuilder listenerFactory(ConcurrentKafkaListenerContainerFactory<?, ?> factory) {
this.listenerContainerFactory = factory;
return this;
}
/**
* Configure the container factory to use via its bean name.
* @param factoryBeanName the factory bean name.
* @return the builder.
*/
... | return builder.build();
}
/**
* Create a new instance of the builder.
* @return the new instance.
*/
public static RetryTopicConfigurationBuilder newInstance() {
return new RetryTopicConfigurationBuilder();
}
private static final class ExceptionEntriesConfigurer {
private final boolean matchIfFound;
... | repos\spring-kafka-main\spring-kafka\src\main\java\org\springframework\kafka\retrytopic\RetryTopicConfigurationBuilder.java | 1 |
请完成以下Java代码 | public static void example() {
try {
XMLExample xml = (XMLExample) JAXBHelper.getContextUnmarshaller(XMLExample.class).unmarshal(new File(XML_FILE_IN));
JAXBHelper.print(xml.toString());
ExampleHTML html = new ExampleHTML();
Body body = new Body();
Cu... | body.setCustomElement(customElement);
body.setNestedElement(nested);
Meta meta = new Meta();
meta.setTitle("example");
html.getHead().add(meta);
html.setBody(body);
JAXBHelper.getContextMarshaller(ExampleHTML.class).marshal(html, new File(JAXB_FI... | repos\tutorials-master\xml-modules\xml-2\src\main\java\com\baeldung\xmlhtml\helpers\jaxb\JAXBHelper.java | 1 |
请完成以下Java代码 | public void setLineNetAmt (final BigDecimal LineNetAmt)
{
set_Value (COLUMNNAME_LineNetAmt, LineNetAmt);
}
@Override
public BigDecimal getLineNetAmt()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_LineNetAmt);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setM_Product_ID ... | @Override
public BigDecimal getQtyOrdered()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyOrdered);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
public void setQtyReceived (final BigDecimal QtyReceived)
{
set_Value (COLUMNNAME_QtyReceived, QtyReceived);
}
@Override
public BigDec... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Order_Cost_Detail.java | 1 |
请完成以下Java代码 | private static Optional<IExpression<?>> buildExpression(final IExpressionFactory expressionFactory, final String expressionStr, final Class<?> fieldValueClass)
{
// Hardcoded: NULL
if (HARDCODED_DEFAUL_EXPRESSION_STRING_NULL.equalsIgnoreCase(expressionStr))
{
return Optional.empty();
}
// Hardcoded: SysD... | /**
* Strips default value expressions which are quoted strings.
* e.g.
* <ul>
* <li>we have some cases where a YesNo default value is 'N' or 'Y'
* <li>we have some cases where a List default value is something like 'P'
* <li>we have some cases where a Table's reference default value is something like 'de.m... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\factory\standard\DefaultValueExpressionsFactory.java | 1 |
请完成以下Java代码 | public HistoryEvent createHistoryEvent(HistoryEventProducer producer) {
return null;
}
public List<HistoryEvent> createHistoryEvents(HistoryEventProducer producer) {
return Collections.emptyList();
}
public void postHandleSingleHistoryEventCreated(HistoryEvent event) {
return;
}
... | * {@link HistoryEventCreator} implementation.
*
* @param creator the creator is used to create the {@link HistoryEvent} which should be thrown
*/
public static void processHistoryEvents(HistoryEventCreator creator) {
HistoryEventProducer historyEventProducer = Context.getProcessEngineConfiguration().getH... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\history\event\HistoryEventProcessor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EnumUtil {
/**
* 根据code获取枚举
* @param enumClass
* @param code
* @param <E>
* @return
*/
public static <E extends Enum<?> & BaseEnum> E codeOf(Class<E> enumClass, int code) {
E[] enumConstants = enumClass.getEnumConstants();
for (E e : enumConstants) {
... | * @param msg
* @param <E>
* @return
*/
public static <E extends Enum<?> & BaseEnum> E msgOf(Class<E> enumClass, String msg) {
E[] enumConstants = enumClass.getEnumConstants();
for (E e : enumConstants) {
if (e.getMsg().equals(msg)) {
return e;
}... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\utils\EnumUtil.java | 2 |
请完成以下Java代码 | public String getParentTaskId() {
return parentTaskId;
}
@Override
public Map<String, VariableInstanceEntity> getVariableInstanceEntities() {
ensureVariableInstancesInitialized();
return variableInstances;
}
public int getSuspensionState() {
return suspensionState;
... | queryVariables = new VariableInitializingList();
}
return queryVariables;
}
public void setQueryVariables(List<VariableInstanceEntity> queryVariables) {
this.queryVariables = queryVariables;
}
@Override
public String getState() {
return null;
}
@Override
... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\TaskEntity.java | 1 |
请完成以下Java代码 | public boolean isSameLine ()
{
Object oo = get_Value(COLUMNNAME_IsSameLine);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Updateable.
@param IsUpdateable
Determines, if the field can be updated
*/... | /** Get Max. Value.
@return Maximum Value for a field
*/
public String getValueMax ()
{
return (String)get_Value(COLUMNNAME_ValueMax);
}
/** Set Min. Value.
@param ValueMin
Minimum Value for a field
*/
public void setValueMin (String ValueMin)
{
set_Value (COLUMNNAME_ValueMin, ValueMin);
}
/... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Attribute.java | 1 |
请完成以下Java代码 | private void generate0()
{
final OrdersCollector ordersCollector = OrdersCollector.newInstance();
final OrdersAggregator aggregator = OrdersAggregator.newInstance(ordersCollector);
for (final Iterator<I_PMM_PurchaseCandidate> it = getCandidates(); it.hasNext();)
{
final I_PMM_PurchaseCandidate candidateMod... | Check.assumeNotNull(candidates, "candidates not null");
this.candidates = candidates;
return this;
}
public OrdersGenerator setCandidates(final Iterable<I_PMM_PurchaseCandidate> candidates)
{
Check.assumeNotNull(candidates, "candidates not null");
setCandidates(candidates.iterator());
return this;
}
pr... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\order\impl\OrdersGenerator.java | 1 |
请完成以下Java代码 | public void setPostingError_Issue_ID (final int PostingError_Issue_ID)
{
if (PostingError_Issue_ID < 1)
set_Value (COLUMNNAME_PostingError_Issue_ID, null);
else
set_Value (COLUMNNAME_PostingError_Issue_ID, PostingError_Issue_ID);
}
@Override
public int getPostingError_Issue_ID()
{
return get_ValueA... | {
return get_ValueAsBoolean(COLUMNNAME_Processing);
}
@Override
public org.compiere.model.I_S_TimeExpenseLine getS_TimeExpenseLine()
{
return get_ValueAsPO(COLUMNNAME_S_TimeExpenseLine_ID, org.compiere.model.I_S_TimeExpenseLine.class);
}
@Override
public void setS_TimeExpenseLine(final org.compiere.model.I... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_ProjectIssue.java | 1 |
请完成以下Java代码 | public MethodInfo getMethodInfo(ELContext context) throws ELException {
return node.getMethodInfo(bindings, context, type, types);
}
@Override
public String getExpressionString() {
return expr;
}
/**
* Evaluates the expression and invokes the method.
* @param context used to resolve properties (<code>b... | * <li>their structural id's are equal</li>
* <li>their bindings are equal</li>
* <li>their expected types match</li>
* <li>their parameter types are equal</li>
* </ol>
*/
@Override
public boolean equals(Object obj) {
if (obj != null && obj.getClass() == getClass()) {
TreeMethodExpression other = (TreeM... | repos\camunda-bpm-platform-master\juel\src\main\java\org\camunda\bpm\impl\juel\TreeMethodExpression.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private boolean isCurrencyMatching(final I_M_PriceList priceList)
{
if (currencyId == null)
{
return true;
}
else
{
return currencyId.equals(CurrencyId.ofRepoId(priceList.getC_Currency_ID()));
}
}
private boolean isCountryMatching(final I_M_PriceList priceList)
{
if (countryIds == ... | {
return true;
}
if (countryIds.isEmpty())
{
return priceListCountryId == null;
}
else
{
return countryIds.contains(priceListCountryId);
}
}
private boolean isSOTrxMatching(final I_M_PriceList priceList)
{
return soTrx == null || soTrx.isSales() == priceList.isSOPriceList();
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\pricing\service\PriceListsCollection.java | 2 |
请完成以下Java代码 | public static LocatorQRCode fromGlobalQRCodeJsonString(final String qrCodeString)
{
return fromGlobalQRCode(GlobalQRCode.ofString(qrCodeString));
}
public static LocatorQRCode fromGlobalQRCode(@NonNull final GlobalQRCode globalQRCode)
{
if (!isTypeMatching(globalQRCode))
{
throw new AdempiereException("In... | {
return JsonConverterV1.fromGlobalQRCode(globalQRCode);
}
else
{
throw new AdempiereException("Invalid QR Code version: " + version);
}
}
public static boolean isTypeMatching(final @NonNull GlobalQRCode globalQRCode)
{
return GlobalQRCodeType.equals(GLOBAL_QRCODE_TYPE, globalQRCode.getType());
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\warehouse\qrcode\LocatorQRCodeJsonConverter.java | 1 |
请完成以下Java代码 | private AggregationId getInvoice_Aggregation_ID(final I_C_BPartner bpartner, final boolean isSOTrx, final String aggregationUsageLevel)
{
final int aggregationId;
if (X_C_Aggregation.AGGREGATIONUSAGELEVEL_Header.equals(aggregationUsageLevel))
{
aggregationId = isSOTrx ? bpartner.getSO_Invoice_Aggregation_ID()... | final AggregationId aggregationId = getPrepayOrder_Invoice_Aggregation_ID();
final IAggregationKeyBuilder<I_C_Invoice_Candidate> aggregation;
if (aggregationId != null)
{
aggregation = aggregationFactory.getAggregationKeyBuilder(ctx, I_C_Invoice_Candidate.class, aggregationId);
}
else
{
aggregation =... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceAggregationFactory.java | 1 |
请完成以下Java代码 | public void setCapacity(int capacity) {
synchronized (this.monitor) {
this.events = new AuditEvent[capacity];
}
}
@Override
public void add(AuditEvent event) {
Assert.notNull(event, "'event' must not be null");
synchronized (this.monitor) {
this.tail = (this.tail + 1) % this.events.length;
this.eve... | private boolean isMatch(@Nullable String principal, @Nullable Instant after, @Nullable String type,
AuditEvent event) {
boolean match = true;
match = match && (principal == null || event.getPrincipal().equals(principal));
match = match && (after == null || event.getTimestamp().isAfter(after));
match = match ... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\audit\InMemoryAuditEventRepository.java | 1 |
请完成以下Java代码 | public ActivityInstanceDto getActivityInstanceTree() {
RuntimeService runtimeService = engine.getRuntimeService();
ActivityInstance activityInstance = null;
try {
activityInstance = runtimeService.getActivityInstance(processInstanceId);
} catch (AuthorizationException e) {
throw e;
} c... | modificationBuilder.execute(dto.isSkipCustomListeners(), dto.isSkipIoMappings());
}
}
@Override
public BatchDto modifyProcessInstanceAsync(ProcessInstanceModificationDto dto) {
Batch batch = null;
if (dto.getInstructions() != null && !dto.getInstructions().isEmpty()) {
ProcessInstanceModificati... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\runtime\impl\ProcessInstanceResourceImpl.java | 1 |
请完成以下Java代码 | public Builder authorities(Consumer<Collection<GrantedAuthority>> authorities) {
authorities.accept(this.authorities);
return this;
}
@Override
public Builder details(@Nullable Object details) {
this.details = details;
return this;
}
@Override
public Builder principal(@Nullable Object principa... | public Builder credentials(@Nullable Object credentials) {
this.credentials = credentials;
return this;
}
@Override
public Builder authenticated(boolean authenticated) {
this.authenticated = authenticated;
return this;
}
@Override
public Authentication build() {
return new SimpleAuthenticat... | repos\spring-security-main\core\src\main\java\org\springframework\security\core\SimpleAuthentication.java | 1 |
请完成以下Java代码 | public class CustomerReflectionToString extends Customer {
private Integer score;
private List<String> orders;
private StringBuffer fullname;
public Integer getScore() {
return score;
}
public void setScore(Integer score) {
this.score = score;
}
public List<String> ge... | this.orders = orders;
}
public StringBuffer getFullname() {
return fullname;
}
public void setFullname(StringBuffer fullname) {
this.fullname = fullname;
}
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
} | repos\tutorials-master\core-java-modules\core-java-string-operations-12\src\main\java\com\baeldung\tostring\CustomerReflectionToString.java | 1 |
请完成以下Java代码 | public static Date getLast7DaysStartTime() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, -7);
return DateUtil.beginOfDay(calendar.getTime());
}
/**
* 过去七天结束时间(不含今天)
*
* @return
*/
public static Dat... | * @return
*/
public static Date getTomorrowEndTime() {
return DateUtil.endOfDay(DateUtil.tomorrow());
}
/**
* 今天开始时间
*
* @return
*/
public static Date getTodayStartTime() {
return DateUtil.beginOfDay(new Date());
}
/**
* 今天结束时间
*
* @retur... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\DateRangeUtils.java | 1 |
请完成以下Java代码 | public class AlipayAccountLogVO {
/** 支付宝账户余额 **/
private BigDecimal balance = BigDecimal.ZERO;
/** 购买人帐号 **/
private String buyerAccount;
/** 商品名称 **/
private String goodsTitle;
/** 平台账户入账金额 **/
private BigDecimal income = BigDecimal.ZERO;
/** 平台账户出款金额 **/
private BigDecimal outcome = BigDecimal.ZERO;
... | }
/** 订单金额 **/
public BigDecimal getTotalFee() {
return totalFee;
}
/** 订单金额 **/
public void setTotalFee(BigDecimal totalFee) {
this.totalFee = totalFee;
}
/** 银行流水 **/
public String getTradeNo() {
return tradeNo;
}
/** 银行流水 **/
public void setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
}
... | repos\roncoo-pay-master\roncoo-pay-app-reconciliation\src\main\java\com\roncoo\pay\app\reconciliation\vo\AlipayAccountLogVO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private PickingJob reinitializePickingTargetIfDestroyed(final PickingJob pickingJob)
{
if (isLineLevelPickTarget(pickingJob))
{
return pickingJob.withLuPickingTarget(lineId, this::reinitializeLUPickingTarget);
}
else
{
return pickingJob.withLuPickingTarget(null, this::reinitializeLUPickingTarget);
}
... | }
final I_M_HU lu = huService.getById(luId);
if (!huService.isDestroyedOrEmptyStorage(lu))
{
return luPickingTarget;
}
final HuPackingInstructionsIdAndCaption luPI = huService.getEffectivePackingInstructionsIdAndCaption(lu);
return LUPickingTarget.ofPackingInstructions(luPI);
}
//
//
//
@Value
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\PickingJobUnPickCommand.java | 2 |
请完成以下Java代码 | public int getDLM_Partition_Size_Per_Table_V_ID()
{
final Integer ii = (Integer)get_Value(COLUMNNAME_DLM_Partition_Size_Per_Table_V_ID);
if (ii == null)
{
return 0;
}
return ii.intValue();
}
/**
* Set Anz. zugeordneter Datensätze.
*
* @param PartitionSize Anz. zugeordneter Datensätze
*/
@Over... | if (ii == null)
{
return 0;
}
return ii.intValue();
}
/**
* Set Name der DB-Tabelle.
*
* @param TableName Name der DB-Tabelle
*/
@Override
public void setTableName(final java.lang.String TableName)
{
set_ValueNoCheck(COLUMNNAME_TableName, TableName);
}
/**
* Get Name der DB-Tabelle.
*
... | repos\metasfresh-new_dawn_uat\backend\de.metas.dlm\base\src\main\java-gen\de\metas\dlm\model\X_DLM_Partition_Size_Per_Table_V.java | 1 |
请完成以下Java代码 | public static ExternalSystemScriptedExportConversionConfigId ofRepoId(final int repoId)
{
return new ExternalSystemScriptedExportConversionConfigId(repoId);
}
@Nullable
public static ExternalSystemScriptedExportConversionConfigId ofRepoIdOrNull(@Nullable final Integer repoId)
{
return repoId != null && repoId... | @JsonValue
public int toJson()
{
return getRepoId();
}
private ExternalSystemScriptedExportConversionConfigId(final int repoId)
{
this.repoId = Check.assumeGreaterThanZero(repoId, "ExternalSystem_Config_ScriptedExportConversion_ID");
}
@Override
public ExternalSystemType getType()
{
return ExternalSyst... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\scriptedexportconversion\ExternalSystemScriptedExportConversionConfigId.java | 1 |
请完成以下Java代码 | public static void registerType(ModelBuilder modelBuilder) {
ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Resource.class, BPMN_ELEMENT_RESOURCE)
.namespaceUri(BPMN20_NS)
.extendsType(RootElement.class)
.instanceProvider(new ModelTypeInstanceProvider<Resource>() {
public Re... | public ResourceImpl(ModelTypeInstanceContext context) {
super(context);
}
public String getName() {
return nameAttribute.getValue(this);
}
public void setName(String name) {
nameAttribute.setValue(this, name);
}
public Collection<ResourceParameter> getResourceParameters() {
return resourc... | repos\camunda-bpm-platform-master\model-api\bpmn-model\src\main\java\org\camunda\bpm\model\bpmn\impl\instance\ResourceImpl.java | 1 |
请完成以下Java代码 | public final class RequestMatchers {
/**
* Creates a {@link RequestMatcher} that matches if at least one of the given
* {@link RequestMatcher}s matches, if <code>matchers</code> are empty then the
* returned matcher never matches.
* @param matchers the {@link RequestMatcher}s to use
* @return the any-of com... | * @see AndRequestMatcher
*/
public static RequestMatcher allOf(RequestMatcher... matchers) {
return (matchers.length > 0) ? new AndRequestMatcher(List.of(matchers)) : (request) -> true;
}
/**
* Creates a {@link RequestMatcher} that matches if the given {@link RequestMatcher}
* does not match.
* @param mat... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\util\matcher\RequestMatchers.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Tag {
@Id
@GeneratedValue (strategy = GenerationType.IDENTITY)
private long id;
private String name;
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "tags")
private Set<Post> posts = new HashSet<>();
public Tag() {
}
public Tag(String name) {
super();
this.... | }
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Set<Post> getPosts() {
return posts;
}
public void setPosts(Set<Post> posts) {
this.posts = posts;
}
} | repos\Spring-Boot-Advanced-Projects-main\springboot-hibernate-many-to-many-mapping\src\main\java\net\alanbinu\springboot\entity\Tag.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class CityESServiceImpl implements CityService {
private static final Logger LOGGER = LoggerFactory.getLogger(CityESServiceImpl.class);
// 分页参数 -> TODO 代码可迁移到具体项目的公共 common 模块
private static final Integer pageNumber = 0;
private static final Integer pageSize = 10;
Pageable pageable = new Pa... | return cityRepository.findByDescriptionOrScore(description, score);
}
public List<City> findByDescription(String description) {
return cityRepository.findByDescription(description, pageable).getContent();
}
public List<City> findByDescriptionNot(String description) {
return cityReposit... | repos\springboot-learning-example-master\spring-data-elasticsearch-crud\src\main\java\org\spring\springboot\service\impl\CityESServiceImpl.java | 2 |
请完成以下Java代码 | public void setId(Long id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public User getAuthor() {
return author;
}
public void setAuthor(User author) {
this.... | if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Post post = (Post) o;
return Objects.equals(id, post.id);
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}... | repos\tutorials-master\persistence-modules\spring-boot-persistence-2\src\main\java\com\baeldung\nplusone\defaultfetch\list\Post.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DatabaseProperties {
@Value("${db.name}")
private String name;
// Since Spring Boot 2.?. it supports list of strings from properties file directly
// if not , register DefaultConversionService
/**
* @Bean
* public ConversionService conversionService() {
... | '}';
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<String> getClusterIp() {
return clusterIp;
}
public void setClusterIp(List<String> clusterIp) {
this.clusterIp = clusterIp;
}
} | repos\spring-boot-master\spring-boot-externalize-config-3\src\main\java\com\mkyong\config\DatabaseProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class DeliveryOrderParcel
{
@Nullable DeliveryOrderParcelId id;
@Nullable String content;
@NonNull BigDecimal grossWeightKg;
@NonNull PackageDimensions packageDimensions;
@Nullable CustomDeliveryLineData customDeliveryLineData;
@NonNull PackageId packageId;
@Nullable String awb;
@Nullable String tracking... | this.awb = awb;
this.trackingUrl = trackingUrl;
this.labelPdfBase64 = labelPdfBase64;
this.items = CoalesceUtil.coalesceNotNull(items, ImmutableList.of());
Check.assume(grossWeightKg.signum() > 0, "grossWeightKg > 0");
this.id = id;
this.grossWeightKg = grossWeightKg;
this.content = content;
this.packa... | repos\metasfresh-new_dawn_uat\backend\de.metas.shipper.gateway.spi\src\main\java\de\metas\shipper\gateway\spi\model\DeliveryOrderParcel.java | 2 |
请完成以下Java代码 | public PrintJobInstructionsStatusEnum getStatus()
{
return status;
}
public void setStatus(PrintJobInstructionsStatusEnum status)
{
this.status = status;
}
@Override
public String toString()
{
return "PrintJobInstructionsConfirm [printJobInstructionsID=" + printJobInstructionsID + ", errorMsg=" + errorM... | if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PrintJobInstructionsConfirm other = (PrintJobInstructionsConfirm)obj;
if (errorMsg == null)
{
if (other.errorMsg != null)
return false;
}
else if (!errorMsg.equals(other.errorMsg))
return false;
if (printJobInst... | repos\metasfresh-new_dawn_uat\backend\de.metas.printing.common\de.metas.printing.api\src\main\java\de\metas\printing\esb\api\PrintJobInstructionsConfirm.java | 1 |
请完成以下Java代码 | public Config setOutputFile(String outputFile)
{
this.outputFile = outputFile;
return this;
}
public String getOutputFile()
{
return outputFile;
}
public Config setIter(int iter)
{
this.iter = iter;
return this;
}
public int getIter()
{
... | public Config setUseContinuousBagOfWords(boolean cbow)
{
this.cbow = cbow;
return this;
}
public boolean useContinuousBagOfWords()
{
return cbow;
}
public Config setSample(float sample)
{
this.sample = sample;
return this;
}
public float get... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\Config.java | 1 |
请完成以下Java代码 | public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Comment/Help.
@param Help
Comment or Hint
*/
public void setHelp (String Help)
{
set_Value (COLUMNNAME_Help, Help);
}
/** Get Comment/Help.
@return Comment or Hint
*/
public String getHelp ()
{
... | }
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Container_Element.java | 1 |
请完成以下Java代码 | public void setDecisionDefinitionKeyIn(String[] decisionDefinitionKeyIn) {
this.decisionDefinitionKeyIn = decisionDefinitionKeyIn;
}
@CamundaQueryParam(value = "tenantIdIn", converter = StringArrayConverter.class)
public void setTenantIdIn(String[] tenantIdIn) {
this.tenantIdIn = tenantIdIn;
}
@Camu... | protected void applyFilters(CleanableHistoricDecisionInstanceReport query) {
if (decisionDefinitionIdIn != null && decisionDefinitionIdIn.length > 0) {
query.decisionDefinitionIdIn(decisionDefinitionIdIn);
}
if (decisionDefinitionKeyIn != null && decisionDefinitionKeyIn.length > 0) {
query.decis... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\CleanableHistoricDecisionInstanceReportDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ExternalSystemRabbitMQConfig implements IExternalSystemChildConfig
{
@NonNull
ExternalSystemRabbitMQConfigId id;
@NonNull
ExternalSystemParentConfigId parentId;
@NonNull
String value;
@NonNull
String routingKey;
@NonNull
String remoteUrl;
@NonNull
String authToken;
boolean isSyncBPartner... | boolean isSyncExternalReferencesToRabbitMQ;
@NonNull
public static ExternalSystemRabbitMQConfig cast(@NonNull final IExternalSystemChildConfig childCondig)
{
return (ExternalSystemRabbitMQConfig)childCondig;
}
public boolean isAutoSendSubjectWhenCreatedByUserGroup()
{
return isAutoSendWhenCreatedByUserGroup... | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\rabbitmqhttp\ExternalSystemRabbitMQConfig.java | 2 |
请完成以下Java代码 | public synchronized void setRtAndSuccessQps(double avgRt, Long successQps) {
this.rt = avgRt * successQps;
this.successQps = successQps;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getGmtCreate() {
retur... | return rt;
}
public void setRt(double rt) {
this.rt = rt;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getResourceCode() {
return resourceCode;
}
public Long getSuccessQps() {
... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\datasource\entity\MetricEntity.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public LocalStorage create(String name, MultipartFile multipartFile) {
FileUtil.checkSize(properties.getMaxSize(), multipartFile.getSize());
String suffix = FileUtil.getExtensionName(multipartFile.getOriginalFilename());
String type = FileUtil.getFileType(suffix);
File file = FileUtil.up... | }
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteAll(Long[] ids) {
for (Long id : ids) {
LocalStorage storage = localStorageRepository.findById(id).orElseGet(LocalStorage::new);
FileUtil.del(storage.getPath());
localStorageRepository.de... | repos\eladmin-master\eladmin-tools\src\main\java\me\zhengjie\service\impl\LocalStorageServiceImpl.java | 2 |
请完成以下Java代码 | public void turnOnPc() {
System.out.println("Computer turned on");
}
public void turnOffPc() {
System.out.println("Computer turned off");
}
public Double calculateValue(Double initialValue) {
return initialValue / 1.50;
}
@Override
public String toString() {
... | }
final Computer computer = (Computer) o;
return (age != null ? age.equals(computer.age) : computer.age == null) && (color != null ? color.equals(computer.color) : computer.color == null);
}
@Override
public int hashCode() {
int result = age != null ? age.hashCode() : 0;
... | repos\tutorials-master\core-java-modules\core-java-lambdas-2\src\main\java\com\baeldung\doublecolon\Computer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private PickingJob getPickingJob()
{
return pickingJobSupplier.get();
}
private PickingJob retrievePickingJob()
{
@NonNull final PickingJob pickingJob = pickingJobService.getById(pickingJobId);
pickingJob.assertCanBeEditedBy(callerId);
return pickingJob;
}
@Nullable
private Quantity allocateLine(Pickin... | @Nullable
private ProductAvailableStocks computeAvailableStocks()
{
final Workplace workplace = warehouseService.getWorkplaceByUserId(callerId).orElse(null);
if (workplace == null) {return null;}
final ProductAvailableStocks availableStocks = huService.newAvailableStocksProvider(workplace);
if (availableStoc... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\get_qty_available\PickingJobGetQtyAvailableCommand.java | 2 |
请完成以下Java代码 | public void setCopying(final boolean copying) {setDynAttribute(DYNATTR_IsCopyWithDetailsInProgress, copying ? Boolean.TRUE : null);}
public boolean isCopiedFromOtherRecord() {return getDynAttribute(DYNATTR_CopiedFromRecordId) != null;}
public void setCopiedFromRecordId(final int fromRecordId) {setDynAttribute(DYNAT... | public boolean hasColumnNames()
{
return !columnNames.isEmpty();
}
@Override
public void process(final ResultSet rs) throws SQLException
{
for (final String columnName : columnNames)
{
final Object value = rs.getObject(columnName);
// NOTE: it is also setting the ID if applies
set_ValueN... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\PO.java | 1 |
请完成以下Java代码 | public void insertEditorSourceExtraForModel(String modelId, byte[] modelSource) {
ModelEntity model = findModelById(modelId);
if (model != null) {
ByteArrayRef ref = new ByteArrayRef(model.getEditorSourceExtraValueId());
ref.setValue("source-extra", modelSource);
if ... | if (model == null || model.getEditorSourceValueId() == null) {
return null;
}
ByteArrayRef ref = new ByteArrayRef(model.getEditorSourceValueId());
return ref.getBytes();
}
public byte[] findEditorSourceExtraByModelId(String modelId) {
ModelEntity model = findModelBy... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ModelEntityManager.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void importBPartner(final SyncBPartner syncBpartner)
{
//
// Import the BPartner only
final BPartner bpartner = importBPartnerNoCascade(syncBpartner);
if (bpartner == null)
{
return;
}
//
// Users
usersImportService.importUsers(bpartner, syncBpartner.getUsers());
//
// Contracts
if ... | private BPartner importBPartnerNoCascade(final SyncBPartner syncBpartner)
{
//
// BPartner
BPartner bpartner = bpartnersRepo.findByUuid(syncBpartner.getUuid());
//
// Handle delete request
if (syncBpartner.isDeleted())
{
if (bpartner != null)
{
deleteBPartner(bpartner);
}
return bpartner... | repos\metasfresh-new_dawn_uat\misc\services\procurement-webui\procurement-webui-backend\src\main\java\de\metas\procurement\webui\sync\SyncBPartnerImportService.java | 2 |
请完成以下Java代码 | public String toString()
{
final StringBuilder sb = new StringBuilder("MInventoryLine[");
sb.append(get_ID())
.append("-M_Product_ID=").append(getM_Product_ID())
.append(",QtyCount=").append(getQtyCount())
.append(",QtyInternalUse=").append(getQtyInternalUse())
.append(",QtyBook=").append(getQtyBoo... | }
//
if (getC_Charge_ID() <= 0)
{
inventoryBL.setDefaultInternalChargeId(this);
}
}
else if (INVENTORYTYPE_ChargeAccount.equals(getInventoryType()))
{
if (getC_Charge_ID() <= 0)
{
throw new FillMandatoryException(COLUMNNAME_C_Charge_ID);
}
}
else if (getC_Charge_ID() > 0)
{
s... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MInventoryLine.java | 1 |
请完成以下Java代码 | public BigDecimal getOpenAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_OpenAmt);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boo... | Integer ii = (Integer)get_Value(COLUMNNAME_TimesDunned);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Total Amount.
@param TotalAmt
Total Amount
*/
public void setTotalAmt (BigDecimal TotalAmt)
{
set_Value (COLUMNNAME_TotalAmt, TotalAmt);
}
/** Get Total Amount.
@return Total Am... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_DunningRunLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringbootBeatlsqlApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootBeatlsqlApplication.class, args);
}
//配置文件
@Bean(initMethod = "init", name = "beetlConfig")
public BeetlGroupUtilConfiguration getBeetlGroupUtilConfiguration() {
BeetlGroupUtilConfiguration b... | conf.setBasePackage("com.forezp.dao");
conf.setDaoSuffix("Dao");
conf.setSqlManagerFactoryBeanName("sqlManagerFactoryBean");
return conf;
}
@Bean(name = "sqlManagerFactoryBean")
@Primary
public SqlManagerFactoryBean getSqlManagerFactoryBean(@Qualifier("datasource") DataSource datasource) {
SqlManagerFactor... | repos\SpringBootLearning-master\springboot-beatlsql\src\main\java\com\forezp\SpringbootBeatlsqlApplication.java | 2 |
请完成以下Java代码 | protected List<RelatedProcessDescriptor> getRelatedProcessDescriptors()
{
return ImmutableList.of(
createProcessDescriptor(WEBUI_ProductsProposal_SaveProductPriceToCurrentPriceListVersion.class),
createProcessDescriptor(WEBUI_ProductsProposal_ShowProductsToAddFromBasePriceList.class),
createProcessDescri... | if (view.getOrderId() != null)
{
createOrderLines(view);
}
}
}
private void createOrderLines(final ProductsProposalView view)
{
OrderLinesFromProductProposalsProducer.builder()
.orderId(view.getOrderId().get())
.rows(view.getAllRows())
.build()
.produce();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\order\products_proposal\view\OrderProductsProposalViewFactory.java | 1 |
请完成以下Java代码 | public Double calculateValue(Double initialValue) {
return initialValue / 1.50;
}
@Override
public String toString() {
return "Computer{" + "age=" + age + ", color='" + color + '\'' + ", healty=" + healty + '}';
}
@Override
public boolean equals(final Object o) {
if (th... | }
final Computer computer = (Computer) o;
return (age != null ? age.equals(computer.age) : computer.age == null) && (color != null ? color.equals(computer.color) : computer.color == null);
}
@Override
public int hashCode() {
int result = age != null ? age.hashCode() : 0;
... | repos\tutorials-master\core-java-modules\core-java-lambdas-2\src\main\java\com\baeldung\doublecolon\Computer.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DataResponse<BatchResponse> getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams) {
BatchQuery query = managementService.createBatchQuery();
if (allRequestParams.containsKey("id")) {
query.batchId(allRequestParams.get("id"));
}
if (al... | if (allRequestParams.containsKey("status")) {
query.status(allRequestParams.get("status"));
}
if (allRequestParams.containsKey("tenantId")) {
query.tenantId(allRequestParams.get("tenantId"));
}
if (allRequestParams.containsKey("tenantIdLike")) {
query.... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\management\BatchCollectionResource.java | 2 |
请完成以下Java代码 | public String getIp() {
return ip;
}
public ClusterClientModifyRequest setIp(String ip) {
this.ip = ip;
return this;
}
@Override
public Integer getPort() {
return port;
}
public ClusterClientModifyRequest setPort(Integer port) {
this.port = port;
... | }
public ClusterClientModifyRequest setMode(Integer mode) {
this.mode = mode;
return this;
}
public ClusterClientConfig getClientConfig() {
return clientConfig;
}
public ClusterClientModifyRequest setClientConfig(
ClusterClientConfig clientConfig) {
this.cl... | repos\spring-boot-student-master\spring-boot-student-sentinel-dashboard\src\main\java\com\alibaba\csp\sentinel\dashboard\domain\cluster\request\ClusterClientModifyRequest.java | 1 |
请完成以下Java代码 | public void setName(String name) {
this.name = name;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Boolean getLocked() {
return locked;
}
public void setLocked(Boolean locked) { | this.locked = locked;
}
@PrePersist
public void prePersist() {
if (name == null) {
name = "John Snow";
}
if (age == null) {
age = 25;
}
if (locked == null) {
locked = false;
}
}
} | repos\tutorials-master\persistence-modules\java-jpa\src\main\java\com\baeldung\jpa\defaultvalues\UserEntity.java | 1 |
请完成以下Java代码 | public void checkCompleteContractsForWinners(final I_C_RfQResponse rfqResponse)
{
final IPMM_RfQ_DAO pmmRfqDAO = Services.get(IPMM_RfQ_DAO.class);
for (final I_C_RfQResponseLine rfqResponseLine : pmmRfqDAO.retrieveResponseLines(rfqResponse))
{
checkCompleteContractIfWinner(rfqResponseLine);
}
}
@Override... | final IDocumentBL docActionBL = Services.get(IDocumentBL.class);
if (docActionBL.issDocumentDraftedOrInProgress(contract))
{
final IFlatrateBL flatrateBL = Services.get(IFlatrateBL.class);
flatrateBL.complete(contract);
}
else if (docActionBL.isDocumentCompleted(contract))
{
// already completed => n... | repos\metasfresh-new_dawn_uat\backend\de.metas.procurement.base\src\main\java\de\metas\procurement\base\impl\PMM_RfQ_BL.java | 1 |
请完成以下Java代码 | public void setNbOfNtries(String value) {
this.nbOfNtries = value;
}
/**
* Gets the value of the sum property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getSum() {
return sum;
}
/**
* Sets the... | /**
* Gets the value of the cdtDbtInd property.
*
* @return
* possible object is
* {@link CreditDebitCode }
*
*/
public CreditDebitCode getCdtDbtInd() {
return cdtDbtInd;
}
/**
* Sets the value of the cdtDbtInd property.
*
* @param va... | 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\NumberAndSumOfTransactions2.java | 1 |
请完成以下Java代码 | public int getM_HU_Item_Storage_ID()
{
return get_ValueAsInt(COLUMNNAME_M_HU_Item_Storage_ID);
}
@Override
public void setM_Product_ID (final int M_Product_ID)
{
if (M_Product_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Product_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Product_ID, M_Product_ID);
}... | return get_ValueAsInt(COLUMNNAME_M_Product_ID);
}
@Override
public void setQty (final BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
@Override
public BigDecimal getQty()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty);
return bd != null ? bd : BigDecimal.ZERO;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Item_Storage.java | 1 |
请完成以下Java代码 | public void setIMP_ProcessorParameter_ID (int IMP_ProcessorParameter_ID)
{
if (IMP_ProcessorParameter_ID < 1)
set_ValueNoCheck (COLUMNNAME_IMP_ProcessorParameter_ID, null);
else
set_ValueNoCheck (COLUMNNAME_IMP_ProcessorParameter_ID, Integer.valueOf(IMP_ProcessorParameter_ID));
}
/** Get Import Processo... | @return Parameter Value */
public String getParameterValue ()
{
return (String)get_Value(COLUMNNAME_ParameterValue);
}
/** Set Search Key.
@param Value
Search key for the record in the format required - must be unique
*/
public void setValue (String Value)
{
set_Value (COLUMNNAME_Value, Value);
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_IMP_ProcessorParameter.java | 1 |
请完成以下Java代码 | private boolean isValidLineToExport(final InOutAndLineId inoutAndLineId)
{
final IInOutDAO inOutDAO = Services.get(IInOutDAO.class);
final InOutLineId inOutLineId = inoutAndLineId.getInOutLineId();
final I_M_InOutLine shipmentLineRecord = inOutDAO.getLineByIdOutOfTrx(inOutLineId, I_M_InOutLine.class);
if (s... | final IInOutDAO inOutDAO = Services.get(IInOutDAO.class);
final I_M_InOut shipment = inOutDAO.getById(shipmentId);
if (!shipment.isSOTrx())
{
return false;
}
if (inOutBL.isReversal(shipment))
{
return false;
}
final DocStatus shipmentDocStatus = DocStatus.ofCode(shipment.getDocStatus());
if ... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\customs\process\ShipmentLinesForCustomsInvoiceRepo.java | 1 |
请完成以下Java代码 | public void setPassword (java.lang.String Password)
{
set_Value (COLUMNNAME_Password, Password);
}
/** Get Kennwort.
@return Kennwort */
@Override
public java.lang.String getPassword ()
{
return (java.lang.String)get_Value(COLUMNNAME_Password);
}
/** Set Nutzerkennung.
@param UserID Nutzerkennung ... | * Reference name: MSV3_Version
*/
public static final int VERSION_AD_Reference_ID=540904;
/** 1 = 1 */
public static final String VERSION_1 = "1";
/** 2 = 2 */
public static final String VERSION_2 = "2";
/** Set Version.
@param Version
Version of the table definition
*/
@Override
public void setVersio... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.vendor.gateway.msv3\src\main\java-gen\de\metas\vertical\pharma\vendor\gateway\msv3\model\X_MSV3_Vendor_Config.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getRsaPrivateKey() {
return rsaPrivateKey;
}
public void setRsaPrivateKey(String rsaPrivateKey) {
this.rsaPrivateKey = rsaPrivateKey;
}
public String getRsaPublicKey() {
return rsaPublicKey;
}
public void setRsaPublicKey(String rsaPublicKey) {
this.rsaPublicKey = rsaPublicKey;
}
public... | return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId == null ? null : merchantId.trim();
}
public String getAppType() {
return appType;
}
public void setAppType(String appType) {
this.appType = appType == null ? null : appTyp... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\user\entity\RpUserPayInfo.java | 2 |
请完成以下Java代码 | public final class NullHUIteratorListener implements IHUIteratorListener
{
public static final NullHUIteratorListener instance = new NullHUIteratorListener();
private final Result defaultResult = Result.CONTINUE;
private NullHUIteratorListener()
{
super();
}
@Override
public void setHUIterator(final IHUIter... | }
@Override
public Result beforeHUItem(final IMutable<I_M_HU_Item> item)
{
return defaultResult;
}
@Override
public Result afterHUItem(final I_M_HU_Item item)
{
return defaultResult;
}
@Override
public Result beforeHUItemStorage(final IMutable<IHUItemStorage> itemStorage)
{
return defaultResult;
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\NullHUIteratorListener.java | 1 |
请完成以下Java代码 | public Builder addTotalNetAmt(final BigDecimal amtToAdd, final boolean approved, final boolean isPackingMaterial)
{
if (approved)
{
totalNetAmtApproved = totalNetAmtApproved.add(amtToAdd);
if (isPackingMaterial)
{
huNetAmtApproved = huNetAmtApproved.add(amtToAdd);
}
else
{
cuNe... | // NOTE: prevent adding null values because ImmutableSet.Builder will fail in this case
currencySymbols.add("?");
}
else
{
currencySymbols.add(currencySymbol);
}
return this;
}
public void addCountToRecompute(final int countToRecomputeToAdd)
{
Check.assume(countToRecomputeToAdd > 0, "co... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\api\impl\InvoiceCandidatesAmtSelectionSummary.java | 1 |
请完成以下Java代码 | public void setHelp (String Help)
{
set_Value (COLUMNNAME_Help, Help);
}
/** Get Comment/Help.
@return Comment or Hint
*/
public String getHelp ()
{
return (String)get_Value(COLUMNNAME_Help);
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Nam... | return Env.ZERO;
return bd;
}
/** RemunerationType AD_Reference_ID=346 */
public static final int REMUNERATIONTYPE_AD_Reference_ID=346;
/** Hourly = H */
public static final String REMUNERATIONTYPE_Hourly = "H";
/** Daily = D */
public static final String REMUNERATIONTYPE_Daily = "D";
/** Weekly = W */
publ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Remuneration.java | 1 |
请完成以下Java代码 | public void setRecord_ID (final int Record_ID)
{
if (Record_ID < 0)
set_ValueNoCheck (COLUMNNAME_Record_ID, null);
else
set_ValueNoCheck (COLUMNNAME_Record_ID, Record_ID);
}
@Override
public int getRecord_ID()
{
return get_ValueAsInt(COLUMNNAME_Record_ID);
}
@Override
public void setSEPA_Export... | return get_ValueAsInt(COLUMNNAME_SEPA_Export_Line_ID);
}
@Override
public void setSEPA_Export_Line_Ref_ID (final int SEPA_Export_Line_Ref_ID)
{
if (SEPA_Export_Line_Ref_ID < 1)
set_ValueNoCheck (COLUMNNAME_SEPA_Export_Line_Ref_ID, null);
else
set_ValueNoCheck (COLUMNNAME_SEPA_Export_Line_Ref_ID, SEPA_E... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.sepa\base\src\main\java-gen\de\metas\payment\sepa\model\X_SEPA_Export_Line_Ref.java | 1 |
请完成以下Java代码 | public int getRecord_ID()
{
return io.get_ID();
}
@Override
public EMail sendEMail(I_AD_User from, String toEmail, String subject, final BoilerPlateContext attributes)
{
final BoilerPlateContext attributesEffective = attributes.toBuilder()
.setSourceDocumentFromObject(io)
.build();
... | return "";
}
private void send(EMail email)
{
int maxRetries = p_SMTPRetriesNo > 0 ? p_SMTPRetriesNo : 0;
int count = 0;
do
{
final EMailSentStatus emailSentStatus = email.send();
count++;
if (emailSentStatus.isSentOK())
{
return;
}
// Timeout => retry
if (emailSentStatus.isSentConn... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\shipping\model\validator\ShipperTransportationMailNotification.java | 1 |
请完成以下Java代码 | public FeelConvertException unableToConvertValue(String feelExpression, FeelConvertException cause) {
Object value = cause.getValue();
Class<?> type = cause.getType();
return new FeelConvertException(exceptionMessage(
"015",
"Unable to convert value '{}' of type '{}' to type '{}' in expression '... | String method = cause.getMethod();
String[] parameters = cause.getParameters();
return new FeelMethodInvocationException(exceptionMessage(
"019",
"Unable to invoke method '{}' with parameters '{}' in expression '{}'", method, parameters, simpleUnaryTests),
cause.getCause(), method, parameters
... | repos\camunda-bpm-platform-master\engine-dmn\feel-juel\src\main\java\org\camunda\bpm\dmn\feel\impl\juel\FeelEngineLogger.java | 1 |
请完成以下Java代码 | public void enqueueId(@NonNull final DDOrderCandidateId id)
{
enqueueIds(ImmutableSet.of(id));
}
public void enqueueIds(@NonNull final Collection<DDOrderCandidateId> ids)
{
if (ids.isEmpty())
{
return;
}
final PInstanceId selectionId = ddOrderCandidateRepository.createSelection(ids);
enqueueSelecti... | private static String toJsonString(@NonNull final DDOrderCandidateEnqueueRequest request)
{
try
{
return JsonObjectMapperHolder.sharedJsonObjectMapper().writeValueAsString(request);
}
catch (final JsonProcessingException e)
{
throw new AdempiereException("Cannot convert to json: " + request, e);
}
}... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\de\metas\distribution\ddordercandidate\async\DDOrderCandidateEnqueueService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class EntityDescription implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String description;
@Any(
metaDef = "EntityDescriptionMetaDef",
metaColumn = @Column(name = "entity_type")
)
@JoinColumn(nam... | public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Serializable getEntity() {
return entity;
}
public void setEntity(Serializable entity) {
this.entity = entity;
}... | repos\tutorials-master\persistence-modules\hibernate5\src\main\java\com\baeldung\hibernate\pojo\EntityDescription.java | 2 |
请完成以下Java代码 | public class EndEventXMLConverter extends BaseBpmnXMLConverter {
protected Map<String, BaseChildElementParser> childParserMap = new HashMap<>();
public EndEventXMLConverter() {
OutParameterParser outParameterParser = new OutParameterParser();
childParserMap.put(outParameterParser.getElementNam... | }
@Override
protected boolean writeExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
EndEvent endEvent = (EndEvent) element;
didWriteExtensionStartElement = BpmnXMLUtil.writeIOParameters(ELEMENT_OUT_PARAMETERS, endEvent.ge... | repos\flowable-engine-main\modules\flowable-bpmn-converter\src\main\java\org\flowable\bpmn\converter\EndEventXMLConverter.java | 1 |
请完成以下Java代码 | public void setTimestamp (final @Nullable java.sql.Timestamp Timestamp)
{
set_Value (COLUMNNAME_Timestamp, Timestamp);
}
@Override
public java.sql.Timestamp getTimestamp()
{
return get_ValueAsTimestamp(COLUMNNAME_Timestamp);
}
/**
* Title AD_Reference_ID=541318
* Reference name: Title_List
*/
publ... | public static final String TITLE_ProfDrDr = "8";
/** Prof. = 9 */
public static final String TITLE_Prof = "9";
/** Prof. Dr. med. = 10 */
public static final String TITLE_ProfDrMed = "10";
/** Rechtsanwalt = 11 */
public static final String TITLE_Rechtsanwalt = "11";
/** Rechtsanwältin = 12 */
public static fin... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.healthcare.alberta\src\main\java-gen\de\metas\vertical\healthcare\alberta\model\X_AD_User_Alberta.java | 1 |
请完成以下Java代码 | protected String getTaskFormMediaType(String taskId) {
Task task = engine.getTaskService().createTaskQuery().initializeFormKeys().taskId(taskId).singleResult();
ensureNotNull("No task found for taskId '" + taskId + "'", "task", task);
String formKey = task.getFormKey();
if(formKey != null) {
retur... | } catch (Exception e) {
throw e;
} finally {
identityService.setAuthentication(currentAuthentication);
}
}
private Map<String, VariableValueDto> getTaskVariables(boolean withTaskVariablesInReturn) {
VariableResource variableResource;
if (withTaskVariablesInReturn) {
variableResour... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\sub\task\impl\TaskResourceImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public RouteDefinitionMetrics routeDefinitionMetrics(MeterRegistry meterRegistry,
RouteDefinitionLocator routeDefinitionLocator, GatewayMetricsProperties properties) {
return new RouteDefinitionMetrics(meterRegistry, routeDefinitionLocator, properties.getPrefix());
}
@Configuration(proxyBeanMethods = false)
@C... | }
@Bean
@ConditionalOnMissingBean
ObservedResponseHttpHeadersFilter observedResponseHttpHeadersFilter() {
return new ObservedResponseHttpHeadersFilter();
}
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
ObservationClosingWebExceptionHandler observationClosingWebExceptionHandler() {
return new Observatio... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\config\GatewayMetricsAutoConfiguration.java | 2 |
请完成以下Java代码 | public ServletRequest getRequest() {
return this.asyncContext.getRequest();
}
@Override
public ServletResponse getResponse() {
return this.asyncContext.getResponse();
}
@Override
public boolean hasOriginalRequestAndResponse() {
return this.asyncContext.hasOriginalRequestAndResponse();
}
@Ove... | this.asyncContext.addListener(listener);
}
@Override
public void addListener(AsyncListener listener, ServletRequest request, ServletResponse response) {
this.asyncContext.addListener(listener, request, response);
}
@Override
public <T extends AsyncListener> T createListener(Class<T> clazz) throws Servl... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\servletapi\HttpServlet3RequestFactory.java | 1 |
请完成以下Java代码 | public TimerJobQuery orderByJobDuedate() {
return orderBy(JobQueryProperty.DUEDATE);
}
@Override
public TimerJobQuery orderByExecutionId() {
return orderBy(JobQueryProperty.EXECUTION_ID);
}
@Override
public TimerJobQuery orderByJobId() {
return orderBy(JobQueryProperty.... | public String getExecutionId() {
return executionId;
}
public boolean getExecutable() {
return executable;
}
public Date getNow() {
return Context.getProcessEngineConfiguration().getClock().getCurrentTime();
}
public boolean isWithException() {
return withExcep... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\TimerJobQueryImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class PickAttributesConfig
{
@NonNull public static final PickAttributesConfig UNKNOWN = builder().build();
@NonNull public static final PickAttributesConfig DEFAULT = builder()
.attributeToRead(PickAttribute.BestBeforeDate, true)
.attributeToRead(PickAttribute.LotNo, true)
.build();
@NonNull Immuta... | .filter(Map.Entry::getValue)
.map(Map.Entry::getKey)
.collect(ImmutableSet.toImmutableSet());
}
public PickAttributesConfig fallbackTo(final @NonNull PickAttributesConfig fallback)
{
return builder()
.attributesToRead(CollectionUtils.mergeMaps(fallback.attributesToRead, this.attributesToRead))
.bu... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\config\mobileui\PickAttributesConfig.java | 2 |
请完成以下Java代码 | public class EnumFormType extends AbstractFormType {
private static final long serialVersionUID = 1L;
protected Map<String, String> values;
public EnumFormType(Map<String, String> values) {
this.values = values;
}
@Override
public String getName() {
return "enum";
}
... | if (modelValue != null) {
if (!(modelValue instanceof String)) {
throw new FlowableIllegalArgumentException("Model value should be a String");
}
validateValue((String) modelValue);
}
return (String) modelValue;
}
protected void validateValue(S... | repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\form\EnumFormType.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class CandidateId implements RepoIdAware
{
/**
* Use this constant in a {@link CandidatesQuery} to indicate that the ID shall not be considered.
*/
public static final CandidateId UNSPECIFIED = new CandidateId(IdConstants.UNSPECIFIED_REPO_ID);
/**
* Use this constant in a {@link CandidatesQuery} to ind... | else
{
return String.valueOf(repoId);
}
}
@Override
@JsonValue
public int getRepoId()
{
if (isUnspecified())
{
throw Check.mkEx("Illegal call of getRepoId() on the unspecified CandidateId instance");
}
else if (isNull())
{
return -1;
}
else
{
return repoId;
}
}
public boolean ... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\candidate\CandidateId.java | 2 |
请完成以下Java代码 | public class Demo {
@Contract("_ -> new")
Person fromName(String name) {
return new Person().withName(name);
}
@Contract(" -> fail")
void alwaysFail() {
throw new RuntimeException();
}
@Contract(" -> fail")
void doNothingWithWrongContract() {
}
@Contract("_, ... | return "";
}
@Contract("_ -> true")
void contractExpectsWrongReturnType(String s) {
}
// NB: the following examples demonstrate how to use the mutates attribute of the annotation
// This attribute is currently experimental and could be changed or removed in the future
@Contract(mutates = ... | repos\tutorials-master\jetbrains-annotations\src\main\java\com\baeldung\annotations\Demo.java | 1 |
请完成以下Java代码 | public int getAD_WF_Node_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_WF_Node_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Workflow Node Asset.
@param PP_WF_Node_Asset_ID Workflow Node Asset */
public void setPP_WF_Node_Asset_ID (int PP_WF_Node_Asset_ID)
{
if (PP_WF_Nod... | */
public void setSeqNo (int SeqNo)
{
set_ValueNoCheck (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
/** Get Sequence.
@return Method of ordering records; lowest number comes first
*/
public int getSeqNo ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo);
if (ii == null)
return 0;
return ii... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\eevolution\model\X_PP_WF_Node_Asset.java | 1 |
请完成以下Java代码 | protected void configure(HttpSecurity http) throws Exception {
http.addFilterBefore(validateCodeFilter, UsernamePasswordAuthenticationFilter.class) // 添加验证码校验过滤器
.addFilterBefore(smsCodeFilter,UsernamePasswordAuthenticationFilter.class) // 添加短信验证码校验过滤器
.formLogin() // 表单登录
... | .sessionManagement() // 添加 Session管理器
.invalidSessionUrl("/session/invalid") // Session失效后跳转到这个链接
.maximumSessions(1)
.maxSessionsPreventsLogin(true)
.expiredSessionStrategy(sessionExpiredStrategy)
.and()
.an... | repos\SpringAll-master\60.Spring-Security-Logout\src\main\java\cc\mrbird\security\browser\BrowserSecurityConfig.java | 1 |
请完成以下Java代码 | public void error(Marker marker, String msg) {
logger.error(marker, mdcValue(msg));
}
@Override
public void error(Marker marker, String format, Object arg) {
logger.error(marker, mdcValue(format), arg);
}
@Override
public void error(Marker marker, String format, Object arg1, Ob... | * @return
*/
private String mdcValue(String msg) {
try {
StringBuilder sb = new StringBuilder();
sb.append(" [");
try {
sb.append(MDC.get(MdcConstant.SESSION_KEY) + ", ");
} catch (IllegalArgumentException e) {
sb.append(" ... | repos\spring-boot-student-master\spring-boot-student-log\src\main\java\com\xiaolyuh\core\TrackLogger.java | 1 |
请完成以下Java代码 | public IHUAssignmentBuilder setTopLevelHU(final I_M_HU topLevelHU)
{
this.topLevelHU = topLevelHU;
return this;
}
@Override
public IHUAssignmentBuilder setM_LU_HU(final I_M_HU luHU)
{
this.luHU = luHU;
return this;
}
@Override
public IHUAssignmentBuilder setM_TU_HU(final I_M_HU tuHU)
{
this.tuHU = ... | this.assignment = newInstance(I_M_HU_Assignment.class);
return updateFromRecord(assignmentRecord);
}
@Override
public IHUAssignmentBuilder setAssignmentRecordToUpdate(@NonNull final I_M_HU_Assignment assignmentRecord)
{
this.assignment = assignmentRecord;
return updateFromRecord(assignmentRecord);
}
priv... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\impl\HUAssignmentBuilder.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public static class ApacheShiroProperties {
private String iniResourcePath;
public String getIniResourcePath() {
return this.iniResourcePath;
}
public void setIniResourceP... | public static class SecurityManagerProperties {
private String className;
public String getClassName() {
return this.className;
}
public void setClassName(String className) {
this.className = className;
}
}
public static class SecurityPostProcessorProperties {
private String className;
publi... | repos\spring-boot-data-geode-main\spring-geode-project\spring-geode-autoconfigure\src\main\java\org\springframework\geode\boot\autoconfigure\configuration\support\SecurityProperties.java | 2 |
请完成以下Java代码 | public void setCM_AccessProfile_ID (int CM_AccessProfile_ID)
{
if (CM_AccessProfile_ID < 1)
set_ValueNoCheck (COLUMNNAME_CM_AccessProfile_ID, null);
else
set_ValueNoCheck (COLUMNNAME_CM_AccessProfile_ID, Integer.valueOf(CM_AccessProfile_ID));
}
/** Get Web Access Profile.
@return Web Access Profile
... | set_ValueNoCheck (COLUMNNAME_CM_NewsChannel_ID, null);
else
set_ValueNoCheck (COLUMNNAME_CM_NewsChannel_ID, Integer.valueOf(CM_NewsChannel_ID));
}
/** Get News Channel.
@return News channel for rss feed
*/
public int getCM_NewsChannel_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_CM_NewsChannel_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_AccessNewsChannel.java | 1 |
请在Spring Boot框架中完成以下Java代码 | class OAuth2ResourceServerOpaqueTokenConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnMissingBean(OpaqueTokenIntrospector.class)
static class OpaqueTokenIntrospectionClientConfiguration {
@Bean
@ConditionalOnProperty(name = "spring.security.oauth2.resourceserver.opaquetoken.introspection-... | }
@Configuration(proxyBeanMethods = false)
@ConditionalOnDefaultWebSecurity
static class OAuth2SecurityFilterChainConfiguration {
@Bean
@ConditionalOnBean(OpaqueTokenIntrospector.class)
SecurityFilterChain opaqueTokenSecurityFilterChain(HttpSecurity http) {
http.authorizeHttpRequests((requests) -> request... | repos\spring-boot-4.0.1\module\spring-boot-security-oauth2-resource-server\src\main\java\org\springframework\boot\security\oauth2\server\resource\autoconfigure\servlet\OAuth2ResourceServerOpaqueTokenConfiguration.java | 2 |
请完成以下Java代码 | public String getSummaryMessage()
{
final StringBuilder message = new StringBuilder();
message.append("@Netto@ (@ApprovalForInvoicing@): ");
final BigDecimal totalNetAmtApproved = getTotalNetAmtApproved();
message.append(getAmountFormatted(totalNetAmtApproved));
final BigDecimal huNetAmtApproved = getHUNet... | private String getAmountFormatted(final BigDecimal amt)
{
final DecimalFormat amountFormat = DisplayType.getNumberFormat(DisplayType.Amount);
final StringBuilder amountFormatted = new StringBuilder();
amountFormatted.append(amountFormat.format(amt));
final boolean isSameCurrency = currencySymbols.size() == 1... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\invoicecandidate\ui\spi\impl\HUInvoiceCandidatesSelectionSummaryInfo.java | 1 |
请完成以下Java代码 | public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof User)) {
return false;
}
User that = (User) obj;
return this.getName().equals(that.getName());
}
@Override | public int hashCode() {
int hashValue = 17;
hashValue = 37 * hashValue + getName().hashCode();
return hashValue;
}
@Override
public String toString() {
return getName();
}
}
} | repos\spring-boot-data-geode-main\spring-geode-project\apache-geode-extensions\src\main\java\org\springframework\geode\security\TestSecurityManager.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.