instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请在Spring Boot框架中完成以下Java代码 | public final class SecurityObservationSettings {
private final boolean observeRequests;
private final boolean observeAuthentications;
private final boolean observeAuthorizations;
private SecurityObservationSettings(boolean observeRequests, boolean observeAuthentications,
boolean observeAuthorizations) {
th... | this.observeRequests = observeRequests;
this.observeAuthentications = observeAuthentications;
this.observeAuthorizations = observeAuthorizations;
}
public Builder shouldObserveRequests(boolean excludeFilters) {
this.observeRequests = excludeFilters;
return this;
}
public Builder shouldObserveAuthe... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\observation\SecurityObservationSettings.java | 2 |
请完成以下Java代码 | public boolean isCanExport ()
{
Object oo = get_Value(COLUMNNAME_IsCanExport);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Kann Berichte erstellen.
@param IsCanReport
Users with this role can create... | @Override
public boolean isExclude ()
{
Object oo = get_Value(COLUMNNAME_IsExclude);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Schreibgeschützt.
@param IsReadOnly
Field is read only
*/
@Overr... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_Table_Access.java | 1 |
请完成以下Java代码 | private static boolean isEligible(@Nullable final I_PP_Order ppOrder)
{
if (ppOrder == null)
{
return false;
}
final DocStatus docStatus = DocStatus.ofNullableCodeOrUnknown(ppOrder.getDocStatus());
return docStatus.isDraftedOrInProgress();
}
@Override
protected String doIt()
{
final PPOrderId ppOr... | return MSG_OK;
}
private PPOrderId getPPOrderId(int ppOrderId)
{
return PPOrderId.ofRepoId(ppOrderId);
}
private OrderLineId getOrderLienId()
{
return OrderLineId.ofRepoId(p_C_OrderLine_ID);
}
private void setC_OrderLine_ID(@NonNull final PPOrderId ppOrderId, @NonNull final OrderLineId orderLineId)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\process\PP_Order_SetC_OrderLine.java | 1 |
请完成以下Java代码 | public Set<Map.Entry<String, Object>> entrySet() {
Set<Map.Entry<String, Object>> entries = new HashSet<>();
for (String key : inputVariableContainer.getVariableNames()) {
entries.add(Pair.of(key, inputVariableContainer.getVariable(key)));
}
return entries;
}
@Overri... | @Override
public void clear() {
throw new UnsupportedOperationException();
}
@Override
public boolean containsValue(Object value) {
throw new UnsupportedOperationException();
}
@Override
public boolean isEmpty() {
throw new UnsupportedOperationException();
}
... | repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\scripting\ScriptBindings.java | 1 |
请完成以下Java代码 | private ReportResult printLabel()
{
final AdProcessId adProcessId = getLabelConfig()
.get()
.getPrintFormatProcessId();
final PInstanceRequest pinstanceRequest = createPInstanceRequest(adProcessId);
final PInstanceId pinstanceId = adPInstanceDAO.createADPinstanceAndADPInstancePara(pinstanceRequest);
f... | }
private PInstanceRequest createPInstanceRequest(@NonNull final AdProcessId adProcessId)
{
return PInstanceRequest.builder()
.processId(adProcessId)
.processParams(ImmutableList.of(
ProcessInfoParameter.of("AD_PInstance_ID", getPinstanceId())))
.build();
}
private String buildFilename()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\process\WEBUI_M_HU_PrintFinishedGoodsLabel.java | 1 |
请完成以下Java代码 | public String getSpringBootVersion() {
return this.springBootVersion;
}
public StartupTimeline getTimeline() {
return this.timeline;
}
}
static class StartupEndpointRuntimeHints implements RuntimeHintsRegistrar {
private static final TypeReference DEFAULT_TAG = TypeReference
.of("org.springframew... | private static final TypeReference FLIGHT_RECORDER_STARTUP_STEP = TypeReference
.of("org.springframework.core.metrics.jfr.FlightRecorderStartupStep");
@Override
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.reflection()
.registerType(DEFAULT_TAG, (typeHint) -> t... | repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\startup\StartupEndpoint.java | 1 |
请完成以下Java代码 | public void validate(BpmnModel bpmnModel, List<ValidationError> errors) {
if (!bpmnModel.getLocationMap().isEmpty()) {
// Location map
for (String bpmnReference : bpmnModel.getLocationMap().keySet()) {
if (bpmnModel.getFlowElement(bpmnReference) == null) {
... | if (!bpmnModel.getFlowLocationMap().isEmpty()) {
// flowlocation map
for (String bpmnReference : bpmnModel.getFlowLocationMap().keySet()) {
if (bpmnModel.getFlowElement(bpmnReference) == null) {
// ACT-1625: don't warn when artifacts are referenced from
... | repos\flowable-engine-main\modules\flowable-process-validation\src\main\java\org\flowable\validation\validator\impl\DiagramInterchangeInfoValidator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | LdapContextSource ldapContextSource(LdapConnectionDetails connectionDetails, LdapProperties properties,
ObjectProvider<DirContextAuthenticationStrategy> dirContextAuthenticationStrategy) {
LdapContextSource source = new LdapContextSource();
dirContextAuthenticationStrategy.ifUnique(source::setAuthenticationStrat... | @ConditionalOnMissingBean(LdapOperations.class)
LdapTemplate ldapTemplate(LdapProperties properties, ContextSource contextSource,
ObjectDirectoryMapper objectDirectoryMapper) {
Template template = properties.getTemplate();
PropertyMapper propertyMapper = PropertyMapper.get();
LdapTemplate ldapTemplate = new L... | repos\spring-boot-4.0.1\module\spring-boot-ldap\src\main\java\org\springframework\boot\ldap\autoconfigure\LdapAutoConfiguration.java | 2 |
请完成以下Java代码 | Constraint teacherTimeEfficiency(ConstraintFactory constraintFactory) {
// A teacher prefers to teach sequential lessons and dislikes gaps between lessons.
return constraintFactory
.forEach(Lesson.class)
.join(Lesson.class, Joiners.equal(Lesson::getTeacher),
... | .join(Lesson.class,
Joiners.equal(Lesson::getSubject),
Joiners.equal(Lesson::getStudentGroup),
Joiners.equal((lesson) -> lesson.getTimeslot().getDayOfWeek()))
.filter((lesson1, lesson2) -> {
Duration between = Du... | repos\springboot-demo-master\Timefold Solver\src\main\java\org\acme\schooltimetabling\solver\TimetableConstraintProvider.java | 1 |
请完成以下Java代码 | public final class C_Order_CreateFromProposal extends C_Order_CreationProcess implements IProcessDefaultParametersProvider
{
private static final String PARAM_IsKeepProposalPrices = "IsKeepProposalPrices";
private static final String PARAM_DEFAULT_VALUE_YES = "Y";
private final IOrderBL orderBL = Services.get(IOrde... | @Override
public Object getParameterDefaultValue(@NonNull final IProcessDefaultParameter parameter)
{
if (PARAM_IsKeepProposalPrices.contentEquals(parameter.getColumnName()))
{
final I_C_Order proposal = orderBL.getById(OrderId.ofRepoId(getRecord_ID()));
if (docTypeBL.isSalesQuotation(DocTypeId.ofRepoId(pr... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\order\process\C_Order_CreateFromProposal.java | 1 |
请完成以下Java代码 | protected org.compiere.model.POInfo initPO(final Properties ctx)
{
return org.compiere.model.POInfo.getPOInfo(Table_Name);
}
@Override
public void setC_CostClassification_Category_ID (final int C_CostClassification_Category_ID)
{
if (C_CostClassification_Category_ID < 1)
set_Value (COLUMNNAME_C_CostClassi... | return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public void setName (final java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValue (final @Nullable java.lang.S... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_CostClassification.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setContent(String content) {
this.content = content;
}
public UserEntity getUserEntity() {
return userEntity;
}
public void setUserEntity(UserEntity userEntity) {
this.userEntity = userEntity;
}
public List<CommentEntity> getCommentEntityList() {
re... | public void setCommentEntityList(List<CommentEntity> commentEntityList) {
this.commentEntityList = commentEntityList;
}
@Override
public String toString() {
return "ArticleEntity{" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", content... | repos\SpringBoot-Dubbo-Docker-Jenkins-master\Gaoxi-Common-Service-Facade\src\main\java\com\gaoxi\entity\user\ArticleEntity.java | 2 |
请完成以下Java代码 | public String getDefaultThemeName() {
return defaultThemeName;
}
public void setDefaultThemeName(String defaultThemeName) {
this.defaultThemeName = defaultThemeName;
}
@Override
public String resolveThemeName(HttpServletRequest request) {
String themeName = findThemeFromReq... | private Optional<UserPreference> getUserPreference(Authentication authentication) {
return isAuthenticated(authentication) ? userPreferenceRepository.findById(((User) authentication.getPrincipal()).getUsername()) : Optional.empty();
}
private boolean isAuthenticated(Authentication authentication) {
... | repos\tutorials-master\spring-web-modules\spring-mvc-views\src\main\java\com\baeldung\themes\resolver\UserPreferenceThemeResolver.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Result upload(@RequestParam("file") MultipartFile multipartFile) {
Result result = new Result();
try {
ossFileService.upload(multipartFile);
result.success("上传成功!");
}
catch (Exception ex) {
log.info(ex.getMessage(), ex);
result.error500("上传失败");
}
return result;
}
@ResponseBody
@Dele... | */
@ResponseBody
@GetMapping("/queryById")
public Result<OssFile> queryById(@RequestParam(name = "id") String id) {
Result<OssFile> result = new Result<>();
OssFile file = ossFileService.getById(id);
if (file == null) {
result.error500("未找到对应实体");
}
else {
result.setResult(file);
result.setSuccess... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\oss\controller\OssFileController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public UserDetailsService userDetailService(DataSource dataSource) {
var user = User.withUsername("in28minutes")
//.password("{noop}dummy")
.password("dummy")
.passwordEncoder(str -> passwordEncoder().encode(str))
.roles("USER")
.build();
var admin = User.withUsername("admin")
//.password("... | return new RSAKey
.Builder((RSAPublicKey)keyPair.getPublic())
.privateKey(keyPair.getPrivate())
.keyID(UUID.randomUUID().toString())
.build();
}
@Bean
public JWKSource<SecurityContext> jwkSource(RSAKey rsaKey) {
var jwkSet = new JWKSet(rsaKey);
return (jwkSelector, context) -> jwkSelector.se... | repos\master-spring-and-spring-boot-main\71-spring-security\src\main\java\com\in28minutes\learnspringsecurity\jwt\JwtSecurityConfiguration.java | 2 |
请完成以下Java代码 | public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Product.
@return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)... | return bd;
}
public I_W_Basket getW_Basket() throws RuntimeException
{
return (I_W_Basket)MTable.get(getCtx(), I_W_Basket.Table_Name)
.getPO(getW_Basket_ID(), get_TrxName()); }
/** Set W_Basket_ID.
@param W_Basket_ID
Web Basket
*/
public void setW_Basket_ID (int W_Basket_ID)
{
if (W_Basket_ID ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_W_BasketLine.java | 1 |
请完成以下Java代码 | public class DeleteHistoricDecisionInstancesDto {
protected List<String> historicDecisionInstanceIds;
protected HistoricDecisionInstanceQueryDto historicDecisionInstanceQuery;
protected String deleteReason;
public List<String> getHistoricDecisionInstanceIds() {
return historicDecisionInstanceIds;
}
p... | return historicDecisionInstanceQuery;
}
public void setHistoricDecisionInstanceQuery(HistoricDecisionInstanceQueryDto historicDecisionInstanceQuery) {
this.historicDecisionInstanceQuery = historicDecisionInstanceQuery;
}
public String getDeleteReason() {
return deleteReason;
}
public void setDele... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\batch\DeleteHistoricDecisionInstancesDto.java | 1 |
请完成以下Java代码 | public List<Book> getBookList() {
return bookService.findAll();
}
/**
* 获取 Book
* 处理 "/book/{id}" 的 GET 请求,用来获取 Book 信息
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Book getBook(@PathVariable Long id) {
return bookService.findById(id);
}
... | /**
* 更新 Book
* 处理 "/update" 的 PUT 请求,用来更新 Book 信息
*/
@RequestMapping(value = "/update", method = RequestMethod.PUT)
public Book putBook(@RequestBody Book book) {
return bookService.update(book);
}
/**
* 删除 Book
* 处理 "/book/{id}" 的 GET 请求,用来删除 Book 信息
*/
@Reque... | repos\springboot-learning-example-master\chapter-3-spring-boot-web\src\main\java\demo\springboot\web\BookController.java | 1 |
请完成以下Java代码 | public void updateProductDocumentNote(final I_C_OrderLine orderLine)
{
orderLineBL.updateProductDocumentNote(orderLine);
}
@ModelChange(timings = { ModelValidator.TYPE_AFTER_NEW, ModelValidator.TYPE_AFTER_CHANGE },
ifColumnsChanged = { I_C_OrderLine.COLUMNNAME_IsGroupCompensationLine, I_C_OrderLine.COLUMNNAME_... | orderLineBL.updateLineNetAmtFromQtyEntered(orderLine);
}
}
@ModelChange(timings = { ModelValidator.TYPE_BEFORE_CHANGE }, //
ifColumnsChanged = { I_C_OrderLine.COLUMNNAME_IsWithoutCharge})
public void updatePriceToStd(final I_C_OrderLine orderLine)
{
if (!orderLine.isWithoutCharge())
{
orderLine.setPric... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\order\model\interceptor\C_OrderLine.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public DocOutboundConfig getByQuery(@NonNull final DocOutboundConfigQuery query)
{
return getDocOutboundConfigMap().getByQuery(query);
}
@NonNull
private DocOutboundConfigMap getDocOutboundConfigMap()
{
return cache.getOrLoadNonNull(0, this::retrieveDocOutboundConfigMap);
}
@NotNull
private DocOutboundCon... | {
return DocOutboundConfig.builder()
.id(DocOutboundConfigId.ofRepoId(record.getC_Doc_Outbound_Config_ID()))
.tableId(AdTableId.ofRepoId(record.getAD_Table_ID()))
.docBaseType(DocBaseType.ofNullableCode(record.getDocBaseType()))
.printFormatId(PrintFormatId.ofRepoIdOrNull(record.getAD_PrintFormat_ID()... | repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\config\DocOutboundConfigRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public String getTRANPORTTERMSCODE() {
return tranporttermscode;
}
/**
* Sets the value of the tranporttermscode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTRANPORTTERMSCODE(String value) {
this.tranp... | *
* @return
* possible object is
* {@link String }
*
*/
public String getLOCATIONNAME() {
return locationname;
}
/**
* Sets the value of the locationname property.
*
* @param value
* allowed object is
* {@link String }
* ... | 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\HTRSC1.java | 2 |
请完成以下Java代码 | public final class AuthorizationServerContextHolder {
private static final ThreadLocal<AuthorizationServerContext> holder = new ThreadLocal<>();
private AuthorizationServerContextHolder() {
}
/**
* Returns the {@link AuthorizationServerContext} bound to the current thread.
* @return the {@link AuthorizationS... | resetContext();
}
else {
holder.set(authorizationServerContext);
}
}
/**
* Reset the {@link AuthorizationServerContext} bound to the current thread.
*/
public static void resetContext() {
holder.remove();
}
} | repos\spring-security-main\oauth2\oauth2-authorization-server\src\main\java\org\springframework\security\oauth2\server\authorization\context\AuthorizationServerContextHolder.java | 1 |
请完成以下Java代码 | public final class ValueNamePairList
{
@JsonCreator
public static final ValueNamePairList of(@JsonProperty("l") final List<ValueNamePair> values)
{
if (values == null || values.isEmpty())
{
return EMPTY;
}
return new ValueNamePairList(values);
}
public static final ValueNamePairList of(final ValueNam... | public static final ValueNamePairList EMPTY = new ValueNamePairList(ImmutableList.<ValueNamePair> of());
@JsonProperty("l")
private final List<ValueNamePair> values;
private ValueNamePairList(final List<ValueNamePair> values)
{
super();
this.values = ImmutableList.copyOf(values);
}
public List<ValueNamePai... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\util\ValueNamePairList.java | 1 |
请完成以下Java代码 | public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
name_ = value;
onChanged();
return this;
}
/**
... | private static final com.google.protobuf.Descriptors.Descriptor internal_static_baeldung_Foo_descriptor;
private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_baeldung_Foo_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
... | repos\tutorials-master\spring-web-modules\spring-rest-simple\src\main\java\com\baeldung\web\dto\FooProtos.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public int hashCode()
{
return Objects.hash(lineItemId, quantity);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("class LineItemReference {\n");
sb.append(" lineItemId: ").append(toIndentedString(lineItemId)).append("\n");
sb.append(" quantity: ").append(... | /**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o)
{
if (o == null)
{
return "null";
}
return o.toString().replace("\n", "\n ");
}
} | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\de-metas-camel-ebay\ebay-api-client\src\main\java\de\metas\camel\externalsystems\ebay\api\model\LineItemReference.java | 2 |
请完成以下Java代码 | protected void suspendAcquisition(long millis) {
if (millis <= 0) {
return;
}
try {
LOG.debugJobAcquisitionThreadSleeping(millis);
synchronized (MONITOR) {
if(!isInterrupted) {
isWaiting.set(true);
MONITOR.wait(millis);
}
}
LOG.jobExecutorTh... | public void jobWasAdded() {
isJobAdded = true;
if(isWaiting.compareAndSet(true, false)) {
// ensures we only notify once
// I am OK with the race condition
synchronized (MONITOR) {
MONITOR.notifyAll();
}
}
}
protected void clearJobAddedNotification() {
isJobAdded = f... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\AcquireJobsRunnable.java | 1 |
请在Spring Boot框架中完成以下Java代码 | final class DefaultDocCopyHandler<HT, LT> implements IDocCopyHandler<HT, LT>
{
private final Class<HT> headerClass;
private final Class<LT> lineClass;
public DefaultDocCopyHandler(Class<HT> headerClass, Class<LT> lineClass)
{
this.headerClass = headerClass;
this.lineClass = lineClass;
}
@Override
public ... | // nothing should happen in the default handler
}
@Override
public IDocLineCopyHandler<LT> getDocLineCopyHandler()
{
return new DefaultDocLineCopyHandler<>(lineClass);
}
@Override
public Class<HT> getSupportedItemsClass()
{
return headerClass;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\invoice\service\impl\DefaultDocCopyHandler.java | 2 |
请完成以下Java代码 | private static @Nullable String getMetadataValue(Instance instance, String[] keys) {
Map<String, String> metadata = instance.getRegistration().getMetadata();
for (String key : keys) {
String value = metadata.get(key);
if (value != null) {
return value;
}
}
return null;
}
private static String ba... | /**
* user name for this instance
*/
@lombok.NonNull
private String userName;
/**
* user password for this instance
*/
@lombok.NonNull
private String userPassword;
}
} | repos\spring-boot-admin-master\spring-boot-admin-server\src\main\java\de\codecentric\boot\admin\server\web\client\BasicAuthHttpHeaderProvider.java | 1 |
请完成以下Java代码 | public void setValidationMessage(String validationMessage) {
this.validationMessage = validationMessage;
}
public Boolean isStrictMode() {
return strictMode;
}
public void setStrictMode(Boolean strictMode) {
this.strictMode = strictMode;
}
public Map<String, String> ge... | Map<String, Object> defensiveCopyMap = new HashMap<>();
if (inputVariables != null) {
for (Map.Entry<String, Object> entry : inputVariables.entrySet()) {
Object newValue = null;
if (entry.getValue() == null) {
// do nothing
} els... | repos\flowable-engine-main\modules\flowable-dmn-api\src\main\java\org\flowable\dmn\api\DecisionExecutionAuditContainer.java | 1 |
请完成以下Java代码 | protected void setOutgoingTransitions(List<TransitionImpl> outgoingTransitions) {
this.outgoingTransitions = outgoingTransitions;
}
protected void setParent(ScopeImpl parent) {
this.parent = parent;
}
protected void setIncomingTransitions(List<TransitionImpl> incomingTransitions) {
... | @Override
public void setY(int y) {
this.y = y;
}
@Override
public int getWidth() {
return width;
}
@Override
public void setWidth(int width) {
this.width = width;
}
@Override
public int getHeight() {
return height;
}
@Override
publ... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\pvm\process\ActivityImpl.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getKey() {
ret... | public String getEngineVersion() {
return engineVersion;
}
public void setEngineVersion(String engineVersion) {
this.engineVersion = engineVersion;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = versio... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\DeploymentEntityImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class Author {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String firstName;
private String lastName;
@OneToMany(cascade = CascadeType.ALL)
private List<BookAuthorEntity> bookAuthorEntities;
public Long getId() {
return id;
}
... | }
public List<BookAuthorEntity> getBookAuthorEntities() {
return bookAuthorEntities;
}
public void setBookAuthorEntities(List<BookAuthorEntity> bookAuthorEntities) {
this.bookAuthorEntities = bookAuthorEntities;
}
@Override
public String toString() {
return "Author{" +... | repos\tutorials-master\persistence-modules\spring-data-jpa-query\src\main\java\com\baeldung\specifications\join\Author.java | 2 |
请完成以下Java代码 | public class CustomLayers implements Layers {
private final List<Layer> layers;
private final List<ContentSelector<String>> applicationSelectors;
private final List<ContentSelector<Library>> librarySelectors;
public CustomLayers(List<Layer> layers, List<ContentSelector<String>> applicationSelectors,
List<Con... | public Layer getLayer(String resourceName) {
return selectLayer(resourceName, this.applicationSelectors, () -> "Resource '" + resourceName + "'");
}
@Override
public Layer getLayer(Library library) {
return selectLayer(library, this.librarySelectors, () -> "Library '" + library.getName() + "'");
}
private <T... | repos\spring-boot-4.0.1\loader\spring-boot-loader-tools\src\main\java\org\springframework\boot\loader\tools\layer\CustomLayers.java | 1 |
请完成以下Java代码 | private void handleSolution(List<DancingNode> answer) {
int[][] result = parseBoard(answer);
printSolution(result);
}
private int size = 9;
private int[][] parseBoard(List<DancingNode> answer) {
int[][] result = new int[size][size];
for (DancingNode n : answer) {
... | return result;
}
private static void printSolution(int[][] result) {
int size = result.length;
for (int[] aResult : result) {
StringBuilder ret = new StringBuilder();
for (int j = 0; j < size; j++) {
ret.append(aResult[j]).append(" ");
}
... | repos\tutorials-master\algorithms-modules\algorithms-miscellaneous-2\src\main\java\com\baeldung\algorithms\sudoku\DancingLinks.java | 1 |
请完成以下Java代码 | public long getCreatedTime() {
return super.getCreatedTime();
}
@Override
public String getName() {
return name;
}
public TenantProfileData getProfileData() {
if (profileData != null) {
return profileData;
} else {
if (profileDataBytes != nul... | public TenantProfileData createDefaultTenantProfileData() {
TenantProfileData tpd = new TenantProfileData();
tpd.setConfiguration(new DefaultTenantProfileConfiguration());
this.profileData = tpd;
return tpd;
}
public void setProfileData(TenantProfileData data) {
this.pro... | repos\thingsboard-master\common\data\src\main\java\org\thingsboard\server\common\data\TenantProfile.java | 1 |
请完成以下Java代码 | public String getDepPostParentId() {
return depPostParentId;
}
public void setDepPostParentId(String depPostParentId) {
this.depPostParentId = depPostParentId;
}
/**
* 重写equals方法
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
... | Objects.equals(status, model.status) &&
Objects.equals(delFlag, model.delFlag) &&
Objects.equals(qywxIdentifier, model.qywxIdentifier) &&
Objects.equals(createBy, model.createBy) &&
Objects.equals(createTime, model.createTime) &&
Objects.eq... | repos\JeecgBoot-main\jeecg-boot\jeecg-module-system\jeecg-system-biz\src\main\java\org\jeecg\modules\system\model\SysDepartTreeModel.java | 1 |
请完成以下Java代码 | public TenantCheck getTenantCheck() {
return tenantCheck;
}
public String getReportPeriodUnitName() {
return durationPeriodUnit.name();
}
protected class ExecuteDurationCmd implements Command<List<DurationReportResult>> {
@Override
public List<DurationReportResult> execute(CommandContext comm... | @Override
public List<HistoricTaskInstanceReportResult> execute(CommandContext commandContext) {
return executeCountByTaskName(commandContext);
}
}
protected class HistoricTaskInstanceCountByProcessDefinitionKey implements Command<List<HistoricTaskInstanceReportResult>> {
@Override
public Li... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\HistoricTaskInstanceReportImpl.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String rotatePassword(String name) {
try {
SimpleCredentialName credentialName = new SimpleCredentialName(name);
CredentialDetails<PasswordCredential> oldPassword = credentialOperations.getByName(credentialName, PasswordCredential.class);
CredentialDetails<PasswordCred... | .user("u101")
.build();
CredentialPermission credentialPermission = permissionOperations.addPermissions(credentialName, permission);
return credentialPermission;
} catch (Exception e) {
return null;
}
}
public CredentialPermission getCredentialP... | repos\tutorials-master\spring-credhub\src\main\java\com\baeldung\service\CredentialService.java | 2 |
请完成以下Java代码 | protected String doIt() throws Exception
{
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null,null);
for (PrintService ps : printServices)
{
addLog("Available service: "+ps.getName()+" - "+ps.toString());
}
if (I_AD_Printer.Table_Name.equals(getTableName()) && getRecord_ID() > 0... | {
if (ps.getName().equals(printerName))
{
addLog("Found service for "+printerName+": "+ps);
found = true;
}
}
if (!found)
{
throw new AdempiereException("No printing services found for "+printerName);
}
}
return "Ok";
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\adempiere\process\AD_Printer_CheckSuggest.java | 1 |
请完成以下Java代码 | private Set<PriceListId> retrievePriceLists()
{
final IQueryBL queryBL = Services.get(IQueryBL.class);
final String trxName = ITrx.TRXNAME_None;
final IQuery<I_I_Pharma_Product> pharmaPriceListQuery = queryBL.createQueryBuilder(I_I_Pharma_Product.class, trxName)
.addOnlyActiveRecordsFilter()
.addEqualsF... | .create()
.setOption(IQuery.OPTION_IteratorBufferSize, 1000)
.listDistinct(I_M_PriceList.COLUMNNAME_M_PriceList_ID)
.stream()
.map(this::extractPriceListIdorNull)
.filter(Objects::nonNull)
.collect(ImmutableSet.toImmutableSet());
}
@Nullable private PriceListId extractPriceListIdorNull(@NonNu... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma\src\main\java\de\metas\impexp\product\IFAProductImportProcess.java | 1 |
请完成以下Java代码 | @Override public String toString() { return ">"; }
};
public static final Operator LE = new SimpleOperator() {
@Override public Object apply(TypeConverter converter, Object o1, Object o2) { return BooleanOperations.le(converter, o1, o2); }
@Override public String toString() { return "<="; }
};
public static fin... | return operator.eval(bindings, context, left, right);
}
@Override
public String toString() {
return "'" + operator.toString() + "'";
}
@Override
public void appendStructure(StringBuilder b, Bindings bindings) {
left.appendStructure(b, bindings);
b.append(' ');
b.append(operator);
b.append(' ');
ri... | repos\camunda-bpm-platform-master\juel\src\main\java\org\camunda\bpm\impl\juel\AstBinary.java | 1 |
请完成以下Java代码 | public GatewayFilter apply(NameConfig config) {
// AbstractChangeRequestUriGatewayFilterFactory.apply() returns
// OrderedGatewayFilter
OrderedGatewayFilter gatewayFilter = (OrderedGatewayFilter) super.apply(config);
return new OrderedGatewayFilter(gatewayFilter, gatewayFilter.getOrder()) {
@Override
publ... | String name = Objects.requireNonNull(config.getName(), "name must not be null");
String requestUrl = exchange.getRequest().getHeaders().getFirst(name);
return Optional.ofNullable(requestUrl).map(url -> {
try {
URI uri = URI.create(url);
uri.toURL(); // validate url
return uri;
}
catch (IllegalA... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\RequestHeaderToRequestUriGatewayFilterFactory.java | 1 |
请完成以下Java代码 | public class CachingDelegateEncryptablePropertySource<T> extends PropertySource<T> implements EncryptablePropertySource<T> {
private final PropertySource<T> delegate;
private final CachingResolver cachingResolver;
@Setter
private boolean wrapGetSource = false;
/**
* <p>Constructor for CachingD... | /** {@inheritDoc} */
@Override
@NonNull
public Object getProperty(@NonNull String name) {
return cachingResolver.resolveProperty(name);
}
/** {@inheritDoc} */
@Override
public void refresh() {
log.info("Property Source {} refreshed", delegate.getName());
cachingResol... | repos\jasypt-spring-boot-master\jasypt-spring-boot\src\main\java\com\ulisesbocchio\jasyptspringboot\caching\CachingDelegateEncryptablePropertySource.java | 1 |
请完成以下Java代码 | public int getAD_User_AuthToken_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_User_AuthToken_ID);
if (ii == null)
return 0;
return ii.intValue();
}
@Override
public org.compiere.model.I_AD_User getAD_User() throws RuntimeException
{
return get_ValueAsPO(COLUMNNAME_AD_User_ID, org.compiere.mod... | }
/** Get Authentication Token.
@return Authentication Token */
@Override
public java.lang.String getAuthToken ()
{
return (java.lang.String)get_Value(COLUMNNAME_AuthToken);
}
/** Set Beschreibung.
@param Description Beschreibung */
@Override
public void setDescription (java.lang.String Description... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User_AuthToken.java | 1 |
请完成以下Java代码 | public static DemandDetail forShipmentScheduleIdAndOrderLineId(
final int shipmentScheduleId,
final int orderLineId,
final int orderId,
@NonNull final BigDecimal qty)
{
return DemandDetail.builder()
.shipmentScheduleId(shipmentScheduleId)
.orderLineId(orderLineId)
.orderId(orderId)
.qty(q... | int inOutLineId;
BigDecimal qty;
/**
* Used when a new supply candidate is created, to link it to it's respective demand candidate;
* When a demand detail is loaded from DB, this field is always <= 0.
*/
int demandCandidateId;
/**
* dev-note: it's about an {@link de.metas.material.event.MaterialEvent} tr... | repos\metasfresh-new_dawn_uat\backend\de.metas.material\dispo-commons\src\main\java\de\metas\material\dispo\commons\candidate\businesscase\DemandDetail.java | 1 |
请完成以下Java代码 | public HttpHeaders getHeaders() {
long contentLength = headers.getContentLength();
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.putAll(headers);
if (contentLength > 0) {
httpHeaders.setContentLength(contentLength);
}
else {
// TODO: this causes a 'HTTP/1.1 411 Length Requir... | public @Nullable RewriteFunction getRewriteFunction() {
return rewriteFunction;
}
public Config setRewriteFunction(RewriteFunction rewriteFunction) {
this.rewriteFunction = rewriteFunction;
return this;
}
public <T, R> Config setRewriteFunction(Class<T> inClass, Class<R> outClass,
RewriteFunction... | repos\spring-cloud-gateway-main\spring-cloud-gateway-server-webflux\src\main\java\org\springframework\cloud\gateway\filter\factory\rewrite\ModifyRequestBodyGatewayFilterFactory.java | 1 |
请完成以下Java代码 | public int getAD_Tab_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Tab_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_AD_Table getAD_Table() throws RuntimeException
{
return (org.compiere.model.I_AD_Table)MTable.get(getCtx(), org.compiere.model.I_AD_Table... | {
return (String)get_Value(COLUMNNAME_Description);
}
/** EntityType AD_Reference_ID=389 */
public static final int ENTITYTYPE_AD_Reference_ID=389;
/** Set Entitaets-Art.
@param EntityType
Dictionary Entity Type; Determines ownership and synchronization
*/
public void setEntityType (String EntityType)
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\org\adempiere\model\X_AD_TriggerUI.java | 1 |
请完成以下Java代码 | protected Collection<String> getUserRoles(HttpServletRequest request) {
ArrayList<String> j2eeUserRolesList = new ArrayList<>();
for (String role : this.j2eeMappableRoles) {
if (request.isUserInRole(role)) {
j2eeUserRolesList.add(role);
}
}
return j2eeUserRolesList;
}
/**
* Builds the authenticat... | }
return new PreAuthenticatedGrantedAuthoritiesWebAuthenticationDetails(context, userGrantedAuthorities);
}
/**
* @param aJ2eeMappableRolesRetriever The MappableAttributesRetriever to use
*/
public void setMappableRolesRetriever(MappableAttributesRetriever aJ2eeMappableRolesRetriever) {
this.j2eeMappableRol... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\authentication\preauth\j2ee\J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public final class NewRelicMetricsExportAutoConfiguration {
private final NewRelicProperties properties;
NewRelicMetricsExportAutoConfiguration(NewRelicProperties properties) {
this.properties = properties;
}
@Bean
@ConditionalOnMissingBean
NewRelicConfig newRelicConfig() {
return new NewRelicPropertiesCon... | new HttpUrlConnectionSender(this.properties.getConnectTimeout(), this.properties.getReadTimeout()));
}
@Bean
@ConditionalOnMissingBean
NewRelicMeterRegistry newRelicMeterRegistry(NewRelicConfig newRelicConfig, Clock clock,
NewRelicClientProvider newRelicClientProvider) {
return NewRelicMeterRegistry.builder(... | repos\spring-boot-4.0.1\module\spring-boot-micrometer-metrics\src\main\java\org\springframework\boot\micrometer\metrics\autoconfigure\export\newrelic\NewRelicMetricsExportAutoConfiguration.java | 2 |
请完成以下Java代码 | public void setName (final java.lang.String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setSeqNo (final int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, SeqNo);
}
@Override
public int getSeqN... | {
set_Value (COLUMNNAME_ViewEditMode, ViewEditMode);
}
@Override
public java.lang.String getViewEditMode()
{
return get_ValueAsString(COLUMNNAME_ViewEditMode);
}
/**
* WidgetSize AD_Reference_ID=540724
* Reference name: WidgetSize_WEBUI
*/
public static final int WIDGETSIZE_AD_Reference_ID=540724;
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_UI_Element.java | 1 |
请完成以下Java代码 | public void executeCopyPasteAction(final CopyPasteActionType actionType)
{
if (activeCopyPasteSupport == null)
{
return;
}
activeCopyPasteSupport.executeCopyPasteAction(actionType);
}
@Override
public Action getCopyPasteAction(final CopyPasteActionType actionType)
{
return copyPasteActions.get(action... | /**
* Action implementation which forwards a given {@link CopyPasteActionType} to {@link ICopyPasteSupportEditor}.
*
* To be used only when the component does not already have a registered handler for this action type.
*
* @author tsa
*
*/
private static class CopyPasteAction extends AbstractAction
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\grid\ed\VLookupCopyPasteSupportEditor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public @Nullable ConfigDataLocation getLocation() {
return this.location;
}
@Override
public @Nullable Origin getOrigin() {
return Origin.from(this.location);
}
@Override
public String getReferenceDescription() {
return getReferenceDescription(this.resource, this.location);
}
/**
* Create a new {@lin... | * Throw a {@link ConfigDataNotFoundException} if the specified {@link File} does not
* exist.
* @param resource the config data resource
* @param fileToCheck the file to check
*/
public static void throwIfDoesNotExist(ConfigDataResource resource, File fileToCheck) {
throwIfNot(resource, fileToCheck.exists())... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\config\ConfigDataResourceNotFoundException.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public static class ComputeFileNameRequest
{
private static final String DEFAULT_PDF_EXTENSION = ".pdf";
@Nullable
OrgId orgId;
@Nullable
DocTypeId docTypeId;
@NonNull TableRecordReference recordReference;
@Nullable
String documentNo;
@NonNull
String fileExtension;
@Nullable
String suffix... | @Nullable final DocTypeId docTypeId,
@NonNull final TableRecordReference recordReference,
@Nullable final String documentNo,
@Nullable final String fileExtension,
@Nullable final String suffix)
{
this.orgId = orgId;
this.docTypeId = docTypeId;
this.recordReference = recordReference;
this.d... | repos\metasfresh-new_dawn_uat\backend\de.metas.document.archive\de.metas.document.archive.base\src\main\java\de\metas\document\archive\api\ArchiveFileNameService.java | 2 |
请完成以下Java代码 | public MDunningRunEntry[] getEntries (boolean requery, boolean onlyInvoices)
{
if (m_entries != null && !requery)
return m_entries;
String sql = "SELECT * FROM C_DunningRunEntry WHERE C_DunningRun_ID=? ORDER BY C_DunningLevel_ID, C_DunningRunEntry_ID";
ArrayList<MDunningRunEntry> list = new ArrayList<>();
... | entry.delete(force);
}
boolean ok = getEntries(true).length == 0;
if (ok)
m_entries = null;
return ok;
} // deleteEntries
/**
* Get/Create Entry for BPartner
* @param C_BPartner_ID business partner
* @param C_Currency_ID currency
* @param SalesRep_ID sales rep
* @param C_DunningLevel_ID dunnin... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MDunningRun.java | 1 |
请完成以下Java代码 | public String processUpdateForm(Owner owner, @Valid Pet pet, BindingResult result,
RedirectAttributes redirectAttributes) {
String petName = pet.getName();
// checking if the pet name already exists for the owner
if (StringUtils.hasText(petName)) {
Pet existingPet = owner.getPet(petName, false);
if (ex... | private void updatePetDetails(Owner owner, Pet pet) {
Integer id = pet.getId();
Assert.state(id != null, "'pet.getId()' must not be null");
Pet existingPet = owner.getPet(id);
if (existingPet != null) {
// Update existing pet's properties
existingPet.setName(pet.getName());
existingPet.setBirthDate(pet... | repos\spring-petclinic-main\src\main\java\org\springframework\samples\petclinic\owner\PetController.java | 1 |
请完成以下Java代码 | public void setM_ReceiptSchedule_ExportAudit_ID (final int M_ReceiptSchedule_ExportAudit_ID)
{
if (M_ReceiptSchedule_ExportAudit_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_ReceiptSchedule_ExportAudit_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_ReceiptSchedule_ExportAudit_ID, M_ReceiptSchedule_ExportAudit_ID... | else
set_Value (COLUMNNAME_M_ReceiptSchedule_ID, M_ReceiptSchedule_ID);
}
@Override
public int getM_ReceiptSchedule_ID()
{
return get_ValueAsInt(COLUMNNAME_M_ReceiptSchedule_ID);
}
@Override
public void setTransactionIdAPI (final @Nullable java.lang.String TransactionIdAPI)
{
set_Value (COLUMNNAME_Tr... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\de\metas\inoutcandidate\model\X_M_ReceiptSchedule_ExportAudit.java | 1 |
请完成以下Java代码 | public Mono<ProfileView> getProfile(String profileUsername, User viewer) {
return userRepository.findByUsernameOrFail(profileUsername)
.map(user -> ProfileView.toProfileViewForViewer(user, viewer));
}
public Mono<ProfileView> getProfile(String profileUsername) {
return userRepos... | return userRepository.findByUsernameOrFail(username)
.flatMap(userToFollow -> {
follower.follow(userToFollow);
return userRepository.save(follower).thenReturn(userToFollow);
})
.map(ProfileView::toFollowedProfileView);
}
pu... | repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\user\UserFacade.java | 1 |
请完成以下Java代码 | public static VariableInstanceDto fromVariableInstance(VariableInstance variableInstance) {
VariableInstanceDto dto = new VariableInstanceDto();
dto.id = variableInstance.getId();
dto.name = variableInstance.getName();
dto.processDefinitionId = variableInstance.getProcessDefinitionId();
dto.process... | dto.tenantId = variableInstance.getTenantId();
if(variableInstance.getErrorMessage() == null) {
VariableValueDto.fromTypedValue(dto, variableInstance.getTypedValue());
}
else {
dto.errorMessage = variableInstance.getErrorMessage();
dto.type = VariableValueDto.toRestApiTypeName(variableIns... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\runtime\VariableInstanceDto.java | 1 |
请完成以下Java代码 | private PayloadMod createPayloadMod(
@NonNull final DunningToExport dunning,
@NonNull final XmlPayload xPayLoad)
{
return PayloadMod.builder()
.type(RequestType.REMINDER.getValue())
.reminder(createReminder(dunning))
.bodyMod(createBodyMod(dunning))
.build();
}
private XmlReminder createRemi... | }
catch (final DatatypeConfigurationException e)
{
throw new AdempiereException(e).appendParametersToMessage()
.setParameter("cal", cal);
}
}
private SoftwareMod createSoftwareMod(@NonNull final MetasfreshVersion metasfreshVersion)
{
final long versionNumber = metasfreshVersion.getMajor() * 100 + me... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_base\src\main\java\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\base\export\dunning\DunningExportClientImpl.java | 1 |
请完成以下Java代码 | public void add(String id, ProcessDefinitionInfoCacheObject obj) {
cache.put(id, obj);
}
public void remove(String id) {
cache.remove(id);
}
public void clear() {
cache.clear();
}
// For testing purposes only
public int size() {
return cache.size();
}
... | );
if (infoEntity != null && infoEntity.getRevision() != cacheObject.getRevision()) {
cacheObject.setRevision(infoEntity.getRevision());
if (infoEntity.getInfoJsonId() != null) {
byte[] infoBytes = infoEntityManager.findInfoJsonById(infoEntity.getInfoJsonId());
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\deploy\ProcessDefinitionInfoCache.java | 1 |
请完成以下Spring Boot application配置 | spring.datasource.url=jdbc:mysql://localhost:3306/bookstoredb?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MyS | QL8Dialect
spring.jpa.open-in-view=false
spring.jpa.properties.hibernate.session.events.log.LOG_QUERIES_SLOWER_THAN_MS=25 | repos\Hibernate-SpringBoot-master\HibernateSpringBootLogSlowQueries545\src\main\resources\application.properties | 2 |
请完成以下Java代码 | public java.lang.String getDataType ()
{
return (java.lang.String)get_Value(COLUMNNAME_DataType);
}
/** Set Dezimal-Punkt.
@param DecimalPoint
Decimal Point in the data file - if any
*/
@Override
public void setDecimalPoint (java.lang.String DecimalPoint)
{
set_Value (COLUMNNAME_DecimalPoint, Decima... | @Override
public java.lang.String getScript ()
{
return (java.lang.String)get_Value(COLUMNNAME_Script);
}
/** Set Reihenfolge.
@param SeqNo
Method of ordering records; lowest number comes first
*/
@Override
public void setSeqNo (int SeqNo)
{
set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo));
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_ImpFormat_Row.java | 1 |
请完成以下Java代码 | public HUConsolidationJob updateById(@NonNull final HUConsolidationJobId id, @NonNull final UnaryOperator<HUConsolidationJob> mapper)
{
return trxManager.callInThreadInheritedTrx(() -> {
final HUConsolidationJob job = getById(id);
final HUConsolidationJob jobChanged = mapper.apply(job);
if (Objects.equals(... | .stream()
.filter(job -> UserId.equals(job.getResponsibleId(), userId)
&& !job.getDocStatus().isProcessed())
.collect(ImmutableList.toImmutableList());
}
public ImmutableSet<PickingSlotId> getInUsePickingSlotIds()
{
return jobs.values()
.stream()
.filter(job -> !job.getDocStatus().isProcesse... | repos\metasfresh-new_dawn_uat\backend\de.metas.hu_consolidation.mobile\src\main\java\de\metas\hu_consolidation\mobile\job\HUConsolidationJobRepository.java | 1 |
请完成以下Java代码 | private static void sortStream() {
map.entrySet().stream()
.sorted(Map.Entry.<String, Employee>comparingByKey().reversed())
.forEach(System.out::println);
Map<String, Employee> result = map.entrySet().stream()
.sorted(Map.Entry.comparingByValue())
... | private static void initialize() {
Employee employee1 = new Employee(1L, "Mher");
map.put(employee1.getName(), employee1);
Employee employee2 = new Employee(22L, "Annie");
map.put(employee2.getName(), employee2);
Employee employee3 = new Employee(8L, "John");
map.put(empl... | repos\tutorials-master\core-java-modules\core-java-collections-maps\src\main\java\com\baeldung\map\sort\SortHashMap.java | 1 |
请完成以下Spring Boot application配置 | server:
port: 8888
spring:
application:
name: demo-config-server
profiles:
active: native # TODO 采用的方案
cloud:
config:
serv | er:
native:
search-locations: classpath:/shared | repos\SpringBoot-Labs-master\labx-12-spring-cloud-config\labx-12-sc-config-server-demo\src\main\resources\application.yml | 2 |
请在Spring Boot框架中完成以下Java代码 | public class JksSslBundleProperties extends SslBundleProperties {
/**
* Keystore properties.
*/
private final Store keystore = new Store();
/**
* Truststore properties.
*/
private final Store truststore = new Store();
public Store getKeystore() {
return this.keystore;
}
public Store getTruststore()... | private @Nullable String password;
public @Nullable String getType() {
return this.type;
}
public void setType(@Nullable String type) {
this.type = type;
}
public @Nullable String getProvider() {
return this.provider;
}
public void setProvider(@Nullable String provider) {
this.provider = p... | repos\spring-boot-4.0.1\core\spring-boot-autoconfigure\src\main\java\org\springframework\boot\autoconfigure\ssl\JksSslBundleProperties.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public void unimportCostsFromRepairOrder(@NonNull final RepairManufacturingOrderInfo repairOrder)
{
final ServiceRepairProjectTaskId taskId = projectTaskRepository
.getTaskIdByRepairOrderId(repairOrder.getProjectId(), repairOrder.getId())
.orElseThrow(() -> new AdempiereException("No task found for " + repai... | addQtyToProjectTaskRequests.add(extractAddQtyToProjectTaskRequest(costCollector).negate());
costCollectorIdsToDelete.add(costCollector.getId());
}
huReservationService.deleteReservationsByVHUIds(reservedVHUIds);
projectCostCollectorRepository.deleteByIds(costCollectorIdsToDelete);
addQtyToProjectTaskRequest... | repos\metasfresh-new_dawn_uat\backend\de.metas.servicerepair.base\src\main\java\de\metas\servicerepair\project\service\ServiceRepairProjectService.java | 2 |
请完成以下Java代码 | public Map<String, TaskTemplateDefinition> getTasks() {
return tasks;
}
public void setTasks(Map<String, TaskTemplateDefinition> tasks) {
this.tasks = tasks;
}
public TaskTemplateDefinition getDefaultTemplate() {
return defaultTemplate;
}
public void setDefaultTemplate... | return true;
}
return taskTemplateDefinition.isEmailNotificationEnabled();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TemplatesDe... | repos\Activiti-develop\activiti-core\activiti-spring-process-extensions\src\main\java\org\activiti\spring\process\model\TemplatesDefinition.java | 1 |
请完成以下Java代码 | private static void failIfInvoiced(@Nullable final I_C_Invoice_Candidate icRecord)
{
if (icRecord != null && icRecord.getQtyInvoiced().signum() != 0)
{
throw new AdempiereException("@" + MSG_DATA_ENTRY_ALREADY_INVOICED_0P + "@");
}
}
private void deleteInvoiceCandidate(@NonNull final I_C_Flatrate_DataEntry... | InterfaceWrapperHelper.delete(icCorr);
}
}
}
private void afterReactivate(final I_C_Flatrate_DataEntry dataEntry)
{
if (X_C_Flatrate_DataEntry.TYPE_Invoicing_PeriodBased.equals(dataEntry.getType()))
{
final IFlatrateDAO flatrateDB = Services.get(IFlatrateDAO.class);
final List<I_C_Invoice_Clearing_Al... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\interceptor\C_Flatrate_DataEntry.java | 1 |
请完成以下Java代码 | public void afterSave(final I_C_ElementValue elementValue)
{
createValidCombinationIfNeeded(elementValue);
}
@VisibleForTesting
protected void createValidCombinationIfNeeded(final I_C_ElementValue elementValue)
{
if (elementValue.isSummary())
{
return;
}
final AccountDimension.Builder accountDimensi... | accountDAO.getOrCreateWithinTrx(accountDimensionTemplate.setAcctSchemaId(acctSchema.getId()).build());
}
}
public static IAutoCloseable temporaryDisableUpdateTreeNode()
{
final boolean wasDisabled = updateTreeNodeDisabled.getAndSet(true);
return () -> updateTreeNodeDisabled.set(wasDisabled);
}
@ModelChange... | repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\interceptor\C_ElementValue.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public Map<HUQRCodeUniqueId, HuId> getHuIds(@NonNull final Collection<HUQRCode> huQrCodes)
{
return huQRCodesRepository.getHUAssignmentsByQRCode(huQrCodes)
.stream()
.collect(ImmutableMap.toImmutableMap(HUQRCodeAssignment::getId, HUQRCodeAssignment::getSingleHUId));
}
public IHUQRCode parse(@NonNull final... | if (customHUQRCode != null)
{
return customHUQRCode;
}
// M_HU.Value / ExternalBarcode attribute
{
final HuId huId = handlingUnitsBL.getHUIdByValueOrExternalBarcode(scannedCode).orElse(null);
if (huId != null)
{
return getFirstQRCodeByHuId(huId);
}
}
final GS1HUQRCode gs1HUQRCode = GS1H... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\qrcodes\service\HUQRCodesService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public PageResult<OnlineUser> onlineUser(PageCondition pageCondition) {
PageResult<String> keys = redisUtil.findKeysForPage(Consts.REDIS_JWT_KEY_PREFIX + Consts.SYMBOL_STAR, pageCondition.getCurrentPage(), pageCondition.getPageSize());
List<String> rows = keys.getRows();
Long total = keys.getTot... | *
* @param names 用户名列表
*/
public void kickout(List<String> names) {
// 清除 Redis 中的 JWT 信息
List<String> redisKeys = names.parallelStream().map(s -> Consts.REDIS_JWT_KEY_PREFIX + s).collect(Collectors.toList());
redisUtil.delete(redisKeys);
// 获取当前用户名
String currentU... | repos\spring-boot-demo-master\demo-rbac-security\src\main\java\com\xkcoding\rbac\security\service\MonitorService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public PmsMenu getById(Long pid) {
return pmsMenuDao.getById(pid);
}
/**
* 更新菜单.
*
* @param menu
*/
public void update(PmsMenu menu) {
pmsMenuDao.update(menu);
}
/**
* 根据角色查找角色对应的菜单ID集
* | * @param roleId
* @return
*/
public String getMenuIdsByRoleId(Long roleId) {
List<PmsMenuRole> menuList = pmsMenuRoleDao.listByRoleId(roleId);
StringBuffer menuIds = new StringBuffer("");
if (menuList != null && !menuList.isEmpty()) {
for (PmsMenuRole rm : menuList) {
menuIds.append(rm.getMenuId()).ap... | repos\roncoo-pay-master\roncoo-pay-service\src\main\java\com\roncoo\pay\permission\service\impl\PmsMenuServiceImpl.java | 2 |
请完成以下Java代码 | public void addChangedRowIds(@Nullable final DocumentIdsSelection rowIds)
{
// Don't collect rowIds if this was already flagged as fully changed.
if (fullyChanged)
{
return;
}
if (rowIds == null || rowIds.isEmpty())
{
return;
}
else if (rowIds.isAll())
{
fullyChanged = true;
changedRowI... | {
changedRowIds = new HashSet<>();
}
changedRowIds.add(rowId);
}
public DocumentIdsSelection getChangedRowIds()
{
final boolean fullyChanged = this.fullyChanged;
final Set<DocumentId> changedRowIds = this.changedRowIds;
if (fullyChanged)
{
return DocumentIdsSelection.ALL;
}
else if (changedRo... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\event\ViewChanges.java | 1 |
请完成以下Java代码 | public String toString()
{
final StringBuilder sb = new StringBuilder();
sb.append(entry);
sb.append(' ');
sb.append(type);
sb.append(' ');
sb.append(synonymList);
return sb.toString();
}
/**
* 语义距离
... | return entry.distance(other.entry);
}
/**
* 创建一个@类型的词典之外的条目
*
* @param word
* @return
*/
public static SynonymItem createUndefined(String word)
{
SynonymItem item = new SynonymItem(new Synonym(word, word.hashCode() * 1000000 + Lon... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\dictionary\common\CommonSynonymDictionary.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class OrderServiceImpl implements OrderService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private OrderDao orderDao;
@Autowired
private AccountService accountService;
@Autowired
private ProductService productService;
@Override
@DS(value = "o... | // 扣减库存
productService.reduceStock(productId, amount);
// 扣减余额
accountService.reduceBalance(userId, price);
// 保存订单
OrderDO order = new OrderDO().setUserId(userId).setProductId(productId).setPayAmount(amount * price);
orderDao.saveOrder(order);
logger.info("[cre... | repos\SpringBoot-Labs-master\lab-52\lab-52-multiple-datasource\src\main\java\cn\iocoder\springboot\lab52\seatademo\service\impl\OrderServiceImpl.java | 2 |
请完成以下Java代码 | public void run(final String localTrxName)
{
final I_C_AllocationHdr allocationHdr = paymentBL.paymentWriteOff(payment, amtToWriteOff, p_AllocDateTrx, writeOffDescription);
// Make sure the payment was fully allocated
InterfaceWrapperHelper.refresh(payment, localTrxName);
Check.errorIf(!payment.isAl... | if (p_PaymentDateTo != null)
{
queryBuilder.addCompareFilter(I_C_Payment.COLUMNNAME_DateTrx, Operator.LESS_OR_EQUAL, p_PaymentDateTo);
}
final IQuery<I_C_Payment> query = queryBuilder
.orderBy(I_C_Payment.COLUMNNAME_C_Payment_ID)
.create();
addLog("Using query: " + query);
final int count = query... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\payment\process\C_Payment_MassWriteOff.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void onSuccess(ValidationResult result) {
if (result.getResultCode() == ValidationResultCode.OK) {
action.onSuccess(response);
} else {
onFailure(getException(result));
}
}
@Override
public void onFailure(Throwable e) {
action.onFailure(e);
... | break;
case ACCESS_DENIED:
e = new AccessDeniedException(result.getMessage());
break;
case INTERNAL_ERROR:
e = new InternalErrorException(result.getMessage());
break;
default:
e = new UnauthorizedExceptio... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\security\ValidationCallback.java | 2 |
请完成以下Java代码 | public int getM_SerNoCtlExclude_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_SerNoCtlExclude_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_SerNoCtl getM_SerNoCtl() throws RuntimeException
{
return (I_M_SerNoCtl)MTable.get(getCtx(), I_M_SerNoCtl.Table_Name)
.getPO(getM... | if (M_SerNoCtl_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_SerNoCtl_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_SerNoCtl_ID, Integer.valueOf(M_SerNoCtl_ID));
}
/** Get Serial No Control.
@return Product Serial Number Control
*/
public int getM_SerNoCtl_ID ()
{
Integer ii = (Integer)get_Value(COLUMN... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_SerNoCtlExclude.java | 1 |
请完成以下Java代码 | public String getRegistrationAttributeDescription()
{
if (m_registrationAttributeDescription == null)
getRegistrationAttribute();
return m_registrationAttributeDescription;
} // getRegistrationAttributeDescription
/**
* Get Attribute SeqNo
* @return seq no
*/
public int getSeqNo()
{
if (m_seqNo =... | public int compareTo (Object o)
{
if (o == null)
return 0;
MRegistrationValue oo = (MRegistrationValue)o;
int compare = getSeqNo() - oo.getSeqNo();
return compare;
} // compareTo
/**
* String Representation
* @return info
*/
public String toString()
{
StringBuffer sb = new StringBuffer();
sb... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MRegistrationValue.java | 1 |
请完成以下Java代码 | public void setA_Renewal_Date (Timestamp A_Renewal_Date)
{
set_Value (COLUMNNAME_A_Renewal_Date, A_Renewal_Date);
}
/** Get Policy Renewal Date.
@return Policy Renewal Date */
public Timestamp getA_Renewal_Date ()
{
return (Timestamp)get_Value(COLUMNNAME_A_Renewal_Date);
}
/** Set Account State.
@pa... | /** Set Text.
@param Text Text */
public void setText (String Text)
{
set_Value (COLUMNNAME_Text, Text);
}
/** Get Text.
@return Text */
public String getText ()
{
return (String)get_Value(COLUMNNAME_Text);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_A_Asset_Info_Lic.java | 1 |
请完成以下Java代码 | private final void destroyEditor()
{
if (editor == null)
{
return;
}
editor.dispose();
editor = null;
}
@Override
public boolean stopCellEditing()
{
if (!super.stopCellEditing())
{
return false; | }
destroyEditor();
return true;
}
@Override
public void cancelCellEditing()
{
super.cancelCellEditing();
destroyEditor();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java-legacy\org\compiere\apps\search\FindValueEditor.java | 1 |
请完成以下Java代码 | public void setDescription (java.lang.String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Beschreibung.
@return Beschreibung */
@Override
public java.lang.String getDescription ()
{
return (java.lang.String)get_Value(COLUMNNAME_Description);
}
/** Set Parent.
@param Par... | Integer ii = (Integer)get_Value(COLUMNNAME_Root_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Gültig ab.
@param ValidFrom
Gültig ab inklusiv (erster Tag)
*/
@Override
public void setValidFrom (java.sql.Timestamp ValidFrom)
{
set_Value (COLUMNNAME_ValidFrom, ValidFrom);
}
/** ... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_User_Record_Access.java | 1 |
请完成以下Java代码 | public static PlainContextAware newWithThreadInheritedTrx()
{
return new PlainContextAware(Env.getCtx(), ITrx.TRXNAME_ThreadInherited);
}
/**
* @return a {@link IContextAware} for given <code>ctx</code> and <code>trxName</code>.<br>
* Its {@link #isAllowThreadInherited()} will return <code>false</code... | }
@Override
public String toString()
{
return "PlainContextAware["
// +", ctx="+ctx // don't print it... it's fucking too big
+ ", trxName=" + trxName
+ "]";
}
@Override
public int hashCode()
{
return new HashcodeBuilder()
.append(ctx)
.append(trxName)
.toHashcode();
}
@Override
... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\model\PlainContextAware.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setObservationRegistry(ObservationRegistry registry) {
this.observationRegistry = registry;
}
}
public static final class PostAuthorizeAuthorizationMethodInterceptor
implements FactoryBean<AuthorizationManagerAfterMethodInterceptor> {
private SecurityContextHolderStrategy securityContextHolde... | @Override
public Class<?> getObjectType() {
return SecurityContextHolderStrategy.class;
}
}
static class ObservationRegistryFactory implements FactoryBean<ObservationRegistry> {
@Override
public ObservationRegistry getObject() throws Exception {
return ObservationRegistry.NOOP;
}
@Override
pub... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\method\MethodSecurityBeanDefinitionParser.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Builder setName(final String name)
{
this.name = name;
return this;
}
/**
* Sets the primary key of the {@link I_DLM_Partition_Config} records that already exists for the {@link PartitionConfig} instances that we want to build.
* This information is important when a config is persisted because... | return newLine().setTableName(tableName);
}
private void assertLineTableNamesUnique()
{
final List<LineBuilder> nonUniqueLines = lineBuilders.stream()
.collect(Collectors.groupingBy(r -> r.getTableName())) // group them by tableName; this returns a map
.entrySet().stream() // now stream the map's en... | repos\metasfresh-new_dawn_uat\backend\de.metas.dlm\base\src\main\java\de\metas\dlm\partitioner\config\PartitionConfig.java | 2 |
请完成以下Java代码 | public void setCamundaDecisionBinding(String camundaDecisionBinding) {
camundaDecisionBindingAttribute.setValue(this, camundaDecisionBinding);
}
public String getCamundaDecisionVersion() {
return camundaDecisionVersionAttribute.getValue(this);
}
public void setCamundaDecisionVersion(String camundaDeci... | camundaDecisionVersionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DECISION_VERSION)
.namespace(CAMUNDA_NS)
.build();
camundaDecisionTenantIdAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DECISION_TENANT_ID)
.namespace(CAMUNDA_NS)
.build();
camundaMapDecisio... | repos\camunda-bpm-platform-master\model-api\cmmn-model\src\main\java\org\camunda\bpm\model\cmmn\impl\instance\DecisionTaskImpl.java | 1 |
请完成以下Java代码 | public class SpringBeansResolverFactory implements ResolverFactory, Resolver {
protected static Logger LOG = Logger.getLogger(SpringBeansResolverFactory.class.getName());
protected static String SCOPE_NOT_ACTIVE_EXCEPTION = "org.springframework.beans.factory.support.ScopeNotActiveException";
private Applicatio... | // Unfortunately, we cannot use ScopeNotActiveException directly as
// it is only available starting with Spring 5.3, but we still support Spring 4.
if (SCOPE_NOT_ACTIVE_EXCEPTION.equals(ex.getClass().getName())) {
LOG.info("Bean '" + key + "' cannot be accessed since scope is not active. Inst... | repos\camunda-bpm-platform-master\engine-spring\core\src\main\java\org\camunda\bpm\engine\spring\SpringBeansResolverFactory.java | 1 |
请完成以下Java代码 | public Criteria andReadCountNotIn(List<Integer> values) {
addCriterion("read_count not in", values, "readCount");
return (Criteria) this;
}
public Criteria andReadCountBetween(Integer value1, Integer value2) {
addCriterion("read_count between", value1, value2, "readC... | return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
thi... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\CmsHelpExample.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public static ReactiveUserDetailsServiceResourceFactoryBean fromResourceLocation(String resourceLocation) {
ReactiveUserDetailsServiceResourceFactoryBean result = new ReactiveUserDetailsServiceResourceFactoryBean();
result.setResourceLocation(resourceLocation);
return result;
}
/**
* Create a ReactiveUserDet... | }
/**
* Create a ReactiveUserDetailsServiceResourceFactoryBean with a String that is in the
* format defined in {@link UserDetailsResourceFactoryBean}.
* @param users the users in the format defined in
* {@link UserDetailsResourceFactoryBean}
* @return the ReactiveUserDetailsServiceResourceFactoryBean
*/
... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\core\userdetails\ReactiveUserDetailsServiceResourceFactoryBean.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Object getPrincipal() {
return this.delegate.getPrincipal();
}
@Override
public Object getCredentials() {
return this.delegate.getCredentials();
}
@Override
public void eraseCredentials() {
this.delegate.eraseCredentials();
}
@Override
public void se... | @Override
public Map<String, Object> getTokenAttributes() {
return this.delegate.getTokenAttributes();
}
/**
* Returns a JWT. It usually refers to a token string expressing with 'eyXXX.eyXXX.eyXXX' format.
*
* @return the token value as a String
*/
public String tokenValue()... | repos\realworld-java21-springboot3-main\server\api\src\main\java\io\zhc1\realworld\config\AuthToken.java | 2 |
请完成以下Java代码 | public static boolean twoOrMoreAreTrueByLoop(boolean a, boolean b, boolean c) {
int count = 0;
for (boolean i : new Boolean[] { a, b, c }) {
count += i ? 1 : 0;
if (count >= 2)
return true;
}
return false;
}
public static boolean xOrMoreAr... | return (a ? 1 : 0) + (b ? 1 : 0) + (c ? 1 : 0) >= 2;
}
public static boolean xOrMoreAreTrueBySum(Boolean[] booleans, int x) {
return Arrays.stream(booleans).mapToInt(b -> Boolean.TRUE.equals(b) ? 1 : 0).sum() >= x;
}
public static boolean twoorMoreAreTrueByKarnaughMap(boolean a, boolean b, boo... | repos\tutorials-master\core-java-modules\core-java-lang-operators-2\src\main\java\com\baeldung\threebool\ThreeBooleans.java | 1 |
请完成以下Java代码 | public class OrganisationIdentification8 {
@XmlElement(name = "AnyBIC")
protected String anyBIC;
@XmlElement(name = "Othr")
protected List<GenericOrganisationIdentification1> othr;
/**
* Gets the value of the anyBIC property.
*
* @return
* possible object is
* {@l... | * <pre>
* getOthr().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link GenericOrganisationIdentification1 }
*
*
*/
public List<GenericOrganisationIdentification1> getOthr() {
if (othr == null) {
... | repos\metasfresh-new_dawn_uat\backend\de.metas.banking\de.metas.banking.camt53\src\main\java-xjc\de\metas\banking\camt53\jaxb\camt053_001_04\OrganisationIdentification8.java | 1 |
请完成以下Java代码 | private void loadPurchaseItem(
@NonNull final PurchaseCandidate purchaseCandidate,
@NonNull final I_C_PurchaseCandidate_Alloc record)
{
final ITableRecordReference transactionReference = TableRecordReference.ofReferencedOrNull(record);
if (record.getAD_Issue_ID() <= 0)
{
final OrderAndLineId purchaseOr... | .purchasedQty(purchasedQty)
.remotePurchaseOrderId(record.getRemotePurchaseOrderId())
.transactionReference(transactionReference)
.purchaseOrderAndLineId(purchaseOrderAndLineId)
.build();
purchaseCandidate.addLoadedPurchaseOrderItem(purchaseOrderItem);
}
else
{
purchaseCandidate.createE... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\remotepurchaseitem\PurchaseItemRepository.java | 1 |
请完成以下Java代码 | private ImmutableSet<AdTableId> retrieveDistinctIds(
@NonNull final String tableName,
@NonNull final String idColumnName)
{
final String sql = "SELECT " + DB_FUNCTION_RETRIEVE_DISTINCT_IDS + "(?,?)";
final Object[] sqlParams = new Object[] { tableName, idColumnName };
PreparedStatement pstmt = null;
Res... | return result.build();
}
catch (final SQLException ex)
{
throw DBException.wrapIfNeeded(ex)
.appendParametersToMessage()
.setParameter("sql", sql)
.setParameter("sqlParams", sqlParams);
}
finally
{
DB.close(rs, pstmt);
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\table\api\impl\TableRecordIdDAO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ShipmentScheduleSubscriptionReferenceProvider implements ShipmentScheduleReferencedLineProvider
{
/**
* @return {@link I_C_SubscriptionProgress#Table_Name}.
*/
@Override
public String getTableName()
{
return I_C_SubscriptionProgress.Table_Name;
}
@Override
public ShipmentScheduleReferencedLin... | }
public WarehouseId getWarehouseId(@NonNull final I_C_SubscriptionProgress subscriptionLine)
{
return Services.get(IFlatrateBL.class).getWarehouseId(subscriptionLine.getC_Flatrate_Term());
}
private SubscriptionLineDescriptor createDocumentLineDescriptor(
@NonNull final I_C_SubscriptionProgress subscription... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\inoutcandidate\ShipmentScheduleSubscriptionReferenceProvider.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public R submit(@Valid @RequestBody Code code) {
return R.status(codeService.submit(code));
}
/**
* 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 4)
@Operation(summary = "删除", description = "传入ids")
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
... | generator.setPassword(datasource.getPassword());
// 设置基础配置
generator.setSystemName(system);
generator.setServiceName(code.getServiceName());
generator.setPackageName(code.getPackageName());
generator.setPackageDir(code.getApiPath());
generator.setPackageWebDir(code.getWebPath());
generator.setTable... | repos\SpringBlade-master\blade-ops\blade-develop\src\main\java\org\springblade\develop\controller\CodeController.java | 2 |
请完成以下Java代码 | public final class QualityInspectionWarehouseDestProvider implements IReceiptScheduleWarehouseDestProvider
{
public static final QualityInspectionWarehouseDestProvider instance = new QualityInspectionWarehouseDestProvider();
private static final String SYSCONFIG_QualityInspectionWarehouseDest_Prefix = "QualityInspec... | final I_M_AttributeInstance qualityInspectionCycleAttributeInstance = asiBL.getAttributeInstance(asiId, qualityInspectionCycleAttributeId);
if (qualityInspectionCycleAttributeInstance == null)
{
return Optional.empty();
}
final String qualityInspectionCycleValue = qualityInspectionCycleAttributeInstance.get... | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\materialtracking\impl\QualityInspectionWarehouseDestProvider.java | 1 |
请完成以下Java代码 | public void execute() {
execute(false, false);
}
@Override
public void execute(boolean skipCustomListeners, boolean skipIoMappings) {
execute(true, skipCustomListeners, skipIoMappings);
}
public void execute(boolean writeUserOperationLog, boolean skipCustomListeners, boolean skipIoMappings) {
th... | return skipCustomListeners;
}
public boolean isSkipIoMappings() {
return skipIoMappings;
}
public boolean isExternallyTerminated() {
return externallyTerminated;
}
public void setSkipCustomListeners(boolean skipCustomListeners) {
this.skipCustomListeners = skipCustomListeners;
}
public v... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\ProcessInstanceModificationBuilderImpl.java | 1 |
请完成以下Java代码 | public int getC_HierarchyCommissionSettings_ID()
{
return get_ValueAsInt(COLUMNNAME_C_HierarchyCommissionSettings_ID);
}
@Override
public void setCommission_Product_ID (final int Commission_Product_ID)
{
if (Commission_Product_ID < 1)
set_Value (COLUMNNAME_Commission_Product_ID, null);
else
set_Val... | {
set_Value (COLUMNNAME_IsSubtractLowerLevelCommissionFromBase, IsSubtractLowerLevelCommissionFromBase);
}
@Override
public boolean isSubtractLowerLevelCommissionFromBase()
{
return get_ValueAsBoolean(COLUMNNAME_IsSubtractLowerLevelCommissionFromBase);
}
@Override
public void setName (final java.lang.Stri... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_HierarchyCommissionSettings.java | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.