instruction
string
input
string
output
string
source_file
string
priority
int64
请完成以下Java代码
public static List<IValidationRule> unbox(@Nullable final IValidationRule rule) { if (rule == null || NullValidationRule.isNull(rule)) { return ImmutableList.of(); } final ArrayList<IValidationRule> result = new ArrayList<>(); unboxAndAppendToList(rule, result); return result; } public static List<...
private Builder add(final IValidationRule rule, final boolean explodeComposite) { // Don't add null rules if (NullValidationRule.isNull(rule)) { return this; } // Don't add if already exists if (rules.contains(rule)) { return this; } if (explodeComposite && rule instanceof Composi...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\validationRule\impl\CompositeValidationRule.java
1
请完成以下Java代码
public Integer delete(Long id) { return super.deleteById(id); } /** * 更新用户 * * @param user 用户对象 * @param id 主键id * @return 操作影响行数 */ public Integer update(User user, Long id) { return super.updateById(user, id, true); } /** * 根据主键获取用户
* * @param id 主键id * @return id对应的用户 */ public User selectById(Long id) { return super.findOneById(id); } /** * 根据查询条件获取用户列表 * * @param user 用户查询条件 * @return 用户列表 */ public List<User> selectUserList(User user) { return super.findByExample(user); ...
repos\spring-boot-demo-master\demo-orm-jdbctemplate\src\main\java\com\xkcoding\orm\jdbctemplate\dao\UserDao.java
1
请完成以下Java代码
protected AbstractEngineConfiguration getEngineConfigurationForAllType(CommandContext commandContext) { AbstractEngineConfiguration engineConfiguration = commandContext.getEngineConfigurations().get(ScopeTypes.BPMN); if (engineConfiguration == null) { engineConfiguration = commandContext.get...
} } if (engineConfiguration == null) { throw new IllegalStateException("Cannot initialize byte array. No engine configuration found"); } return engineConfiguration; } @Override public String toString() { return "ByteArrayRef[id=" + id + ...
repos\flowable-engine-main\modules\flowable-engine-common\src\main\java\org\flowable\common\engine\impl\persistence\entity\ByteArrayRef.java
1
请完成以下Java代码
public boolean isSummary () { Object oo = get_Value(COLUMNNAME_IsSummary); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** MediaType AD_Reference_ID=388 */ public static final int MEDIATYPE_AD_Reference_ID=388;...
@return Defines the media type for the browser */ public String getMediaType () { return (String)get_Value(COLUMNNAME_MediaType); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @retur...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Media.java
1
请完成以下Java代码
protected BatchStatisticsQuery createNewQuery(ProcessEngine engine) { return engine.getManagementService().createBatchStatisticsQuery(); } protected void applyFilters(BatchStatisticsQuery query) { if (batchId != null) { query.batchId(batchId); } if (type != null) { query.type(type); ...
query.startedAfter(startedAfter); } if (TRUE.equals(withFailures)) { query.withFailures(); } if (TRUE.equals(withoutFailures)) { query.withoutFailures(); } } protected void applySortBy(BatchStatisticsQuery query, String sortBy, Map<String, Object> parameters, ProcessEngine engine) {...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\batch\BatchStatisticsQueryDto.java
1
请完成以下Java代码
public Date getCurrentDate() { return new Date(); } @JsonFormat(shape = JsonFormat.Shape.NUMBER) public Date getDateNum() { return new Date(); } } @JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES) class UserIgnoreCase { private String firstName; private ...
return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Date getCreatedDate() { return...
repos\tutorials-master\jackson-modules\jackson-annotations\src\main\java\com\baeldung\jackson\format\User.java
1
请完成以下Java代码
protected String doIt() { getView().streamByIds(getSelectedRowIds()) .map(row -> row.getId().toInt()) .distinct() .forEach(this::createQuarantineHUsByLotNoQuarantineId); ddOrderService.createQuarantineDDOrderForHUs(husToQuarantine); setInvoiceCandsInDispute(); return MSG_OK; } private void se...
// the HU is already quarantined continue; } final List<de.metas.handlingunits.model.I_M_InOutLine> inOutLinesForHU = huInOutDAO.retrieveInOutLinesForHU(hu); if (Check.isEmpty(inOutLinesForHU)) { continue; } huLotNoQuarantineService.markHUAsQuarantine(hu); final I_M_InOut firstReceipt = i...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\product\process\WEBUI_M_Product_LotNumber_Quarantine.java
1
请完成以下Java代码
public static Optional<CCacheStatsOrderBy> parse(@Nullable final String string) { final String stringNorm = StringUtils.trimBlankToNull(string); if (stringNorm == null) { return Optional.empty(); } try { final ImmutableList<Part> parts = Splitter.on(",") .trimResults() .omitEmptyStrings() ...
comparator = Comparator.comparing(CCacheStats::getHitRate); break; case missRate: comparator = Comparator.comparing(CCacheStats::getMissRate); break; default: throw new AdempiereException("Unknown field type!"); } if (!ascending) { comparator = comparator.reversed(); } r...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\CCacheStatsOrderBy.java
1
请完成以下Java代码
public class DeleteDeploymentCmd implements Command<Void>, Serializable { private final static TransactionLogger TX_LOG = ProcessEngineLogger.TX_LOGGER; private static final long serialVersionUID = 1L; protected String deploymentId; protected boolean cascade; protected boolean skipCustomListeners; prote...
ProcessApplicationReference processApplicationReference = Context .getProcessEngineConfiguration() .getProcessApplicationManager() .getProcessApplicationForDeployment(deploymentId); DeleteDeploymentFailListener listener = new DeleteDeploymentFailListener(deploymentId, processApplicationReference,...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\DeleteDeploymentCmd.java
1
请完成以下Java代码
public void setMultiTier(boolean multiTier) { this.multiTier = multiTier; } private static final class LoginConfig extends Configuration { private boolean debug; private LoginConfig(boolean debug) { super(); this.debug = debug; } @Override public AppConfigurationEntry[] getAppConfigurationEntry(...
for (Callback callback : callbacks) { if (callback instanceof NameCallback) { NameCallback ncb = (NameCallback) callback; ncb.setName(this.username); } else if (callback instanceof PasswordCallback) { PasswordCallback pwcb = (PasswordCallback) callback; pwcb.setPassword(this.password.toC...
repos\spring-security-main\kerberos\kerberos-core\src\main\java\org\springframework\security\kerberos\authentication\sun\SunJaasKerberosClient.java
1
请完成以下Java代码
public class CopyOnWriteBenchmark { @State(Scope.Thread) public static class MyState { CopyOnWriteArrayList<Employee> employeeList = new CopyOnWriteArrayList<>(); long iterations = 100000; Employee employee = new Employee(100L, "Harry"); int employeeIndex = -1; @Set...
@Benchmark public boolean testContains(MyState state) { return state.employeeList.contains(state.employee); } @Benchmark public int testIndexOf(MyState state) { return state.employeeList.indexOf(state.employee); } @Benchmark public Employee testGet(MyState state) { ...
repos\tutorials-master\core-java-modules\core-java-collections-7\src\main\java\com\baeldung\performance\CopyOnWriteBenchmark.java
1
请完成以下Java代码
public String getCity_7bitlc() { return city_7bitlc; } public void setCity_7bitlc(String city_7bitlc) { this.city_7bitlc = city_7bitlc; } public String getStringRepresentation() { return stringRepresentation; } public void setStringRepresentation(String stringRepresentation) { this.stringRepresentatio...
GeodbObject go = (GeodbObject)obj; return this.geodb_loc_id == go.geodb_loc_id && this.zip.equals(go.zip) ; } @Override public String toString() { String str = getStringRepresentation(); if (str != null) return str; return city+", "+zip+" - "+countryName; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\client\src\main\java\de\metas\adempiere\gui\search\GeodbObject.java
1
请完成以下Java代码
public ViewId getViewId() { return viewId; } public void setFullyChanged() { fullyChanged = true; } public boolean isHeaderPropertiesChanged() { return headerPropertiesChanged; } public void setHeaderPropertiesChanged() { this.headerPropertiesChanged = true; } public boolean isFullyChanged() { ...
public void addChangedRowIds(final Collection<DocumentId> rowIds) { if (rowIds.isEmpty()) { return; } if (changedRowIds == null) { changedRowIds = new HashSet<>(); } changedRowIds.addAll(rowIds); } public void addChangedRowId(@NonNull final DocumentId rowId) { if (changedRowIds == null) { ...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\event\ViewChanges.java
1
请在Spring Boot框架中完成以下Java代码
public TimeBookingId save(@NonNull final TimeBooking timeBooking) { final I_S_TimeBooking record = InterfaceWrapperHelper.loadOrNew(timeBooking.getTimeBookingId(), I_S_TimeBooking.class); record.setAD_Org_ID(timeBooking.getOrgId().getRepoId()); record.setAD_User_Performing_ID(timeBooking.getPerformingUserId().g...
.addOnlyActiveRecordsFilter() .addEqualsFilter(I_S_TimeBooking.COLUMNNAME_S_Issue_ID, issueId.getRepoId()) .create() .list() .stream() .map(this::buildTimeBooking) .collect(ImmutableList.toImmutableList()); } private TimeBooking buildTimeBooking(@NonNull final I_S_TimeBooking record) { ret...
repos\metasfresh-new_dawn_uat\backend\de.metas.serviceprovider\src\main\java\de\metas\serviceprovider\timebooking\TimeBookingRepository.java
2
请完成以下Java代码
protected org.compiere.model.POInfo initPO(final Properties ctx) { return org.compiere.model.POInfo.getPOInfo(Table_Name); } @Override public void setAD_NotificationGroup_CC_ID (final int AD_NotificationGroup_CC_ID) { if (AD_NotificationGroup_CC_ID < 1) set_ValueNoCheck (COLUMNNAME_AD_NotificationGroup_CC...
set_ValueNoCheck (COLUMNNAME_AD_NotificationGroup_ID, null); else set_ValueNoCheck (COLUMNNAME_AD_NotificationGroup_ID, AD_NotificationGroup_ID); } @Override public int getAD_NotificationGroup_ID() { return get_ValueAsInt(COLUMNNAME_AD_NotificationGroup_ID); } @Override public void setAD_User_ID (fina...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_AD_NotificationGroup_CC.java
1
请完成以下Java代码
public BPPurchaseSchedule save(@NonNull final BPPurchaseSchedule schedule) { final I_C_BP_PurchaseSchedule scheduleRecord = createOrUpdateRecord(schedule); saveRecord(scheduleRecord); return schedule.toBuilder() .bpPurchaseScheduleId(BPPurchaseScheduleId.ofRepoId(scheduleRecord.getC_BP_PurchaseSchedule_ID()...
} private static void setDaysOfWeek(@NonNull final I_C_BP_PurchaseSchedule scheduleRecord, @NonNull final ImmutableSet<DayOfWeek> daysOfWeek) { if (daysOfWeek.contains(DayOfWeek.MONDAY)) { scheduleRecord.setOnMonday(true); } if (daysOfWeek.contains(DayOfWeek.TUESDAY)) { scheduleRecord.setOnTuesday(tr...
repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\BPPurchaseScheduleRepository.java
1
请完成以下Java代码
public IModelInterceptor registerHandler(final ICounterDocHandler handler, final String tableName) { Check.assumeNotNull(handler, "Param 'handler' is not null"); Check.assumeNotNull(tableName, "Param 'tableName' is not null"); final ICounterDocHandler oldHandler = handlers.put(tableName, handler); Check.er...
* @param document * @return may return the {@link NullCounterDocumentHandler}, but never <code>null</code>. */ private Pair<ICounterDocHandler, IDocument> getHandlerOrNull(final Object document) { final String tableName = InterfaceWrapperHelper.getModelTableNameOrNull(document); if (Check.isEmpty(tableName) |...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\document\impl\CounterDocBL.java
1
请完成以下Java代码
public List<ChannelDefinition> executeList(CommandContext commandContext) { return CommandContextUtil.getChannelDefinitionEntityManager(commandContext).findChannelDefinitionsByQueryCriteria(this); } // getters //////////////////////////////////////////// public String getDeploymentId() { r...
public boolean isOnlyOutbound() { return onlyOutbound; } public String getImplementation() { return implementation; } public Date getCreateTime() { return createTime; } public Date getCreateTimeAfter() { return createTimeAfter; } public Date getCreateT...
repos\flowable-engine-main\modules\flowable-event-registry\src\main\java\org\flowable\eventregistry\impl\ChannelDefinitionQueryImpl.java
1
请完成以下Java代码
public boolean supports(Class<?> authentication) { return OAuth2LoginAuthenticationToken.class.isAssignableFrom(authentication); } private OidcIdToken createOidcToken(ClientRegistration clientRegistration, OAuth2AccessTokenResponse accessTokenResponse) { JwtDecoder jwtDecoder = this.jwtDecoderFactory.createDe...
return jwtDecoder.decode((String) parameters.get(OidcParameterNames.ID_TOKEN)); } catch (JwtException ex) { OAuth2Error invalidIdTokenError = new OAuth2Error(INVALID_ID_TOKEN_ERROR_CODE, ex.getMessage(), null); throw new OAuth2AuthenticationException(invalidIdTokenError, invalidIdTokenError.toString(), ex); ...
repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\oidc\authentication\OidcAuthorizationCodeAuthenticationProvider.java
1
请在Spring Boot框架中完成以下Java代码
class AdminParser extends AbstractSingleBeanDefinitionParser { private static final String CONNECTION_FACTORY_ATTRIBUTE = "connection-factory"; private static final String AUTO_STARTUP_ATTRIBUTE = "auto-startup"; private static final String IGNORE_DECLARATION_EXCEPTIONS = "ignore-declaration-exceptions"; @Overr...
// At least one of 'templateRef' or 'connectionFactoryRef' attribute must be set. if (!StringUtils.hasText(connectionFactoryRef)) { parserContext.getReaderContext().error("A '" + CONNECTION_FACTORY_ATTRIBUTE + "' attribute must be set.", element); } if (StringUtils.hasText(connectionFactoryRef)) { // ...
repos\spring-amqp-main\spring-rabbit\src\main\java\org\springframework\amqp\rabbit\config\AdminParser.java
2
请完成以下Java代码
public AdempiereServer[] getAll() { AdempiereServer[] retValue = new AdempiereServer[m_servers.size()]; m_servers.toArray(retValue); return retValue; } // getAll /** * Get Server with ID * * @param serverID server id * @return server or null */ public AdempiereServer getServer(String serverID) { ...
return "1.4"; } // getDescription /** * Get Number Servers * * @return no of servers */ public String getServerCount() { int noRunning = 0; int noStopped = 0; for (int i = 0; i < m_servers.size(); i++) { AdempiereServer server = m_servers.get(i); if (server.isAlive()) noRunning++; else...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\serverRoot\de.metas.adempiere.adempiere.serverRoot.base\src\main\java-legacy\org\compiere\server\AdempiereServerMgr.java
1
请在Spring Boot框架中完成以下Java代码
public class ProcessDefinitionImageResource extends BaseProcessDefinitionResource { @ApiOperation(value = "Get a process definition image", tags = { "Process Definitions" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the process-definitions are ...
try { return new ResponseEntity<>(IOUtils.toByteArray(imageStream), responseHeaders, HttpStatus.OK); } catch (Exception e) { throw new FlowableException("Error reading image stream", e); } } else { throw new FlowableIllegalA...
repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\repository\ProcessDefinitionImageResource.java
2
请完成以下Java代码
public String printArrayUsingForEachLoop(String[] empArray) { StringBuilder result = new StringBuilder(); for (String arr : empArray) { result.append(arr).append("\n"); } return result.toString().trim(); } // Print array content using Arrays.toString public Strin...
return Arrays.asList(empArray).toString(); } // Print array content using Streams public String printArrayUsingStreams(String[] empArray) { StringBuilder result = new StringBuilder(); Arrays.stream(empArray).forEach(e -> result.append(e).append("\n")); return result.toString().trim(...
repos\tutorials-master\core-java-modules\core-java-arrays-guides\src\main\java\com\baeldung\printarrays\PrintArrayJava.java
1
请在Spring Boot框架中完成以下Java代码
public class JsonPickingJobStep { @NonNull String pickingStepId; @NonNull JsonCompleteStatus completeStatus; @NonNull String productId; @NonNull String productName; @NonNull String uom; @NonNull BigDecimal qtyToPick; @NonNull JsonPickingJobStepPickFrom mainPickFrom; @NonNull List<JsonPickingJobStepPickFrom> p...
final JsonPickingJobStepPickFrom mainPickFrom = JsonPickingJobStepPickFrom.of(step.getPickFrom(PickingJobStepPickFromKey.MAIN), jsonOpts, getUOMSymbolById); final List<JsonPickingJobStepPickFrom> pickFromAlternatives = step.getPickFromKeys() .stream() .filter(PickingJobStepPickFromKey::isAlternative) .ma...
repos\metasfresh-new_dawn_uat\backend\de.metas.picking.rest-api\src\main\java\de\metas\picking\rest_api\json\JsonPickingJobStep.java
2
请完成以下Java代码
protected void prepare() { // Defaults p_DunningDate = Env.getContextAsDate(getCtx(), "#Date"); p_IsFullUpdate = false; for (ProcessInfoParameter para : getParametersAsArray()) { if (para.getParameter() == null) { // skip if no parameter value continue; } final String name = para.getPar...
for (final I_C_DunningLevel dunningLevel : dunningDAO.retrieveDunningLevels(dunning)) { generateCandidates(dunningLevel); } } return MSG_OK; } private void generateCandidates(final I_C_DunningLevel dunningLevel) { final IDunningBL dunningBL = Services.get(IDunningBL.class); trxManager.runInNewTr...
repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\process\C_Dunning_Candidate_Create.java
1
请在Spring Boot框架中完成以下Java代码
public void setCredentials(List<Credential> credentials) { this.credentials = credentials; } public static class Credential { /** * Locations of the X.509 certificate used for verification of incoming * SAML messages. */ private @Nullable Resource certificate; public @Nullable Re...
/** * Whether to redirect or post logout requests. */ private @Nullable Saml2MessageBinding binding; public @Nullable String getUrl() { return this.url; } public void setUrl(@Nullable String url) { this.url = url; } public @Nullable String getResponseUrl() { return this.responseUrl; } ...
repos\spring-boot-4.0.1\module\spring-boot-security-saml2\src\main\java\org\springframework\boot\security\saml2\autoconfigure\Saml2RelyingPartyProperties.java
2
请完成以下Java代码
public CountResultDto getCleanableHistoricBatchesReportCount(UriInfo uriInfo) { CleanableHistoricBatchReportDto queryDto = new CleanableHistoricBatchReportDto(objectMapper, uriInfo.getQueryParameters()); queryDto.setObjectMapper(objectMapper); CleanableHistoricBatchReport query = queryDto.toQuery(processEng...
} if (dto.isClearedRemovalTime()) { builder.clearedRemovalTime(); } builder.byIds(dto.getHistoricBatchIds()); builder.byQuery(historicBatchQuery); Batch batch = builder.executeAsync(); return BatchDto.fromBatch(batch); } }
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\impl\history\HistoricBatchRestServiceImpl.java
1
请完成以下Java代码
public Method getMethod() { // Get if not expired { final WeakReference<Method> weakRef = methodRef.get(); final Method method = weakRef != null ? weakRef.get() : null; if (method != null) { return method; } } // Load the class try { final Class<?> clazz = classRef.getReferencedClass...
return methodNew; } catch (final Exception ex) { throw new IllegalStateException("Cannot load expired field: " + classRef + "/" + methodName + " (" + parameterTypeRefs + ")", ex); } } @VisibleForTesting void forget() { methodRef.set(null); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\reflect\MethodReference.java
1
请完成以下Java代码
public static void ensureValidIndividualResourceIds(Class<? extends ProcessEngineException> exceptionClass, String message, Collection<String> ids) { ensureNotNull(exceptionClass, message, "id", ids); for (String id : ids) { ensureValidIndividualResourceId(exceptionClass, message, id); } } public...
protected static <T extends ProcessEngineException> T generateException(Class<T> exceptionClass, String message, String variableName, String description) { String formattedMessage = formatMessage(message, variableName, description); try { Constructor<T> constructor = exceptionClass.getConstructor(String....
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\util\EnsureUtil.java
1
请完成以下Java代码
public void setEntityType (String EntityType) { set_Value (COLUMNNAME_EntityType, EntityType); } /** Get Entitaets-Art. @return Dictionary Entity Type; Determines ownership and synchronization */ public String getEntityType () { return (String)get_Value(COLUMNNAME_EntityType); } /** Set Field Value....
public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Reihenfolge. @return Zur Bestimmung der Reihenfolge der Eintraege; die kleinste Zahl kommt zuerst */ public int getSeqNo () { Integer ii = (Integer)get_Value(COLUMNNAME_SeqNo); if (ii == null) return...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java-gen\org\adempiere\model\X_AD_TriggerUI_Action.java
1
请完成以下Java代码
public <T extends RepoIdAware> T getValueAsRepoIdOrNull(final @NonNull IntFunction<T> repoIdMapper) { final int idInt = getValueAsInt(-1); if (idInt < 0) { return null; } return repoIdMapper.apply(idInt); } public <T extends ReferenceListAwareEnum> T getValueAsRefListOrNull(@NonNull final Function<Stri...
this.joinAnd = joinAnd; return this; } public Builder setFieldName(final String fieldName) { this.fieldName = fieldName; return this; } public Builder setOperator(@NonNull final Operator operator) { this.operator = operator; return this; } public Builder setOperator() { operator =...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\DocumentFilterParam.java
1
请完成以下Java代码
public class HUProducerDestination extends AbstractProducerDestination { public static final HUProducerDestination of(final I_M_HU_PI huPI) { return new HUProducerDestination(huPI); } public static final HUProducerDestination of(@NonNull final HuPackingInstructionsId packingInstructionsId) { final I_M_HU_PI h...
@Override protected ArrayKey extractCurrentHUKey(final IAllocationRequest request) { // NOTE: in case of maxHUsToCreate == 1 try to load all products in one HU return maxHUsToCreate == 1 ? SHARED_CurrentHUKey : super.extractCurrentHUKey(request); } @Override public boolean isAllowCreateNewHU() { //...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\allocation\impl\HUProducerDestination.java
1
请在Spring Boot框架中完成以下Java代码
public class MonoTransformer { private final UserService userService; private final BookService bookService; public MonoTransformer(UserService userService, BookService bookService) { this.userService = userService; this.bookService = bookService; } public Mono<BookBorrowResponse>...
return book; }); } public Mono<Book> getFinalPricedBook(String bookId) { return bookService.getBook(bookId) .transform(this::applyTax) .transform(this::applyDiscount); } public Mono<Book> conditionalDiscount(String userId, String bookId) { return userSer...
repos\tutorials-master\spring-reactive-modules\spring-webflux\src\main\java\com\baeldung\spring\convertmonoobject\MonoTransformer.java
2
请完成以下Java代码
private boolean hasNonNullAttributeListValue(final I_M_AttributeInstance attributeInstance) { final AttributeValueId attributeValueId = AttributeValueId.ofRepoIdOrNull(attributeInstance.getM_AttributeValue_ID()); if (attributeValueId == null) { return false; } final AttributeId attributeId = AttributeId....
Stream.of(matchingConfigIfPresent, wildCardConfigIfPresent) .filter(Optional::isPresent) .map(Optional::get) .findFirst(); return attributeConfigIfPresent; } /** * Visible so that we can stub out the cache in tests. */ @VisibleForTesting ImmutableList<AttributeConfig> getAttributeConfigs() ...
repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\spi\ShipmentScheduleHandler.java
1
请在Spring Boot框架中完成以下Java代码
public class RuntimeParameterId implements RepoIdAware { @JsonCreator public static RuntimeParameterId ofRepoId(final int repoId) { return new RuntimeParameterId(repoId); } public static RuntimeParameterId ofRepoIdOrNull(final int repoId) { return repoId > 0 ? new RuntimeParameterId(repoId) : null; } publ...
int repoId; private RuntimeParameterId(final int repoId) { this.repoId = Check.assumeGreaterThanZero(repoId, "ExternalSystem_RuntimeParameter_ID"); } @Override @JsonValue public int getRepoId() { return repoId; } }
repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java\de\metas\externalsystem\process\runtimeparameters\RuntimeParameterId.java
2
请完成以下Java代码
public static UserDetails getCurrentUser() { UserDetailsService userDetailsService = SpringBeanHolder.getBean(UserDetailsService.class); return userDetailsService.loadUserByUsername(getCurrentUsername()); } /** * 获取当前用户的数据权限 * @return / */ public static List<Long> getCurrentU...
* * @return 系统用户名称 */ public static String getCurrentUsername(String token) { JWT jwt = JWTUtil.parseToken(token); return jwt.getPayload("sub").toString(); } /** * 获取Token * @return / */ public static String getToken() { HttpServletRequest request = ((Se...
repos\eladmin-master\eladmin-common\src\main\java\me\zhengjie\utils\SecurityUtils.java
1
请完成以下Java代码
public class JmxEndpointDiscoverer extends EndpointDiscoverer<ExposableJmxEndpoint, JmxOperation> implements JmxEndpointsSupplier { /** * Create a new {@link JmxEndpointDiscoverer} instance. * @param applicationContext the source application context * @param parameterValueMapper the parameter value mapper *...
OperationInvoker invoker) { return new DiscoveredJmxOperation(endpointId, operationMethod, invoker); } @Override protected OperationKey createOperationKey(JmxOperation operation) { return new OperationKey(operation.getName(), () -> "MBean call '" + operation.getName() + "'"); } static class JmxEndpointDiscov...
repos\spring-boot-4.0.1\module\spring-boot-actuator\src\main\java\org\springframework\boot\actuate\endpoint\jmx\annotation\JmxEndpointDiscoverer.java
1
请在Spring Boot框架中完成以下Java代码
private HUQRCode getQRCode(@NonNull final LU lu) {return huService.getQRCodeByHuId(lu.getId());} private HUQRCode getQRCode(@NonNull final TU tu) {return huService.getQRCodeByHuId(tu.getId());} private void addToPickingSlotQueue(final LUTUResult packedHUs) { final PickingSlotId pickingSlotId = getPickingSlotId()...
continue; } huIdsToAdd.add(tu.getId()); } if (!huIdsToAdd.isEmpty()) { pickingSlotService.addToPickingSlotQueue(pickingSlotId, huIdsToAdd); } } private Optional<PickingSlotId> getPickingSlotId() { return getPickingJob().getPickingSlotIdEffective(getLineId()); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java\de\metas\handlingunits\picking\job\service\commands\pick\PickingJobPickCommand.java
2
请在Spring Boot框架中完成以下Java代码
public User updateUser(User user) { if (ObjectUtil.isNull(user)) { throw new RuntimeException("用户id不能为null"); } userDao.updateTemplateById(user); return userDao.single(user.getId()); } /** * 查询单个用户 * * @param id 主键id * @return 用户信息 */ @Ov...
public List<User> getUserList() { return userDao.all(); } /** * 分页查询 * * @param currentPage 当前页 * @param pageSize 每页条数 * @return 分页用户列表 */ @Override public PageQuery<User> getUserByPage(Integer currentPage, Integer pageSize) { return userDao.createLambda...
repos\spring-boot-demo-master\demo-orm-beetlsql\src\main\java\com\xkcoding\orm\beetlsql\service\impl\UserServiceImpl.java
2
请完成以下Java代码
default ResultSet execute(@NonNull Statement<?> statement) { AsyncResultSet firstPage = getSafe(this.executeAsync(statement)); if (firstPage.hasMorePages()) { return new GuavaMultiPageResultSet(this, statement, firstPage); } else { return new SinglePageResultSet(firstPage...
default ListenableFuture<PreparedStatement> prepareAsync(SimpleStatement statement) { return this.execute(new DefaultPrepareRequest(statement), ASYNC_PREPARED); } default ListenableFuture<PreparedStatement> prepareAsync(String statement) { return this.prepareAsync(SimpleStatement.newInstance(st...
repos\thingsboard-master\common\dao-api\src\main\java\org\thingsboard\server\dao\cassandra\guava\GuavaSession.java
1
请完成以下Java代码
public final class LogoutTokenClaimNames { /** * {@code jti} - the JTI identifier */ public static final String JTI = "jti"; /** * {@code iss} - the Issuer identifier */ public static final String ISS = "iss"; /** * {@code sub} - the Subject identifier */ public static final String SUB = "sub"; /...
public static final String IAT = "iat"; /** * {@code events} - a JSON object that identifies this token as a logout token */ public static final String EVENTS = "events"; /** * {@code sid} - the session id for the OIDC provider */ public static final String SID = "sid"; private LogoutTokenClaimNames() {...
repos\spring-security-main\oauth2\oauth2-client\src\main\java\org\springframework\security\oauth2\client\oidc\authentication\logout\LogoutTokenClaimNames.java
1
请在Spring Boot框架中完成以下Java代码
public class ReplenishInfo { @NonNull Identifier identifier; @NonNull StockQtyAndUOMQty min; @NonNull StockQtyAndUOMQty max; Boolean highPriority; public MinMaxDescriptor toMinMaxDescriptor() { return MinMaxDescriptor.builder() .min(min.getStockQty().toBigDecimal()) .max(max.getStockQty().toBigDe...
@NonNull WarehouseId warehouseId; @Nullable LocatorId locatorId; public static Identifier of(@NonNull final WarehouseId warehouseId, @Nullable final LocatorId locatorId, @NonNull final ProductId productId) { return builder() .warehouseId(warehouseId) .locatorId(locatorId) .productId(produc...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\material\replenish\ReplenishInfo.java
2
请完成以下Java代码
public String getName () { return (String)get_Value(COLUMNNAME_Name); } /** Get Record ID/ColumnName @return ID/ColumnName pair */ public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName()); } /** Set Password. @param Password Password of any le...
@return Full URL address - e.g. http://www.adempiere.org */ public String getURL () { return (String)get_Value(COLUMNNAME_URL); } /** Set Registered EMail. @param UserName Email of the responsible for the System */ public void setUserName (String UserName) { set_Value (COLUMNNAME_UserName, UserNa...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_CM_Media_Server.java
1
请在Spring Boot框架中完成以下Java代码
public String getName() { return name; } public void setName(String name) { this.name = name; } public String getBlog() { return blog; } public void setBlog(String blog) { this.blog = blog; } public int getPhone() { return phone; }
public void setPhone(int phone) { this.phone = phone; } @Override public String toString() { return "Developer{" + "id=" + id + ", name='" + name + '\'' + ", blog='" + blog + '\'' + ", phone=" + phone + '}'; ...
repos\Spring-Boot-Advanced-Projects-main\Springboot-Annotation-LookService\src\main\java\spring\annotation\model\Developer.java
2
请在Spring Boot框架中完成以下Java代码
public String getUsernameInUpperCase() { return getUsername().toUpperCase(); } @PreAuthorize("hasAuthority('SYS_ADMIN')") public String getUsernameLC() { return getUsername().toLowerCase(); } @PreAuthorize("hasRole('ROLE_VIEWER') or hasRole('ROLE_EDITOR')") public boolean isVal...
} @PreFilter("filterObject != authentication.principal.username") public String joinUsernames(List<String> usernames) { return usernames.stream().collect(Collectors.joining(";")); } @PreFilter(value = "filterObject != authentication.principal.username", filterTarget = "usernames") public S...
repos\tutorials-master\spring-security-modules\spring-security-core\src\main\java\com\baeldung\methodsecurity\service\UserRoleService.java
2
请完成以下Java代码
public String toString() { StringBuffer sb = new StringBuffer ("X_M_ProductDownload[") .append(get_ID()).append("]"); return sb.toString(); } /** Set Download URL. @param DownloadURL URL of the Download files */ public void setDownloadURL (String DownloadURL) { set_Value (COLUM...
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ public void setName (String Name) { set_Value (COLUMNNAME_Name, Name); } /** Get Name. @return Alphanumeric identifie...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_ProductDownload.java
1
请完成以下Java代码
public class NewsComment { private Long commentId; private Long newsId; private String commentator; private String commentBody; private Byte commentStatus; private Byte isDeleted; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; public ...
public void setCommentStatus(Byte commentStatus) { this.commentStatus = commentStatus; } public Byte getIsDeleted() { return isDeleted; } public void setIsDeleted(Byte isDeleted) { this.isDeleted = isDeleted; } public Date getCreateTime() { return createTime; ...
repos\spring-boot-projects-main\SpringBoot咨询发布系统实战项目源码\springboot-project-news-publish-system\src\main\java\com\site\springboot\core\entity\NewsComment.java
1
请完成以下Java代码
public void setQty (final @Nullable BigDecimal Qty) { set_Value (COLUMNNAME_Qty, Qty); } @Override public BigDecimal getQty() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Qty); return bd != null ? bd : BigDecimal.ZERO; } /** * Type AD_Reference_ID=540534 * Reference name: GL_JournalLine...
/** Normal = N */ public static final String TYPE_Normal = "N"; /** Tax = T */ public static final String TYPE_Tax = "T"; @Override public void setType (final java.lang.String Type) { set_Value (COLUMNNAME_Type, Type); } @Override public java.lang.String getType() { return get_ValueAsString(COLUMNNAME_T...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_GL_JournalLine.java
1
请完成以下Java代码
public class StringPaddingUtil { public static String padLeftSpaces(String inputString, int length) { if (inputString.length() >= length) { return inputString; } StringBuilder sb = new StringBuilder(); while (sb.length() < length - inputString.length()) { sb....
return inputString; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < length; i++) { sb.append(' '); } return sb.substring(inputString.length()) + inputString; } public static String padLeftZeros(String inputString, int length) { return St...
repos\tutorials-master\core-java-modules\core-java-string-algorithms\src\main\java\com\baeldung\padding\StringPaddingUtil.java
1
请在Spring Boot框架中完成以下Java代码
public class JSONDocumentFilterParam { /** * Creates {@link JSONDocumentFilterParam} from {@link DocumentFilterParam} if the given filter is not internal. * * @return JSON document filter parameter */ /* package */static Optional<JSONDocumentFilterParam> of(final DocumentFilterParam filterParam, final JSONOp...
@JsonProperty("valueTo") Object valueTo; @JsonCreator @Builder private JSONDocumentFilterParam( @JsonProperty("parameterName") final String parameterName, @JsonProperty("value") final Object value, @JsonProperty("valueTo") final Object valueTo) { this.parameterName = parameterName; this.value = value...
repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\document\filter\json\JSONDocumentFilterParam.java
2
请完成以下Java代码
public Object renderTaskForm(TaskFormData taskForm) { if (taskForm.getFormKey() == null) { return null; } String formTemplateString = getFormTemplateString(taskForm, taskForm.getFormKey()); ScriptingEngines scriptingEngines = CommandContextUtil.getProcessEngineConfiguration()...
.scopeContainer(executionEntity); return scriptingEngines.evaluate(builder.build()).getResult(); } protected String getFormTemplateString(FormData formInstance, String formKey) { String deploymentId = formInstance.getDeploymentId(); ResourceEntity resourceStream = CommandContextUtil.ge...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\form\JuelFormEngine.java
1
请完成以下Java代码
public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName()); } /** Set Interest Area. @param R_InterestArea_ID Interest Area or Topic */ public void setR_InterestArea_ID (int R_InterestArea_ID) { if (R_InterestArea_ID < 1) set_ValueNoCheck (COLUMNNAME_R_InterestA...
/** 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); } /** Get Search Key. @return Search key for the record in the format required - must be unique */ public String getValue ...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_R_InterestArea.java
1
请完成以下Java代码
public class FormTypes { protected Map<String, AbstractFormType> formTypes = new HashMap<>(); public void addFormType(AbstractFormType formType) { formTypes.put(formType.getName(), formType); } public AbstractFormType parseFormPropertyType(FormProperty formProperty) { AbstractFormType...
// entries are defined Map<String, String> values = new LinkedHashMap<>(); for (FormValue formValue : formProperty.getFormValues()) { values.put(formValue.getId(), formValue.getName()); } formType = new EnumFormType(values); } else if (StringUtils...
repos\flowable-engine-main\modules\flowable-engine\src\main\java\org\flowable\engine\impl\form\FormTypes.java
1
请在Spring Boot框架中完成以下Java代码
public class CityController { @Autowired private CityService cityService; @RequestMapping public PageInfo<City> getAll(City city) { List<City> countryList = cityService.getAll(city); return new PageInfo<City>(countryList); } @RequestMapping(value = "/add") public City add(...
} @RequestMapping(value = "/delete/{id}") public ModelMap delete(@PathVariable Integer id) { ModelMap result = new ModelMap(); cityService.deleteById(id); result.put("msg", "删除成功!"); return result; } @RequestMapping(value = "/save", method = RequestMethod.POST) publ...
repos\MyBatis-Spring-Boot-master\src\main\java\tk\mybatis\springboot\controller\CityController.java
2
请完成以下Java代码
protected void prepare() { if (I_AD_Tab.Table_Name.equals(getTableName())) { p_AD_Tab_ID = getRecord_ID(); } } @Override protected String doIt() throws Exception { if (p_AD_Tab_ID <= 0) { throw new FillMandatoryException(I_AD_Tab.COLUMNNAME_AD_Tab_ID); } final I_AD_Tab adTab = InterfaceWrappe...
return MSG_OK; } private void copySingleLayoutToGridLayout(final I_AD_Tab adTab) { final List<I_AD_Field> adFields = Services.get(IADWindowDAO.class).retrieveFields(adTab); for (final I_AD_Field adField : adFields) { copySingleLayoutToGridLayout(adField); InterfaceWrapperHelper.save(adField); } } p...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\window\process\AD_Tab_SetGridLayoutFromSingleLayout.java
1
请在Spring Boot框架中完成以下Java代码
public class CostRevaluationLineId implements RepoIdAware { int repoId; @NonNull CostRevaluationId costRevaluationId; public static CostRevaluationLineId ofRepoId(@NonNull final CostRevaluationId costRevaluationId, final int costRevaluationLineId) { return new CostRevaluationLineId(costRevaluationId, costRevalu...
public static CostRevaluationLineId ofRepoIdOrNull( @Nullable final CostRevaluationId costRevaluationId, final int costRevaluationLineId) { return costRevaluationId != null && costRevaluationLineId > 0 ? ofRepoId(costRevaluationId, costRevaluationLineId) : null; } private CostRevaluationLineId(@NonNull fina...
repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\costrevaluation\CostRevaluationLineId.java
2
请完成以下Java代码
public String getEventType() { return eventSubscriptionDeclaration.getEventType(); } public String getEventName() { return eventSubscriptionDeclaration.getUnresolvedEventName(); } public String getActivityId() { return eventSubscriptionDeclaration.getActivityId(); } protected ExecutionEntity ...
return (List<EventSubscriptionJobDeclaration>) result; } else { return Collections.emptyList(); } } /** * Assumes that an activity has at most one declaration of a certain eventType. */ public static EventSubscriptionJobDeclaration findDeclarationForSubscription(EventSubscriptionEntity eventS...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\jobexecutor\EventSubscriptionJobDeclaration.java
1
请完成以下Java代码
public synchronized String getNextId() { if (lastId < nextId) { getNewBlock(); } long _nextId = nextId++; return Long.toString(_nextId); } protected synchronized void getNewBlock() { IdBlock idBlock = commandExecutor.execute(commandConfig, new GetNextIdBlockC...
this.idBlockSize = idBlockSize; } public CommandExecutor getCommandExecutor() { return commandExecutor; } public void setCommandExecutor(CommandExecutor commandExecutor) { this.commandExecutor = commandExecutor; } public CommandConfig getCommandConfig() { return comman...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\db\DbIdGenerator.java
1
请完成以下Java代码
public boolean isObserveOncePerRequest() { return this.observeOncePerRequest; } /** * Sets whether this filter apply only once per request. By default, this is * <code>false</code>, meaning the filter will execute on every request. Sometimes * users may wish it to execute more than once per request, such as ...
* @param filterAsyncDispatch whether the filter should be applied to async dispatch */ public void setFilterAsyncDispatch(boolean filterAsyncDispatch) { this.filterAsyncDispatch = filterAsyncDispatch; } private static class NoopAuthorizationEventPublisher implements AuthorizationEventPublisher { @Override ...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\access\intercept\AuthorizationFilter.java
1
请完成以下Java代码
public Result processWorkPackage(@NonNull final I_C_Queue_WorkPackage workpackage, final String localTrxName) { final List<I_C_Async_Batch> batches = queueDAO.retrieveAllItems(workpackage, I_C_Async_Batch.class); if (batches == null || batches.size() != 1) { throw new AdempiereException("There should always ...
{ throw new AdempiereException("@IAsyncBatchBL.keepAliveTimeExpired@"); } throw WorkpackageSkipRequestException.createWithTimeout("Not processed yet. Postponed!", getWorkpackageSkipTimeoutMillis(asyncBatch)); } private int getWorkpackageSkipTimeoutMillis(@NonNull final I_C_Async_Batch asyncBatch) { if (as...
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\processor\impl\CheckProcessedAsynBatchWorkpackageProcessor.java
1
请完成以下Java代码
public void setDateAcctFrom (final @Nullable java.sql.Timestamp DateAcctFrom) { set_Value (COLUMNNAME_DateAcctFrom, DateAcctFrom); } @Override public java.sql.Timestamp getDateAcctFrom() { return get_ValueAsTimestamp(COLUMNNAME_DateAcctFrom); } @Override public void setDateAcctTo (final java.sql.Timestam...
} /** * IsSOTrx AD_Reference_ID=319 * Reference name: _YesNo */ public static final int ISSOTRX_AD_Reference_ID=319; /** Yes = Y */ public static final String ISSOTRX_Yes = "Y"; /** No = N */ public static final String ISSOTRX_No = "N"; @Override public void setIsSOTrx (final @Nullable java.lang.String ...
repos\metasfresh-new_dawn_uat\backend\de.metas.datev\src\main\java-gen\de\metas\datev\model\X_DATEV_Export.java
1
请完成以下Java代码
public long getFinishedCaseInstanceCount() { return finishedCaseInstanceCount; } public void setFinishedCaseInstanceCount(long finishedCaseInstanceCount) { this.finishedCaseInstanceCount = finishedCaseInstanceCount; } public long getCleanableCaseInstanceCount() { return cleanableCaseInstanceCount;...
public static List<CleanableHistoricCaseInstanceReportResultDto> convert(List<CleanableHistoricCaseInstanceReportResult> reportResult) { List<CleanableHistoricCaseInstanceReportResultDto> dtos = new ArrayList<CleanableHistoricCaseInstanceReportResultDto>(); for (CleanableHistoricCaseInstanceReportResult current...
repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\CleanableHistoricCaseInstanceReportResultDto.java
1
请完成以下Java代码
public java.lang.String getExportXML () { return (java.lang.String)get_Value(COLUMNNAME_ExportXML); } /** Set Defer Constraints. @param IsDeferredConstraints Defer Constraints */ @Override public void setIsDeferredConstraints (boolean IsDeferredConstraints) { set_Value (COLUMNNAME_IsDeferredConstraints,...
@param SeqNo Method of ordering records; lowest number comes first */ @Override public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Sequence. @return Method of ordering records; lowest number comes first */ @Override public int getSeqNo () { Intege...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\adempiere\ad\migration\model\X_AD_Migration.java
1
请完成以下Java代码
public void writeLine(Line line) { try { if (CSVWriter == null) initWriter(); String[] lineStr = new String[2]; lineStr[0] = line.getName(); lineStr[1] = line .getAge() .toString(); CSVWriter.writeNext(lineStr); } ca...
} if (fileWriter == null) fileWriter = new FileWriter(file, true); if (CSVWriter == null) CSVWriter = new CSVWriter(fileWriter); } public void closeWriter() { try { CSVWriter.close(); fileWriter.close(); } catch (IOException e) { logger.error(...
repos\tutorials-master\spring-batch\src\main\java\com\baeldung\taskletsvschunks\utils\FileUtils.java
1
请完成以下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 org.eevolution.model.I_PP_Product_BOM getPP_Product_BOM() { return get_ValueAsPO(COLUMNNAME_PP_Product_BO...
@Override public void setPP_Product_BOM_ID (final int PP_Product_BOM_ID) { if (PP_Product_BOM_ID < 1) set_Value (COLUMNNAME_PP_Product_BOM_ID, null); else set_Value (COLUMNNAME_PP_Product_BOM_ID, PP_Product_BOM_ID); } @Override public int getPP_Product_BOM_ID() { return get_ValueAsInt(COLUMNNAME_P...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Order_CompensationGroup.java
1
请完成以下Java代码
public class TemplateMsgApi extends BaseApi { private static final Logger LOG = LoggerFactory.getLogger(TemplateMsgApi.class); private ApiConfig apiConfig; public TemplateMsgApi(ApiConfig apiConfig) { this.apiConfig = apiConfig; } /** * 设置行业 * * @param industry 行业参数 ...
} /** * 发送模版消息 * * @param msg 消息 * @return 发送结果 */ public SendTemplateResponse send(TemplateMsg msg) { LOG.debug("发送模版消息......"); BeanUtil.requireNonNull(msg.getTouser(), "openid is null"); BeanUtil.requireNonNull(msg.getTemplateId(), "template_id is null"); ...
repos\spring-boot-quick-master\quick-wx-public\src\main\java\com\wx\pn\api\TemplateMsgApi.java
1
请在Spring Boot框架中完成以下Java代码
public class Student { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) private long id; private String name; @ManyToOne private School school; public long getId() { return id; } public void setId(long id) { this.id = id;
} public String getName() { return name; } public void setName(String name) { this.name = name; } public School getSchool() { return school; } public void setSchool(School school) { this.school = school; } }
repos\tutorials-master\persistence-modules\spring-data-jpa-crud\src\main\java\com\baeldung\batchinserts\model\Student.java
2
请完成以下Java代码
private boolean isNotX509PemWrapper(String line) { return !X509_PEM_HEADER.equals(line) && !X509_PEM_FOOTER.equals(line); } } private static class X509CertificateDecoder implements Converter<List<String>, RSAPublicKey> { private final CertificateFactory certificateFactory; X509CertificateDecoder(Certific...
.generateCertificate(x509CertStream); return (RSAPublicKey) certificate.getPublicKey(); } catch (CertificateException | IOException ex) { throw new IllegalArgumentException(ex); } } private boolean isNotX509CertificateWrapper(String line) { return !X509_CERT_HEADER.equals(line) && !X509_CERT_FO...
repos\spring-security-main\core\src\main\java\org\springframework\security\converter\RsaKeyConverters.java
1
请完成以下Java代码
public void setDataEntry_SubTab_ID (int DataEntry_SubTab_ID) { if (DataEntry_SubTab_ID < 1) set_ValueNoCheck (COLUMNNAME_DataEntry_SubTab_ID, null); else set_ValueNoCheck (COLUMNNAME_DataEntry_SubTab_ID, Integer.valueOf(DataEntry_SubTab_ID)); } /** Get Unterregister. @return Unterregister */ @Overr...
return (java.lang.String)get_Value(COLUMNNAME_Name); } /** Set Reihenfolge. @param SeqNo Zur Bestimmung der Reihenfolge der Einträge; die kleinste Zahl kommt zuerst */ @Override public void setSeqNo (int SeqNo) { set_Value (COLUMNNAME_SeqNo, Integer.valueOf(SeqNo)); } /** Get Reihenfolge. @return Z...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\dataentry\model\X_DataEntry_SubTab.java
1
请在Spring Boot框架中完成以下Java代码
public class LogAspect { private final SysLogService sysLogService; ThreadLocal<Long> currentTime = new ThreadLocal<>(); public LogAspect(SysLogService sysLogService) { this.sysLogService = sysLogService; } /** * 配置切入点 */ @Pointcut("@annotation(me.zhengjie.annotation.Log)")...
SysLog sysLog = new SysLog("ERROR",System.currentTimeMillis() - currentTime.get()); currentTime.remove(); sysLog.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes()); HttpServletRequest request = RequestHolder.getHttpServletRequest(); sysLogService.save(getUsername(), StringUtil...
repos\eladmin-master\eladmin-logging\src\main\java\me\zhengjie\aspect\LogAspect.java
2
请完成以下Java代码
private static class QueueFilter implements IQueryFilter<I_C_Queue_WorkPackage> { private final IWorkPackageQuery packageQuery; public QueueFilter(final IWorkPackageQuery packageQuery) { this.packageQuery = packageQuery; } @Override public boolean accept(final I_C_Queue_WorkPackage workpackage) { ...
if (packageProcessorIds.isEmpty()) { slogger.warn("There were no package processor Ids set in the package query. This could be a posible development error" +"\n Package query: "+packageQuery); } final QueuePackageProcessorId packageProcessorId = QueuePackageProcessorId.ofRepoId(workpackage.getC_...
repos\metasfresh-new_dawn_uat\backend\de.metas.async\src\main\java\de\metas\async\api\impl\PlainQueueDAO.java
1
请完成以下Java代码
public class X_C_LicenseFeeSettings extends org.compiere.model.PO implements I_C_LicenseFeeSettings, org.compiere.model.I_Persistent { private static final long serialVersionUID = 79387114L; /** Standard Constructor */ public X_C_LicenseFeeSettings (final Properties ctx, final int C_LicenseFeeSettings_ID, @...
} @Override public int getCommission_Product_ID() { return get_ValueAsInt(COLUMNNAME_Commission_Product_ID); } @Override public void setDescription (final @Nullable java.lang.String Description) { set_Value (COLUMNNAME_Description, Description); } @Override public java.lang.String getDescription() {...
repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java-gen\de\metas\contracts\commission\model\X_C_LicenseFeeSettings.java
1
请完成以下Java代码
public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } @Override public int hashCode() { final int prime = 31; int result = 1; re...
return false; Book other = (Book) obj; if (author == null) { if (other.author != null) return false; } else if (!author.equals(other.author)) return false; if (id != other.id) return false; if (title == null) { if (o...
repos\tutorials-master\spring-boot-modules\spring-boot-bootstrap\src\main\java\com\baeldung\persistence\model\Book.java
1
请在Spring Boot框架中完成以下Java代码
private ScpClientUtil getScpClientUtil(String ip) { ServerDeployDto serverDeployDTO = serverDeployService.findByIp(ip); if (serverDeployDTO == null) { sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR); throw new BadRequestException("IP对应服务器信息不存在:" + ip); } return ScpClientUtil.getInstance(ip, serverDeployDTO.g...
} } @Override public void download(List<DeployDto> queryAll, HttpServletResponse response) throws IOException { List<Map<String, Object>> list = new ArrayList<>(); for (DeployDto deployDto : queryAll) { Map<String,Object> map = new LinkedHashMap<>(); map.put("应用名称", deployDto.getApp().getName()); map.p...
repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\maint\service\impl\DeployServiceImpl.java
2
请完成以下Java代码
public void setIsUserElement2Dim (boolean IsUserElement2Dim) { set_Value (COLUMNNAME_IsUserElement2Dim, Boolean.valueOf(IsUserElement2Dim)); } /** Get User Element 2 Dimension. @return Include User Element 2 as a cube dimension */ public boolean isUserElement2Dim () { Object oo = get_Value(COLUMNNAME_Is...
} /** Set Report Cube. @param PA_ReportCube_ID Define reporting cube for pre-calculation of summary accounting data. */ public void setPA_ReportCube_ID (int PA_ReportCube_ID) { if (PA_ReportCube_ID < 1) set_ValueNoCheck (COLUMNNAME_PA_ReportCube_ID, null); else set_ValueNoCheck (COLUMNNAME_PA_Re...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_PA_ReportCube.java
1
请完成以下Java代码
public List<IdentityLink> execute(CommandContext commandContext) { ensureNotNull("taskId", taskId); TaskManager taskManager = commandContext.getTaskManager(); TaskEntity task = taskManager.findTaskById(taskId); ensureNotNull("Cannot find task with id " + taskId, "task", task); checkGetIdentityLink...
identityLink.setTask(task); identityLink.setType(IdentityLinkType.ASSIGNEE); identityLinks.add(identityLink); } if (task.getOwner() != null) { IdentityLinkEntity identityLink = new IdentityLinkEntity(); identityLink.setUserId(task.getOwner()); identityLink.setTask(task); iden...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\GetIdentityLinksForTaskCmd.java
1
请在Spring Boot框架中完成以下Java代码
public List<CountryType> getCountryOfOrigin() { if (countryOfOrigin == null) { countryOfOrigin = new ArrayList<CountryType>(); } return this.countryOfOrigin; } /** * Gets the value of the confirmedCountryOfOrigin property. * * <p> * This accessor method ...
* * * <p> * Objects of the following type(s) are allowed in the list * {@link CountryType } * * */ public List<CountryType> getConfirmedCountryOfOrigin() { if (confirmedCountryOfOrigin == null) { confirmedCountryOfOrigin = new ArrayList<CountryType>(); ...
repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\AdditionalInformationType.java
2
请完成以下Java代码
public void setTaskId(String taskId) { this.taskId = taskId; } public Date getTimeStamp() { return timeStamp; } public void setTimeStamp(Date timeStamp) { this.timeStamp = timeStamp; } public String getUserId() { return userId; } public void setUserId(...
public void setLockOwner(String lockOwner) { this.lockOwner = lockOwner; } public String getLockTime() { return lockTime; } public void setLockTime(String lockTime) { this.lockTime = lockTime; } public int getProcessed() { return isProcessed; } public ...
repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\EventLogEntryEntityImpl.java
1
请完成以下Java代码
public void checkUpdateUserOperationLog(UserOperationLogEntry entry) { if (entry != null && !getTenantManager().isAuthenticatedTenant(entry.getTenantId())) { throw LOG.exceptionCommandWithUnauthorizedTenant("update the user operation log entry '" + entry.getId() + "'"); } } @Override public void ch...
@Override public void checkRegisterDeployment() { } @Override public void checkUnregisterDeployment() { } @Override public void checkDeleteMetrics() { } @Override public void checkDeleteTaskMetrics() { } @Override public void checkReadSchemaLog() { } // helper ////////////////////////...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cfg\multitenancy\TenantCommandChecker.java
1
请完成以下Java代码
public PostingException setFact(final Fact fact) { _fact = fact; resetMessageBuilt(); return this; } public Fact getFact() { return _fact; } private FactLine getFactLine() { return _factLine; } public PostingException setFactLine(final FactLine factLine) { this._factLine = factLine; resetMess...
} public DocLine<?> getDocLine() { return _docLine; } @SuppressWarnings("unused") public PostingException setLogLevel(@NonNull final Level logLevel) { this._logLevel = logLevel; return this; } /** * @return recommended log level to be used when reporting this issue */ public Level getLogLevel() {...
repos\metasfresh-new_dawn_uat\backend\de.metas.acct.base\src\main\java\de\metas\acct\doc\PostingException.java
1
请完成以下Java代码
public void setC_Invoice_Verification_SetLine(final org.compiere.model.I_C_Invoice_Verification_SetLine C_Invoice_Verification_SetLine) { set_ValueFromPO(COLUMNNAME_C_Invoice_Verification_SetLine_ID, org.compiere.model.I_C_Invoice_Verification_SetLine.class, C_Invoice_Verification_SetLine); } @Override public vo...
public void setRun_Tax_ID (final int Run_Tax_ID) { if (Run_Tax_ID < 1) set_Value (COLUMNNAME_Run_Tax_ID, null); else set_Value (COLUMNNAME_Run_Tax_ID, Run_Tax_ID); } @Override public int getRun_Tax_ID() { return get_ValueAsInt(COLUMNNAME_Run_Tax_ID); } @Override public void setRun_Tax_Lookup_Lo...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Invoice_Verification_RunLine.java
1
请完成以下Java代码
public class Employee { private String privateId; private String name; private boolean manager; public Employee(String id, String name) { setPrivateId(id); setName(name); } private Employee(String id, String name, boolean managerAttribute) { this.privateId = id; ...
public boolean isManager() { return manager; } public void elevateToManager() { if ("Carl".equals(this.name)) { setManager(true); } } private void setManager(boolean manager) { this.manager = manager; } public String getName() { return ...
repos\tutorials-master\core-java-modules\core-java-lang-oop-modifiers-2\src\main\java\com\baeldung\privatemodifier\Employee.java
1
请完成以下Java代码
public class DefaultDunningCandidateProducerFactory implements IDunningCandidateProducerFactory { private final List<Class<? extends IDunningCandidateProducer>> producerClasses = new ArrayList<Class<? extends IDunningCandidateProducer>>(); private final List<IDunningCandidateProducer> producers = new ArrayList<IDunn...
} if (selectedProducer != null) { throw new DunningException("Multiple producers found for " + sourceDoc + ": " + selectedProducer + ", " + producer); } selectedProducer = producer; } if (selectedProducer == null) { throw new DunningException("No " + IDunningCandidateProducer.class + " found...
repos\metasfresh-new_dawn_uat\backend\de.metas.dunning\src\main\java\de\metas\dunning\api\impl\DefaultDunningCandidateProducerFactory.java
1
请完成以下Java代码
String formatFilters(@Nullable List<Filter> filters) { StringBuilder sb = new StringBuilder(); sb.append("Security filter chain: "); if (filters == null) { sb.append("no match"); } else if (filters.isEmpty()) { sb.append("[] empty (bypassed by security='none') "); } else { sb.append("[\n"); fo...
return this.filterChainProxy; } static class DebugRequestWrapper extends HttpServletRequestWrapper { private static final Logger logger = new Logger(); DebugRequestWrapper(HttpServletRequest request) { super(request); } @Override public HttpSession getSession() { boolean sessionExists = super.getS...
repos\spring-security-main\web\src\main\java\org\springframework\security\web\debug\DebugFilter.java
1
请完成以下Java代码
public void execute(T execution) { CoreModelElement scope = getScope(execution); List<DelegateListener<? extends BaseDelegateExecution>> listeners = execution.hasFailedOnEndListeners() ? getBuiltinListeners(scope) : getListeners(scope, execution); int listenerIndex = execution.getListenerInd...
if(execution.isSkipCustomListeners()) { return getBuiltinListeners(scope); } else { return scope.getListeners(getEventName()); } } protected List<DelegateListener<? extends BaseDelegateExecution>> getBuiltinListeners(CoreModelElement scope) { return scope.getBuiltInListeners(getEventName())...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\core\operation\AbstractEventAtomicOperation.java
1
请在Spring Boot框架中完成以下Java代码
public Object aggregationGroupFirst() { // 先对数据进行排序,然后使用管道操作符 $group 进行分组,最后统计各个组文档某字段值第一个值 AggregationOperation sort = Aggregation.sort(Sort.by("salary").ascending()); AggregationOperation group = Aggregation.group("sex").first("salary").as("salaryFirst"); // 将操作加入到聚合对象中 Aggrega...
AggregationResults<Map> results = mongoTemplate.aggregate(aggregation, COLLECTION_NAME, Map.class); for (Map result : results.getMappedResults()) { log.info("{}", result); } return results.getMappedResults(); } /** * 使用管道操作符 $group 结合表达式操作符 $push 获取某字段列表 * * @...
repos\springboot-demo-master\mongodb\src\main\java\demo\et\mongodb\service\AggregateGroupService.java
2
请完成以下Java代码
private void clear() { // if (m_lookup != null) // { // m_lookup.clear(); // } if (m_lookupDirect != null) { m_lookupDirect.clear(); } } static ArrayKey createValidationKey(final IValidationContext validationCtx, final MLookupInfo lookupInfo, final Object parentValidationKey) { final List<Object...
public MLookupInfo getLookupInfo() { return m_info; } @Override public Set<String> getParameters() { return m_info.getValidationRule().getAllParameters(); } @Override public IValidationContext getValidationContext() { return m_evalCtx; } public boolean isNumericKey() { return getColumnName().ends...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\model\MLookup.java
1
请完成以下Java代码
protected org.compiere.model.POInfo initPO(final Properties ctx) { return org.compiere.model.POInfo.getPOInfo(Table_Name); } @Override public void setC_User_Role_ID (final int C_User_Role_ID) { if (C_User_Role_ID < 1) set_ValueNoCheck (COLUMNNAME_C_User_Role_ID, null); else set_ValueNoCheck (COLUMNN...
{ return get_ValueAsBoolean(COLUMNNAME_IsUniqueForBPartner); } @Override public void setName (final @Nullable java.lang.String Name) { set_Value (COLUMNNAME_Name, Name); } @Override public java.lang.String getName() { return get_ValueAsString(COLUMNNAME_Name); } }
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_User_Role.java
1
请完成以下Java代码
public void setLength (final @Nullable BigDecimal Length) { set_Value (COLUMNNAME_Length, Length); } @Override public BigDecimal getLength() { final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_Length); return bd != null ? bd : BigDecimal.ZERO; } @Override public void setMaxLoadWeight (final @Nulla...
} @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 setStackabilityFactor (final int StackabilityFactor) { set_Value (COLUMNNAME_Stackabi...
repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_PackingMaterial.java
1
请完成以下Java代码
public static RemoteCall<Lottery> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) { return deployRemoteCall(Lottery.class, web3j, credentials, contractGasProvider, BINARY, ""); } public static RemoteCall<Lottery> deploy(Web3j web3j, TransactionManager transactionMa...
} @Deprecated public static Lottery load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { return new Lottery(contractAddress, web3j, transactionManager, gasPrice, gasLimit); } public static Lottery load(String contractAddre...
repos\springboot-demo-master\Blockchain\src\main\java\com\et\bc\model\Lottery.java
1
请完成以下Java代码
public int getM_PropertiesConfig_Line_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_M_PropertiesConfig_Line_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Name. @param Name Alphanumeric identifier of the entity */ @Override public void setName (java.lang.String Name) { s...
} /** Set Suchschlüssel. @param Value Suchschlüssel für den Eintrag im erforderlichen Format - muss eindeutig sein */ @Override public void setValue (java.lang.String Value) { set_Value (COLUMNNAME_Value, Value); } /** Get Suchschlüssel. @return Suchschlüssel für den Eintrag im erforderlichen Format...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PropertiesConfig_Line.java
1
请完成以下Java代码
public static Integer findMajorityElementUsingSorting(int[] nums) { Arrays.sort(nums); int majorityThreshold = nums.length / 2; int count = 0; for (int i = 0; i < nums.length; i++) { if (nums[i] == nums[majorityThreshold]) { count++; } ...
System.out.println("Iteration " + i + ": [candidate - " + candidate + ", count - " + count + ", element - " + nums[i] + "]"); } count = 0; for (int num : nums) { if (num == candidate) { count++; } } return count > majorityThreshold ? candi...
repos\tutorials-master\core-java-modules\core-java-arrays-operations-advanced-2\src\main\java\com\baeldung\majorityelement\FindMajorityElement.java
1
请完成以下Java代码
public static void applyNotOperatorToAnExpression_example1() { int count = 2; System.out.println(!(count > 2)); // prints true System.out.println(!(count <= 2)); // prints false } public static void applyNotOperatorToAnExpression_LogicalOperators() { boolean x = true; ...
public static void pitfalls_simplifyComplexConditionsByReversingLogicExample() { int count = 9; int total = 100; if (count < 10 && total < 1000) { System.out.println("Some more work to do"); } } public static void exitEarlyExample() { boolean isValid = false...
repos\tutorials-master\core-java-modules\core-java-lang-syntax-2\src\main\java\com\baeldung\core\operators\notoperator\NotOperator.java
1
请完成以下Java代码
public void exportExcel(HttpServletResponse response) { List<Person> list = new ArrayList<>(); list.add(new Person(1L, "姓名1", 28, "地址1")); list.add(new Person(2L, "姓名2", 29, "地址2")); String[] headers = new String[]{"ID", "名称", "年龄", "地址"}; List<String[]> contents = new ArrayLis...
list.add(new Person(2L, "姓名2", 29, "地址2")); List<List<Object>> dataList = list.stream().map(person -> { List<Object> data = new ArrayList<>(); data.add(person.getId()); data.add(person.getName()); data.add(person.getAge()); data.add(person.getAddress(...
repos\spring-boot-student-master\spring-boot-student-export\src\main\java\com\xiaolyuh\ExprotController.java
1
请完成以下Java代码
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; JobEntity other = (JobEntity) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id...
this.failedActivityId = failedActivityId; } public String getBatchId() { return batchId; } public void setBatchId(String batchId) { this.batchId = batchId; } @Override public String toString() { return this.getClass().getSimpleName() + "[id=" + id + ", revision=" + rev...
repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\persistence\entity\JobEntity.java
1
请完成以下Java代码
public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getAddressName() { return addressName; } public void setAddressName(String addressName) { this.addressName = addressName; } public Integer getSendStatus() { ...
public String getRegion() { return region; } public void setRegion(String region) { this.region = region; } public String getDetailAddress() { return detailAddress; } public void setDetailAddress(String detailAddress) { this.detailAddress = detailAddress; }...
repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\OmsCompanyAddress.java
1
请在Spring Boot框架中完成以下Java代码
public <T extends DeliveryMethodNotificationTemplate> T getProcessedTemplate(NotificationDeliveryMethod deliveryMethod, NotificationRecipient recipient) { T template = (T) templates.get(deliveryMethod); if (recipient != null) { Map<String, String> additionalTemplateContext = createTemplateCo...
if (StringUtils.isNotEmpty(value)) { value = TemplateUtils.processTemplate(value, templateContext); templatableValue.set(value); } }); return template; } private Map<String, String> createTemplateContextForRecipient(NotificationRecipient recipient) { ...
repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\notification\NotificationProcessingContext.java
2
请完成以下Java代码
public static class CreatePartitionAsyncRequest extends CreatePartitionRequest { private final int count; private final Date dontReEnqueueAfter; private final CreatePartitionRequest partitionRequest; private CreatePartitionAsyncRequest( final CreatePartitionRequest partitionRequest, final int count,...
return count; } /** * Don't enqueue another workpackage after the given time has passed. One intended usage scenario is to start partitioning in the evening and stop in the morning. * * @return never returns <code>null</code>, but might return <code>9999-12-31</code>. */ public Date getDontReEnqueueA...
repos\metasfresh-new_dawn_uat\backend\de.metas.dlm\base\src\main\java\de\metas\dlm\partitioner\PartitionRequestFactory.java
1
请完成以下Java代码
public <T extends ModelElementInstance> ModelElementTypeBuilder instanceProvider(ModelTypeInstanceProvider<T> instanceProvider) { modelType.setInstanceProvider(instanceProvider); return this; } public ModelElementTypeBuilder namespaceUri(String namespaceUri) { modelType.setTypeNamespace(namespaceUri); ...
NamedEnumAttributeBuilder<V> builder = new NamedEnumAttributeBuilder<V>(attributeName, modelType, enumType); modelBuildOperations.add(builder); return builder; } public ModelElementType build() { model.registerType(modelType, instanceType); return modelType; } public ModelElementTypeBuilder ab...
repos\camunda-bpm-platform-master\model-api\xml-model\src\main\java\org\camunda\bpm\model\xml\impl\type\ModelElementTypeBuilderImpl.java
1
请完成以下Java代码
public BigDecimal getSetupTime () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_SetupTime); if (bd == null) return Env.ZERO; return bd; } /** Set Teardown Time. @param TeardownTime Time at the end of the operation */ public void setTeardownTime (BigDecimal TeardownTime) { set_Value (COLU...
/** Set Runtime per Unit. @param UnitRuntime Time to produce one unit */ public void setUnitRuntime (BigDecimal UnitRuntime) { set_Value (COLUMNNAME_UnitRuntime, UnitRuntime); } /** Get Runtime per Unit. @return Time to produce one unit */ public BigDecimal getUnitRuntime () { BigDecimal bd = (...
repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_OperationResource.java
1