instruction string | input string | output string | source_file string | priority int64 |
|---|---|---|---|---|
请完成以下Java代码 | private boolean isString(Serializable object) {
return object.getClass().isAssignableFrom(String.class);
}
void setConversionService(ConversionService conversionService) {
Assert.notNull(conversionService, "conversionService must not be null");
this.conversionService = conversionService;
}
private static cl... | }
}
private static class StringToUUIDConverter implements Converter<String, UUID> {
@Override
public UUID convert(String identifierAsString) {
if (identifierAsString == null) {
throw new ConversionFailedException(TypeDescriptor.valueOf(String.class),
TypeDescriptor.valueOf(UUID.class), null, null)... | repos\spring-security-main\acl\src\main\java\org\springframework\security\acls\jdbc\AclClassIdUtils.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static PhonecallSchedule toPhonecallSchedule(final I_C_Phonecall_Schedule record)
{
final PhonecallSchemaVersionId schemaVersionId = PhonecallSchemaVersionId.ofRepoId(
record.getC_Phonecall_Schema_ID(),
record.getC_Phonecall_Schema_Version_ID());
return PhonecallSchedule.builder()
.orgId(OrgId.ofRepoI... | scheduleRecord.setIsCalled(true);
scheduleRecord.setIsOrdered(true);
saveRecord(scheduleRecord);
}
public void markAsCalled(@NonNull final PhonecallSchedule schedule)
{
final I_C_Phonecall_Schedule scheduleRecord = load(schedule.getId(), I_C_Phonecall_Schedule.class);
scheduleRecord.setIsCalled(true);
... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java\de\metas\phonecall\service\PhonecallScheduleRepository.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public Mono<UserCacheObject> get(@RequestParam("id") Integer id) {
String key = genKey(id);
return commonRedisTemplate.opsForValue().get(key)
.map(o -> (UserCacheObject) o);
}
/**
* 设置指定用户的信息
*
* @param user 用户
* @return 是否成功
*/
@PostMapping("/set")
... | /**
* 设置指定用户的信息
*
* @param user 用户
* @return 是否成功
*/
@PostMapping("/v2/set")
public Mono<Boolean> setV2(UserCacheObject user) {
String key = genKeyV2(user.getId());
return userRedisTemplate.opsForValue().set(key, user);
}
private static String genKeyV2(Integer i... | repos\SpringBoot-Labs-master\lab-27\lab-27-webflux-redis\src\main\java\cn\iocoder\springboot\lab27\springwebflux\controller\UserController.java | 2 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getIsbn() {
return isbn;
}
public void ... | if (getClass() != obj.getClass()) {
return false;
}
BusinessKeyBook other = (BusinessKeyBook) obj;
return Objects.equals(isbn, other.getIsbn());
}
@Override
public int hashCode() {
return Objects.hash(isbn);
}
} | repos\Hibernate-SpringBoot-master\HibernateSpringBootLombokEqualsAndHashCode\src\main\java\com\app\BusinessKeyBook.java | 1 |
请完成以下Java代码 | public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Name.
@param Name
Alphanumer... | */
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Set Valid to.
@param ValidTo
Valid to including this date (last day)
*/
public void setValidTo (Timestamp ValidTo)
{
set_Value (COLUMNNAME_ValidTo, ValidTo);
}
/** Get Valid to.
@return Va... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_B_Buyer.java | 1 |
请完成以下Java代码 | public class VariableScopeResolver implements Resolver {
protected VariableScope variableScope;
protected String variableScopeKey = "execution";
public VariableScopeResolver(VariableScope variableScope) {
if (variableScope == null) {
throw new ActivitiIllegalArgumentException("variable... | @Override
public boolean containsKey(Object key) {
return variableScopeKey.equals(key) || variableScope.hasVariable((String) key);
}
@Override
public Object get(Object key) {
if (variableScopeKey.equals(key)) {
return variableScope;
}
return variableScope.ge... | repos\flowable-engine-main\modules\flowable5-engine\src\main\java\org\activiti\engine\impl\scripting\VariableScopeResolver.java | 1 |
请在Spring Boot框架中完成以下Java代码 | Output decodeJpeg(Output contents, long channels) {
return g.opBuilder("DecodeJpeg", "DecodeJpeg", scope)
.addInput(contents)
.setAttr("channels", channels)
.build()
.output(0);
}
Output<? extends TType> constant(String name, T... | private final Graph g;
}
@PreDestroy
public void close() {
session.close();
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class LabelWithProbability {
private String label;
private float probability;
private long elapsed;
}
} | repos\springboot-demo-master\Tensorflow\src\main\java\com\et\tf\service\ClassifyImageService.java | 2 |
请完成以下Java代码 | public int getC_BPartner_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Kleinunternehmer-Steuerbefreiung .
@param C_VAT_SmallBusiness_ID Kleinunternehmer-Steuerbefreiung */
@Override
public void setC_VAT_SmallBusiness_ID... | }
/** Get Gültig ab.
@return Gültig ab inklusiv (erster Tag)
*/
@Override
public java.sql.Timestamp getValidFrom ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_ValidFrom);
}
/** Set Gültig bis.
@param ValidTo
Gültig bis inklusiv (letzter Tag)
*/
@Override
public void setValidTo (java.sql... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\de\metas\tax\model\X_C_VAT_SmallBusiness.java | 1 |
请完成以下Java代码 | public void setQtyCalculated (final @Nullable BigDecimal QtyCalculated)
{
set_Value (COLUMNNAME_QtyCalculated, QtyCalculated);
}
@Override
public BigDecimal getQtyCalculated()
{
final BigDecimal bd = get_ValueAsBigDecimal(COLUMNNAME_QtyCalculated);
return bd != null ? bd : BigDecimal.ZERO;
}
@Override
... | {
return get_ValueAsString(COLUMNNAME_UOM);
}
@Override
public void setWarehouseValue (final java.lang.String WarehouseValue)
{
set_Value (COLUMNNAME_WarehouseValue, WarehouseValue);
}
@Override
public java.lang.String getWarehouseValue()
{
return get_ValueAsString(COLUMNNAME_WarehouseValue);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_I_Forecast.java | 1 |
请完成以下Java代码 | private void buildDetailsRecurse(
@NonNull final DocumentLayoutDetailDescriptor detail,
@NonNull final ImmutableMap.Builder<DetailId, DocumentLayoutDetailDescriptor> map)
{
putIfNotEmpty(detail, map);
for (final DocumentLayoutDetailDescriptor subDetail : detail.getSubTabLayouts())
{
buildDetailsR... | return _gridView;
}
public Builder addDetail(@Nullable final DocumentLayoutDetailDescriptor detail)
{
if (detail == null)
{
return this;
}
if (detail.isEmpty())
{
logger.trace("Skip adding detail to layout because it is empty; detail={}", detail);
return this;
}
details.add(deta... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentLayoutDescriptor.java | 1 |
请完成以下Java代码 | private IHUQueryBuilder newHUQuery()
{
return handlingUnitsDAO()
.createHUQueryBuilder()
.setContext(PlainContextAware.newOutOfTrx())
.setOnlyActiveHUs(false) // let other enforce this rule
.setOnlyTopLevelHUs(false); // let other enforce this rule
}
private SqlAndParams toSql(@NonNull final IHUQu... | {
final SqlAndParams whereClause = fixedHUIds.isNone()
? FilterSql.ALLOW_NONE.getWhereClause()
: toSql(newHUQuery().addOnlyHUIds(fixedHUIds.toSet()));
return FilterSql.builder()
.whereClause(whereClause)
.alwaysIncludeSql(toAlwaysIncludeSql(alwaysIncludeHUIds))
.build();
}
@Override
public ... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\handlingunits\filter\HUIdsFilterDataToSqlCaseConverter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class MovieQuoteService implements Subject {
private static final Logger logger = LoggerFactory.getLogger(MovieQuoteService.class);
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
private final List<Observer> observers = new ArrayList<>();
private final Fa... | logger.debug("New quote: {}", quote);
for (Observer observer : observers) {
logger.debug("Notifying user: {}", observer);
observer.update(quote);
}
}
public void start() {
scheduler.scheduleAtFixedRate(this::notifyObservers, 0, 1, TimeUnit.SECONDS);
}
pu... | repos\tutorials-master\core-java-modules\core-java-perf-2\src\main\java\com\baeldung\lapsedlistener\MovieQuoteService.java | 2 |
请完成以下Java代码 | private Supplier<BucketConfiguration> getConfigSupplier() {
return () -> {
JHipsterProperties.Gateway.RateLimiting rateLimitingProperties =
jHipsterProperties.getGateway().getRateLimiting();
return Bucket4j.configurationBuilder()
.addLimit(Bandwidth.simpl... | private void apiLimitExceeded() {
RequestContext ctx = RequestContext.getCurrentContext();
ctx.setResponseStatusCode(HttpStatus.TOO_MANY_REQUESTS.value());
if (ctx.getResponseBody() == null) {
ctx.setResponseBody("API rate limit exceeded");
ctx.setSendZuulResponse(false);... | repos\tutorials-master\jhipster-modules\jhipster-uaa\gateway\src\main\java\com\baeldung\jhipster\gateway\gateway\ratelimiting\RateLimitingFilter.java | 1 |
请完成以下Java代码 | public void validate(T query) {
if (!Context.getProcessEngineConfiguration().isEnableExpressionsInAdhocQueries() &&
!query.getExpressions().isEmpty()) {
throw new BadUserRequestException("Expressions are forbidden in adhoc queries. This behavior can be toggled"
+ " in the process eng... | @Override
public void validate(T query) {
if (!Context.getProcessEngineConfiguration().isEnableExpressionsInStoredQueries() &&
!query.getExpressions().isEmpty()) {
throw new BadUserRequestException("Expressions are forbidden in stored queries. This behavior can be toggled"
+ " in... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\QueryValidators.java | 1 |
请完成以下Java代码 | public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return las... | public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
} | repos\tutorials-master\aws-modules\aws-lambda-modules\lambda-function\src\main\java\com\baeldung\lambda\dynamodb\bean\PersonRequest.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String addItem(@RequestBody ItemRequest request, @SessionAttribute(GeneralConstants.ID_SESSION_SHOPPING_CART) List<Product> shoppingCart) {
Product newProduct = new Product();
Optional<Product> optional = getProductById(products.stream(), request.getId());
if (optional.isPresent()) {
... | shoppingCart.remove(productInCart.get());
pusher.trigger(PusherConstants.CHANNEL_NAME, "itemRemoved", product);
}
}
return "OK";
}
/**
* Method that empties the shopping cart
* @param model Object from Spring MVC
* @return Status string
*/
@R... | repos\Spring-Boot-Advanced-Projects-main\Springboot-ShoppingCard\fullstack\backend\src\main\java\com\urunov\controller\web\CartController.java | 2 |
请完成以下Java代码 | public boolean isEligibleForPacking()
{
return isEligibleForChangingPickStatus()
&& isApproved()
&& pickStatus != null
&& pickStatus.isEligibleForPacking();
}
public boolean isEligibleForReview()
{
return isEligibleForChangingPickStatus()
&& pickStatus != null
&& pickStatus.isEligibleForRev... | return isEligibleForChangingPickStatus()
&& pickStatus != null
&& pickStatus.isEligibleForProcessing();
}
public String getLocatorName()
{
return locator != null ? locator.getDisplayName() : "";
}
@Override
public List<ProductsToPickRow> getIncludedRows()
{
return includedRows;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\pickingV2\productsToPick\rows\ProductsToPickRow.java | 1 |
请完成以下Java代码 | public class LocalFileSystemClient implements FileClient {
@Value("${upload.path:/data/upload/}")
private String filePath;
public LocalFileSystemClient() {
// 初始化
this.initFileClient();
}
@Override
public void initFileClient() {
FileUtil.mkdir(filePath);
}
@Ove... | // 需要合并的文件所在的文件夹
File chunkFolder = new File(chunkProcess.getUploadId());
// 合并后的文件
File mergeFile = new File(filePath + filename);
try (BufferedOutputStream outputStream = new BufferedOutputStream(Files.newOutputStream(mergeFile.toPath()))) {
byte[] bytes = new byte[1024];
... | repos\springboot-demo-master\file\src\main\java\com\et\service\impl\LocalFileSystemClient.java | 1 |
请完成以下Java代码 | private static final class IntegerValueConverter implements ValueConverter<Integer, IntegerStringExpression>
{
@Override
public Integer convertFrom(final Object valueObj, final ExpressionContext context)
{
if (valueObj == null)
{
return null;
}
else if (valueObj instanceof Integer)
{
retu... | {
public SingleParameterExpression(final ExpressionContext context, final Compiler<Integer, IntegerStringExpression> compiler, final String expressionStr, final CtxName parameter)
{
super(context, compiler, expressionStr, parameter);
}
@Override
protected Integer extractParameterValue(final Evaluatee ctx)... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\IntegerStringExpressionSupport.java | 1 |
请完成以下Java代码 | public class BinarySearch {
public int runBinarySearchIteratively(int[] sortedArray, int key, int low, int high) {
int index = Integer.MAX_VALUE;
while (low <= high) {
int mid = low + ((high - low) / 2);
if (sortedArray[mid] < key) {
low = mid + 1;
... | public List<Integer> runBinarySearchOnSortedArraysWithDuplicates(int[] sortedArray, Integer key) {
int startIndex = startIndexSearch(sortedArray, key);
int endIndex = endIndexSearch(sortedArray, key);
return IntStream.rangeClosed(startIndex, endIndex)
.boxed()
.collect(Co... | repos\tutorials-master\algorithms-modules\algorithms-searching\src\main\java\com\baeldung\algorithms\binarysearch\BinarySearch.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public ResponseEntity<String> postToCondition(@RequestBody ConditionMessageRepresentation message ) throws FirebaseMessagingException {
Message msg = Message.builder()
.setCondition(message.getCondition())
.putData("body", message.getData())
.build();
String id = ... | .build();
BatchResponse response = fcm.sendMulticast(msg);
List<String> ids = response.getResponses()
.stream()
.map(r->r.getMessageId())
.collect(Collectors.toList());
return ResponseEntity
.status(HttpStatus.ACCEPTED)
.body(i... | repos\tutorials-master\gcp-firebase\src\main\java\com\baeldung\gcp\firebase\publisher\controller\FirebasePublisherController.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class FileEvidence
{
public static final String SERIALIZED_NAME_FILE_ID = "fileId";
@SerializedName(SERIALIZED_NAME_FILE_ID)
private String fileId;
public FileEvidence fileId(String fileId)
{
this.fileId = fileId;
return this;
}
/**
* If an uploadEvidenceFile call is successful, a unique identifi... | {
return Objects.hash(fileId);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("class FileEvidence {\n");
sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to stri... | 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\FileEvidence.java | 2 |
请完成以下Java代码 | public void handleCallOrderDetailUpsert(@NonNull final UpsertCallOrderDetailRequest request)
{
final FlatrateTermId flatrateTermId = request.getCallOrderContractId();
final Optional<CallOrderSummary> summaryOptional = summaryRepo.getByFlatrateTermId(flatrateTermId);
if (!summaryOptional.isPresent())
{
ret... | summaryService.createSummaryForOrderLine(ol, newCallOrderTerm);
}
public boolean isCallOrder(@NonNull final OrderId orderId)
{
final I_C_Order order = orderBL.getById(orderId);
return isCallOrder(order);
}
public boolean isCallOrder(@NonNull final I_C_Order order)
{
final DocTypeId docTypeTargetId = DocT... | repos\metasfresh-new_dawn_uat\backend\de.metas.contracts\src\main\java\de\metas\contracts\callorder\CallOrderService.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public JwtTokenFilter authenticationTokenFilterBean() throws Exception {
return new JwtTokenFilter();
}
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Override
protected void configure( Authenticati... | httpSecurity.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
.antMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.antMatchers(HttpMethod.POST, "/authentication/**").permitAll()
... | repos\Spring-Boot-In-Action-master\springbt_security_jwt\src\main\java\cn\codesheep\springbt_security_jwt\config\WebSecurityConfig.java | 2 |
请完成以下Java代码 | default boolean isMaterialReceiptOrCoProduct(final I_PP_Cost_Collector cc)
{
final CostCollectorType costCollectorType = CostCollectorType.ofCode(cc.getCostCollectorType());
return costCollectorType.isMaterialReceiptOrCoProduct();
}
default boolean isAnyComponentIssue(final I_PP_Cost_Collector cc)
{
final Co... | *
* @return processed cost collector
*/
I_PP_Cost_Collector createReceipt(ReceiptCostCollectorCandidate candidate);
void createActivityControl(ActivityControlCreateRequest request);
void createMaterialUsageVariance(I_PP_Order ppOrder, I_PP_Order_BOMLine line);
void createResourceUsageVariance(I_PP_Order ppOr... | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\api\IPPCostCollectorBL.java | 1 |
请完成以下Java代码 | private static final int getOperatorStrength(final String operator)
{
if (operator == null)
{
return -100;
}
else if (LOGIC_OPERATOR_AND.equals(operator))
{
return 20;
}
else if (LOGIC_OPERATOR_OR.equals(operator))
{
return 10;
}
else
{
// unknown operator
throw ExpressionEvaluatio... | public String getOperator()
{
return operator;
}
@Override
public String toString()
{
return getExpressionString();
}
@Override
public ILogicExpression evaluatePartial(final Evaluatee ctx)
{
if (isConstant())
{
return this;
}
final ILogicExpression leftExpression = getLeft();
final ILogicEx... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\expression\api\impl\LogicExpression.java | 1 |
请完成以下Java代码 | public java.lang.String getDescription()
{
return get_ValueAsString(COLUMNNAME_Description);
}
@Override
public org.compiere.model.I_M_DiscountSchema getM_DiscountSchema()
{
return get_ValueAsPO(COLUMNNAME_M_DiscountSchema_ID, org.compiere.model.I_M_DiscountSchema.class);
}
@Override
public void setM_Dis... | {
set_Value (COLUMNNAME_Name, Name);
}
@Override
public java.lang.String getName()
{
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setProcCreate (final @Nullable java.lang.String ProcCreate)
{
set_Value (COLUMNNAME_ProcCreate, ProcCreate);
}
@Override
public java.lang.String ge... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_PriceList_Version.java | 1 |
请完成以下Java代码 | public static OptionalBoolean ofBoolean(final boolean value)
{
return value ? TRUE : FALSE;
}
@JsonCreator
public static OptionalBoolean ofNullableBoolean(@Nullable final Boolean value)
{
return value != null ? ofBoolean(value) : UNKNOWN;
}
public static OptionalBoolean ofNullableString(@Nullable final Str... | throw new IllegalStateException("Type not handled: " + this);
}
}
@Nullable
public String toBooleanString()
{
return StringUtils.ofBoolean(toBooleanOrNull());
}
public void ifPresent(@NonNull final BooleanConsumer action)
{
if (this == TRUE)
{
action.accept(true);
}
else if (this == FALSE)
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\de\metas\util\OptionalBoolean.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class ProgressRequestBody extends RequestBody {
public interface ProgressRequestListener {
void onRequestProgress(long bytesWritten, long contentLength, boolean done);
}
private final RequestBody requestBody;
private final ProgressRequestListener progressListener;
public ProgressR... | bufferedSink.flush();
}
private Sink sink(Sink sink) {
return new ForwardingSink(sink) {
long bytesWritten = 0L;
long contentLength = 0L;
@Override
public void write(Buffer source, long byteCount) throws IOException {
super.write(source,... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-externalsystems\alberta\alberta-article-api\src\main\java\io\swagger\client\ProgressRequestBody.java | 2 |
请完成以下Java代码 | public static RoleId ofRepoId(final int repoId)
{
final RoleId roleId = ofRepoIdOrNull(repoId);
return Check.assumeNotNull(roleId, "Unable to create a roleId for repoId={}", repoId);
}
public static RoleId ofRepoIdOrNull(final int repoId)
{
if (repoId == SYSTEM.getRepoId())
{
return SYSTEM;
}
else i... | return Objects.equals(id1, id2);
}
int repoId;
private RoleId(final int repoId)
{
this.repoId = Check.assumeGreaterOrEqualToZero(repoId, "AD_Role_ID");
}
@Override
@JsonValue
public int getRepoId()
{
return repoId;
}
public boolean isSystem() {return isSystem(repoId);}
public static boolean isSyste... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\security\RoleId.java | 1 |
请完成以下Java代码 | public DocBaseType getDocBaseTypeById(@NonNull final DocTypeId docTypeId)
{
final I_C_DocType docTypeRecord = getById(docTypeId);
return DocBaseType.ofCode(docTypeRecord.getDocBaseType());
}
@NonNull
@Override
public DocBaseAndSubType getDocBaseAndSubTypeById(@NonNull final DocTypeId docTypeId)
{
final I_C... | ? new DocBaseTypeCountersMap(map)
: EMPTY;
}
private static final DocBaseTypeCountersMap EMPTY = new DocBaseTypeCountersMap(ImmutableMap.of());
private final ImmutableMap<DocBaseType, DocBaseType> counterDocBaseTypeByDocBaseType;
private DocBaseTypeCountersMap(@NonNull final ImmutableMap<DocBaseType, Do... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\document\impl\DocTypeDAO.java | 1 |
请完成以下Java代码 | public Builder addElement(final DocumentFieldDescriptor processParaDescriptor)
{
Check.assumeNotNull(processParaDescriptor, "Parameter processParaDescriptor is not null");
final DocumentLayoutElementDescriptor element = DocumentLayoutElementDescriptor.builder()
.setCaption(processParaDescriptor.getCaption(... | return this;
}
public Builder addElements(@Nullable final DocumentEntityDescriptor parametersDescriptor)
{
if (parametersDescriptor != null)
{
parametersDescriptor.getFields().forEach(this::addElement);
}
return this;
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\process\descriptor\ProcessLayout.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public String getErrorUrl() {
return errorUrl;
}
public void setErrorUrl(String errorUrl) {
this.errorUrl = errorUrl;
}
/**
* 表示是否允许访问 ,如果允许访问返回true,否则false;
*
* @param servletRequest
* @param servletResponse
* @param o 表示写在拦截器中括号里面的字符串 mappedValu... | /**
* onAccessDenied:表示当访问拒绝时是否已经处理了; 如果返回 true 表示需要继续处理; 如果返回 false
* 表示该拦截器实例已经处理了,将直接返回即可。
*
* @param servletRequest
* @param servletResponse
* @return
* @throws Exception
*/
@Override
protected boolean onAccessDenied(ServletRequest servletRequest, ServletResponse serv... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\config\shiro\filters\ResourceCheckFilter.java | 2 |
请完成以下Java代码 | public class ReactiveSecurityDataFetcherExceptionResolver implements DataFetcherExceptionResolver {
private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
/**
* Set the resolver to use to check if an authentication is anonymous that
* in turn determines whether {@code Access... | if (ex instanceof AuthenticationException) {
GraphQLError error = SecurityExceptionResolverUtils.resolveUnauthorized(environment);
return Mono.just(Collections.singletonList(error));
}
if (ex instanceof AccessDeniedException) {
return ReactiveSecurityContextHolder.getContext()
.map((context) -> Collec... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\execution\ReactiveSecurityDataFetcherExceptionResolver.java | 1 |
请在Spring Boot框架中完成以下Java代码 | ServerHttpSecurity httpSecurity() {
ContextAwareServerHttpSecurity http = new ContextAwareServerHttpSecurity();
// @formatter:off
return http.authenticationManager(authenticationManager())
.headers(withDefaults())
.logout(withDefaults());
// @formatter:on
}
private ReactiveAuthenticationManager authent... | manager.setCompromisedPasswordChecker(this.compromisedPasswordChecker);
return this.postProcessor.postProcess(manager);
}
return null;
}
private static class ContextAwareServerHttpSecurity extends ServerHttpSecurity implements ApplicationContextAware {
@Override
public void setApplicationContext(Applicat... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\reactive\ServerHttpSecurityConfiguration.java | 2 |
请完成以下Java代码 | public DmnDecision getDecision() {
return decision;
}
public void setDecision(DmnDecision decision) {
this.decision = decision;
}
public String getOutputName() {
return outputName;
}
public void setOutputName(String outputName) {
this.outputName = outputName;
}
public TypedValue getO... | @Override
public String toString() {
return "DmnDecisionLiteralExpressionEvaluationEventImpl [" +
" key="+ decision.getKey() +
", name="+ decision.getName() +
", decisionLogic=" + decision.getDecisionLogic() +
", outputName=" + outputName +
", outputValue=" + outputValue +
... | repos\camunda-bpm-platform-master\engine-dmn\engine\src\main\java\org\camunda\bpm\dmn\engine\impl\delegate\DmnDecisionLiteralExpressionEvaluationEventImpl.java | 1 |
请完成以下Java代码 | public class IOParameter extends BaseElement {
protected String source;
protected String sourceExpression;
protected String target;
protected String targetExpression;
protected boolean isTransient;
public String getSource() {
return source;
}
public void setSource(String sourc... | }
public void setTargetExpression(String targetExpression) {
this.targetExpression = targetExpression;
}
public boolean isTransient() {
return isTransient;
}
public void setTransient(boolean isTransient) {
this.isTransient = isTransient;
}
@Override
public IOP... | repos\flowable-engine-main\modules\flowable-bpmn-model\src\main\java\org\flowable\bpmn\model\IOParameter.java | 1 |
请完成以下Java代码 | public class X_M_HazardSymbol extends org.compiere.model.PO implements I_M_HazardSymbol, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = 147033401L;
/** Standard Constructor */
public X_M_HazardSymbol (final Properties ctx, final int M_HazardSymbol_ID, @Nullable final String t... | public int getM_HazardSymbol_ID()
{
return get_ValueAsInt(COLUMNNAME_M_HazardSymbol_ID);
}
@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... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_HazardSymbol.java | 1 |
请完成以下Java代码 | public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
@Override
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
@Override
public Integer getPort() {
return port;
... | public void setLimitApp(String limitApp) {
this.limitApp = limitApp;
}
public String getResource() {
return resource;
}
public void setResource(String resource) {
this.resource = resource;
}
@Override
public Rule toRule() {
ParamFlowRule rule = new ParamFlo... | repos\JeecgBoot-main\jeecg-boot\jeecg-server-cloud\jeecg-visual\jeecg-cloud-sentinel\src\main\java\com\alibaba\csp\sentinel\dashboard\rule\nacos\entity\ParamFlowRuleCorrectEntity.java | 1 |
请完成以下Java代码 | public class SuspendProcessDefinitionCmd extends AbstractSetProcessDefinitionStateCmd {
public SuspendProcessDefinitionCmd(UpdateProcessDefinitionSuspensionStateBuilderImpl builder) {
super(builder);
}
@Override
protected SuspensionState getNewSuspensionState() {
return SuspensionState.SUSPENDED;
}
... | protected AbstractSetJobDefinitionStateCmd getSetJobDefinitionStateCmd(UpdateJobDefinitionSuspensionStateBuilderImpl jobDefinitionSuspensionStateBuilder) {
return new SuspendJobDefinitionCmd(jobDefinitionSuspensionStateBuilder);
}
@Override
protected SuspendProcessInstanceCmd getNextCommand(UpdateProcessInst... | repos\camunda-bpm-platform-master\engine\src\main\java\org\camunda\bpm\engine\impl\cmd\SuspendProcessDefinitionCmd.java | 1 |
请完成以下Java代码 | public CacheIntrospectionException setMethod(final Method method)
{
this.method = method;
resetMessageBuilt();
return this;
}
public CacheIntrospectionException setParameter(final int parameterIndex, final Class<?> parameterType)
{
this.parameterIndex = parameterIndex;
this.parameterType = parameterType;... | @Override
protected ITranslatableString buildMessage()
{
final TranslatableStringBuilder message = TranslatableStrings.builder();
message.append(super.buildMessage());
if (method != null)
{
message.append("\n Method: ").appendObj(method);
}
if (parameterSet)
{
message.append("\n Invalid paramet... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\de\metas\cache\interceptor\CacheIntrospectionException.java | 1 |
请完成以下Java代码 | public void add(@NonNull final PurchaseCandidate purchaseCandidate)
{
final PurchaseCandidateAggregateKey purchaseCandidateAggKey = PurchaseCandidateAggregateKey.fromPurchaseCandidate(purchaseCandidate);
if (!aggregationKey.equals(purchaseCandidateAggKey))
{
throw new AdempiereException("" + purchaseCandidate... | .stream()
.map(PurchaseCandidate::getId)
.collect(ImmutableList.toImmutableList());
}
public Set<OrderAndLineId> getSalesOrderAndLineIds()
{
return ImmutableSet.copyOf(salesOrderAndLineIds);
}
public void calculateAndSetQtyToDeliver()
{
if (purchaseCandidates.isEmpty())
{
return;
}
final Q... | repos\metasfresh-new_dawn_uat\backend\de.metas.purchasecandidate.base\src\main\java\de\metas\purchasecandidate\purchaseordercreation\localorder\PurchaseCandidateAggregate.java | 1 |
请完成以下Java代码 | public void updateProcessInstanceLockTime(String processInstanceId) {
Date expirationTime = getClock().getCurrentTime();
int lockMillis = getAsyncExecutor().getAsyncJobLockTimeInMillis();
GregorianCalendar lockCal = new GregorianCalendar();
lockCal.setTime(expirationTime);
lockC... | }
return businessKey;
}
return null;
}
public ExecutionDataManager getExecutionDataManager() {
return executionDataManager;
}
public void setExecutionDataManager(ExecutionDataManager executionDataManager) {
this.executionDataManager = executionDataManager;
... | repos\Activiti-develop\activiti-core\activiti-engine\src\main\java\org\activiti\engine\impl\persistence\entity\ExecutionEntityManagerImpl.java | 1 |
请完成以下Java代码 | static class VocabWordComparator implements Comparator<VocabWord>
{
@Override
public int compare(VocabWord o1, VocabWord o2)
{
return o2.cn - o1.cn;
}
}
void initUnigramTable(Corpus corpus)
{
final int vocabSize = corpus.getVocabSize();
final ... | {
syn1neg = posixMemAlign128(vocabSize * layer1Size);
for (int i = 0; i < vocabSize; i++)
{
for (int j = 0; j < layer1Size; j++)
{
syn1neg[i * layer1Size + j] = 0;
}
}
}
long nextRandom =... | repos\springboot-demo-master\hanlp\src\main\java\demo\hankcs\hanlp\mining\word2vec\Word2VecTraining.java | 1 |
请完成以下Java代码 | public void setLevel(Integer level) {
this.level = level;
}
public Integer getProductCount() {
return productCount;
}
public void setProductCount(Integer productCount) {
this.productCount = productCount;
}
public String getProductUnit() {
return productUnit;
... | this.keywords = keywords;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getC... | repos\mall-master\mall-mbg\src\main\java\com\macro\mall\model\PmsProductCategory.java | 1 |
请完成以下Java代码 | ReadTsKvQueryResult findAllAsyncWithLimit(EntityId entityId, ReadTsKvQuery query) {
Integer keyId = keyDictionaryDao.getOrSaveKeyId(query.getKey());
List<TsKvEntity> tsKvEntities = tsKvRepository.findAllWithLimit(
entityId.getId(),
keyId,
query.getStartTs(... | case MAX:
var max = tsKvRepository.findNumericMax(entityId.getId(), keyId, startTs, endTs);
if (max.isNotEmpty()) {
return max;
} else {
return tsKvRepository.findStringMax(entityId.getId(), keyId, startTs, endTs);
}... | repos\thingsboard-master\dao\src\main\java\org\thingsboard\server\dao\sqlts\AbstractChunkedAggregationTimeseriesDao.java | 1 |
请完成以下Java代码 | private final boolean checkValid(final DocumentLayoutElementDescriptor.Builder elementBuilder)
{
if (elementBuilder.isConsumed())
{
logger.trace("Skip adding {} to {} because it's already consumed", elementBuilder, this);
return false;
}
if (elementBuilder.isEmpty())
{
logger.trace("Skip a... | }
public Builder setInternalName(final String internalName)
{
this.internalName = internalName;
return this;
}
public Builder addElement(final DocumentLayoutElementDescriptor.Builder elementBuilder)
{
elementsBuilders.add(elementBuilder);
return this;
}
public boolean hasElements()
{
r... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\window\descriptor\DocumentLayoutElementLineDescriptor.java | 1 |
请完成以下Java代码 | public SqlViewCustomizer getOrNull(
@NonNull final WindowId windowId,
@Nullable final ViewProfileId profileId)
{
if (ViewProfileId.isNull(profileId))
{
return null;
}
final ImmutableMap<ViewProfileId, SqlViewCustomizer> viewCustomizersByProfileId = map.get(windowId);
if (viewCustomizersByProfileId ... | viewCustomizers.forEach(viewCustomizer -> consumer.accept(viewCustomizer.getWindowId(), viewCustomizer.getProfile().getProfileId()));
}
public ImmutableListMultimap<WindowId, ViewProfile> getViewProfilesIndexedByWindowId()
{
return viewCustomizers
.stream()
.collect(ImmutableListMultimap.toImmutableListMu... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\view\descriptor\SqlViewCustomizerMap.java | 1 |
请完成以下Java代码 | public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getD... | public void setAssignee(String assignee) {
this.assignee = assignee;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public List<String> getCandidateUsers() {
return candidateUsers;
}
public void ... | repos\flowable-engine-main\modules\flowable-cmmn-engine\src\main\java\org\flowable\cmmn\engine\interceptor\CreateHumanTaskBeforeContext.java | 1 |
请完成以下Java代码 | public void setLastSyncStatus (java.lang.String LastSyncStatus)
{
set_Value (COLUMNNAME_LastSyncStatus, LastSyncStatus);
}
/** Get Letzter Synchronisierungsstatus.
@return Letzter Synchronisierungsstatus */
@Override
public java.lang.String getLastSyncStatus ()
{
return (java.lang.String)get_Value(COLUM... | set_Value (COLUMNNAME_MKTG_Platform_ID, null);
else
set_Value (COLUMNNAME_MKTG_Platform_ID, Integer.valueOf(MKTG_Platform_ID));
}
/** Get MKTG_Platform.
@return MKTG_Platform */
@Override
public int getMKTG_Platform_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MKTG_Platform_ID);
if (ii == nul... | repos\metasfresh-new_dawn_uat\backend\de.metas.marketing\base\src\main\java-gen\de\metas\marketing\base\model\X_MKTG_ContactPerson.java | 1 |
请完成以下Java代码 | private static void fastutilMap() {
Int2BooleanMap int2BooleanMap = new Int2BooleanOpenHashMap();
int2BooleanMap.put(1, true);
int2BooleanMap.put(7, false);
int2BooleanMap.put(4, true);
boolean value = int2BooleanMap.get(1);
//Lambda style iteration
Int2BooleanM... | }
private static void eclipseCollectionsMap() {
MutableIntIntMap mutableIntIntMap = IntIntMaps.mutable.empty();
mutableIntIntMap.addToValue(1, 1);
ImmutableIntIntMap immutableIntIntMap = IntIntMaps.immutable.empty();
MutableObjectDoubleMap<String> dObject = ObjectDoubleMaps.mutabl... | repos\tutorials-master\core-java-modules\core-java-collections-maps-9\src\main\java\com\baeldung\map\primitives\PrimitiveMaps.java | 1 |
请完成以下Java代码 | public Builder issuedAt(Instant issuedAt) {
return claim(JwtClaimNames.IAT, issuedAt);
}
/**
* Sets the JWT ID {@code (jti)} claim, which provides a unique identifier for the
* JWT.
* @param jti the unique identifier for the JWT
* @return the {@link Builder}
*/
public Builder id(String jti) {
... | claimsConsumer.accept(this.claims);
return this;
}
/**
* Builds a new {@link JwtClaimsSet}.
* @return a {@link JwtClaimsSet}
*/
public JwtClaimsSet build() {
Assert.notEmpty(this.claims, "claims cannot be empty");
// The value of the 'iss' claim is a String or URL (StringOrURI).
// Attempt ... | repos\spring-security-main\oauth2\oauth2-jose\src\main\java\org\springframework\security\oauth2\jwt\JwtClaimsSet.java | 1 |
请完成以下Java代码 | private ProcessPreconditionsResolution verifySelectedDocuments()
{
final DocumentIdsSelection selectedRowIds = getSelectedRootDocumentIds();
if (selectedRowIds.isEmpty())
{
return ProcessPreconditionsResolution.rejectBecauseNoSelection();
}
final long selectionSize = getSelectionSize(selectedRowIds);
i... | return rowIds.size();
}
}
private DocumentIdsSelection getSelectedRootDocumentIds()
{
final DocumentIdsSelection selectedRowIds = getSelectedRowIds();
if (selectedRowIds.isAll())
{
return selectedRowIds;
}
else if (selectedRowIds.isEmpty())
{
return selectedRowIds;
}
else
{
return selec... | repos\metasfresh-new_dawn_uat\backend\de.metas.ui.web.base\src\main\java\de\metas\ui\web\picking\process\WEBUI_Picking_Launcher.java | 1 |
请完成以下Java代码 | public class DocumentDTO {
private int id;
private String title;
private String text;
private List<String> comments;
private String author;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return t... | public List<String> getComments() {
return comments;
}
public void setComments(List<String> comments) {
this.comments = comments;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
} | repos\tutorials-master\mapstruct\src\main\java\com\baeldung\unmappedproperties\dto\DocumentDTO.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class DefaultTbTelemetryService implements TbTelemetryService {
private final TimeseriesService tsService;
private final AccessValidator accessValidator;
@Override
public ListenableFuture<List<TsKvEntry>> getTimeseries(EntityId entityId, List<String> keys, Long startTs, Long endTs, IntervalType... | public void onSuccess(List<TsKvEntry> result) {
future.set(result);
}
@Override
public void onFailure(Throwable t) {
future.setException(t);
}
}, M... | repos\thingsboard-master\application\src\main\java\org\thingsboard\server\service\telemetry\DefaultTbTelemetryService.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public class MainApplication {
private final BookstoreService bookstoreService;
public MainApplication(BookstoreService bookstoreService) {
this.bookstoreService = bookstoreService;
}
public static void main(String[] args) {
SpringApplication.run(MainApplication.class, args);
}
... | System.out.println("-----------------------");
bookstoreService.registerAuthor();
Thread.sleep(5000);
System.out.println("\nUpdate an author ...");
System.out.println("--------------------");
bookstoreService.updateAuthor();
Thread.sleep(5000);
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootEnvers\src\main\java\com\bookstore\MainApplication.java | 2 |
请完成以下Java代码 | private String getAsyncBatchDesc()
{
return asyncBatchDesc;
}
public ESRImportEnqueuer pinstanceId(@Nullable final PInstanceId pinstanceId)
{
this.pinstanceId = pinstanceId;
return this;
}
private PInstanceId getPinstanceId()
{
return pinstanceId;
}
public ESRImportEnqueuer fromDataSource(final ESRI... | @NonNull final byte[] data,
@NonNull final String filename)
{
this.data = data;
this.filename = filename;
}
@Override
public String getFilename()
{
return filename;
}
@Override
public String getDescription()
{
return null;
}
@Override
public InputStream getInputStream()
{
... | repos\metasfresh-new_dawn_uat\backend\de.metas.payment.esr\src\main\java\de\metas\payment\esr\dataimporter\ESRImportEnqueuer.java | 1 |
请完成以下Java代码 | public class PP_Order_BOMLine
{
private final IPPOrderBOMBL orderBOMBL = Services.get(IPPOrderBOMBL.class);
private final IUOMDAO uomDAO = Services.get(IUOMDAO.class);
/**
* Calculates and sets QtyRequired from QtyEntered and C_UOM_ID
*/
@CalloutMethod(columnNames = {
I_PP_Order_BOMLine.COLUMNNAME_M_Product... | {
return;
}
final UomId uomId = UomId.ofRepoIdOrNull(bomLine.getC_UOM_ID());
if (uomId == null)
{
return;
}
final I_C_UOM uom = uomDAO.getById(uomId);
final Quantity qtyEntered = Quantity.of(bomLine.getQtyEntered(), uom);
orderBOMBL.setQtyRequiredToIssueOrReceive(bomLine, qtyEntered);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\callout\PP_Order_BOMLine.java | 1 |
请完成以下Java代码 | private void logDependents(final IMigrationLoggerContext migrationCtx, final IMigrationLogger migrationLogger, final PO record)
{
final String tableName = InterfaceWrapperHelper.getModelTableName(record);
if (I_AD_Column.Table_Name.equals(tableName))
{
final I_AD_Column adColumn = InterfaceWrapperHelper.creat... | .setParameters(params)
.list();
}
private Iterator<I_AD_Table> retrieveTablesWithEntityType()
{
final StringBuilder whereClause = new StringBuilder();
final List<Object> params = new ArrayList<Object>();
whereClause.append(" EXISTS (select 1 from AD_Column c where c.AD_Table_ID=AD_Table.AD_Table_ID and c... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\migration\process\AD_Migration_CreateFromEntityType.java | 1 |
请完成以下Java代码 | public String[] sortingCriteria() {
final Session session = HibernateUtil.getHibernateSession();
final CriteriaBuilder cb = session.getCriteriaBuilder();
final CriteriaQuery<Item> cr = cb.createQuery(Item.class);
final Root<Item> root = cr.from(Item.class);
cr.select(root);
... | final Long projectedRowCount[] = new Long[itemProjected.size()];
for (int i = 0; i < itemProjected.size(); i++) {
projectedRowCount[i] = itemProjected.get(i);
}
session.close();
return projectedRowCount;
}
// Set projections average of itemPrice
public Double[] p... | repos\tutorials-master\persistence-modules\hibernate-queries\src\main\java\com\baeldung\hibernate\criteria\view\ApplicationView.java | 1 |
请完成以下Java代码 | public static boolean isNonAlphanumeric(String str) {
// Pattern pattern = Pattern.compile("\\W"); //same as [^a-zA-Z0-9]+
// Pattern pattern = Pattern.compile("[^a-zA-Z0-9||\\s]+"); //ignores space
Matcher matcher = PATTERN_NON_ALPHNUM_USASCII.matcher(str);
return matcher.find();
}
... | /**
* checks for non-alphanumeric character. it returns true if it detects any character other than the
* specified script argument. example of script - Character.UnicodeScript.GEORGIAN.name()
*
* @param input - String to check for special character
* @param script - language script
* @ret... | repos\tutorials-master\core-java-modules\core-java-string-operations-6\src\main\java\com\baeldung\nonalphanumeric\NonAlphaNumRegexChecker.java | 1 |
请完成以下Java代码 | public String getTaskDefinitionKey() {
return taskDefinitionKey;
}
public int getPriority() {
return priority;
}
public Date getDue() {
return due;
}
public String getParentTaskId() {
return parentTaskId;
}
public Date getFollowUp() {
return followUp;
}
public String getTena... | public static HistoricTaskInstanceDto fromHistoricTaskInstance(HistoricTaskInstance taskInstance) {
HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto();
dto.id = taskInstance.getId();
dto.processDefinitionKey = taskInstance.getProcessDefinitionKey();
dto.processDefinitionId = taskInstance.getP... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\history\HistoricTaskInstanceDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setBankAccountQualifer(String value) {
this.bankAccountQualifer = value;
}
/**
* Gets the value of the bankName property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBankName() {
return bankName;
}... | * Gets the value of the bankAccountNr property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBankAccountNr() {
return bankAccountNr;
}
/**
* Sets the value of the bankAccountNr property.
*
* @param value
* ... | repos\metasfresh-new_dawn_uat\misc\services\camel\de-metas-camel-edi\src\main\java-xjc_ecosio_remadv\at\erpel\schemas\_1p0\documents\extensions\edifact\AdditionalBankAccountType.java | 2 |
请完成以下Java代码 | public static void countSolution() {
MongoDatabase database = mongoClient.getDatabase(databaseName);
MongoCollection<Document> collection = database.getCollection(testCollectionName);
System.out.println(collection.countDocuments());
}
public static void main(String args[]) {
... | //
createCollectionSolution();
//
// Check the db existence using the listCollectionNames method of MongoDatabase class
//
listCollectionNamesSolution();
//
// Check the db existence using the count method of MongoDatabase class
//
countSolution(... | repos\tutorials-master\persistence-modules\java-mongodb-3\src\main\java\com\baeldung\mongo\collectionexistence\CollectionExistence.java | 1 |
请完成以下Java代码 | protected @Nullable Object[] getMethodArgumentValues(
DataFetchingEnvironment environment, Object... providedArgs) throws Exception {
MethodParameter[] parameters = getMethodParameters();
if (ObjectUtils.isEmpty(parameters)) {
return EMPTY_ARGS;
}
@Nullable Object[] args = new Object[parameters.length];... | try {
args[i] = this.resolvers.resolveArgument(parameter, environment);
}
catch (Exception ex) {
// Leave stack trace for later, exception may actually be resolved and handled...
if (logger.isDebugEnabled()) {
String exMsg = ex.getMessage();
if (exMsg != null && !exMsg.contains(parameter.get... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\data\method\annotation\support\DataFetcherHandlerMethodSupport.java | 1 |
请完成以下Java代码 | public void setHistoricProcessInstanceQuery(HistoricProcessInstanceQueryDto historicProcessInstanceQuery) {
this.historicProcessInstanceQuery = historicProcessInstanceQuery;
}
public HistoricProcessInstanceQueryDto getHistoricProcessInstanceQuery() {
return historicProcessInstanceQuery;
}
public Batch... | if (processInstanceQuery != null) {
if (groupBuilder == null) {
groupBuilder = selectBuilder.byProcessInstanceQuery(processInstanceQuery.toQuery(engine));
} else {
groupBuilder.byProcessInstanceQuery(processInstanceQuery.toQuery(engine));
}
}
if (historicProcessInstanceQuery !... | repos\camunda-bpm-platform-master\engine-rest\engine-rest\src\main\java\org\camunda\bpm\engine\rest\dto\runtime\ProcessInstanceSuspensionStateAsyncDto.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void signalEventReceived(@RequestBody SignalEventReceivedRequest signalRequest, HttpServletResponse response) {
if (signalRequest.getSignalName() == null) {
throw new FlowableIllegalArgumentException("signalName is required");
}
if (restApiInterceptor != null) {
... | runtimeService.signalEventReceivedAsyncWithTenantId(signalRequest.getSignalName(), signalRequest.getTenantId());
} else {
runtimeService.signalEventReceivedAsync(signalRequest.getSignalName());
}
response.setStatus(HttpStatus.ACCEPTED.value());
} else {
... | repos\flowable-engine-main\modules\flowable-rest\src\main\java\org\flowable\rest\service\api\runtime\SignalResource.java | 2 |
请完成以下Java代码 | public void setAccepted(AcceptedType value) {
this.accepted = value;
}
/**
* Gets the value of the rejected property.
*
* @return
* possible object is
* {@link RejectedType }
*
*/
public RejectedType getRejected() {
return rejected;
}
... | }
/**
* Gets the value of the documents property.
*
* @return
* possible object is
* {@link DocumentsType }
*
*/
public DocumentsType getDocuments() {
return documents;
}
/**
* Sets the value of the documents property.
*
* @param... | repos\metasfresh-new_dawn_uat\backend\vertical-healthcare_ch\forum_datenaustausch_ch.invoice_450_response\src\main\java-xjc\de\metas\vertical\healthcare_ch\forum_datenaustausch_ch\invoice_450\response\BodyType.java | 1 |
请完成以下Java代码 | public void onAfterChanged(final I_C_BPartner_Product bpartnerProduct)
{
final I_C_BPartner_Product bpartnerProductOld = InterfaceWrapperHelper.createOld(bpartnerProduct, I_C_BPartner_Product.class);
final boolean wasExcludedFromSale = isExcludedFromSaleToCustomer(bpartnerProductOld);
final boolean isExcludedFro... | private static boolean isExcludedFromSaleToCustomer(final I_C_BPartner_Product bpartnerProduct)
{
return bpartnerProduct.isActive() && bpartnerProduct.isExcludedFromSale();
}
private MSV3StockAvailabilityService getStockAvailabilityService()
{
return Adempiere.getBean(MSV3StockAvailabilityService.class);
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.vertical.pharma.msv3.server-peer-metasfresh\src\main\java\de\metas\vertical\pharma\msv3\server\peer\metasfresh\interceptor\C_BPartner_Product.java | 1 |
请完成以下Java代码 | public int getExternalSystem_ID()
{
return get_ValueAsInt(COLUMNNAME_ExternalSystem_ID);
}
@Override
public void setExternalSystem_Service_ID (final int ExternalSystem_Service_ID)
{
if (ExternalSystem_Service_ID < 1)
set_ValueNoCheck (COLUMNNAME_ExternalSystem_Service_ID, null);
else
set_ValueNoChe... | {
return get_ValueAsString(COLUMNNAME_Name);
}
@Override
public void setValue (final java.lang.String Value)
{
set_Value (COLUMNNAME_Value, Value);
}
@Override
public java.lang.String getValue()
{
return get_ValueAsString(COLUMNNAME_Value);
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.externalsystem\src\main\java-gen\de\metas\externalsystem\model\X_ExternalSystem_Service.java | 1 |
请完成以下Java代码 | public class SocketServer {
private ServerSocket serverSocket;
private Socket clientSocket;
private PrintWriter out;
private BufferedReader in;
public void start(int port) {
try {
serverSocket = new ServerSocket(port);
clientSocket = serverSocket.accept();
... | stop();
} catch (IOException e) {
}
}
private void close() throws IOException {
in.close();
out.close();
}
private void stop() throws IOException {
clientSocket.close();
serverSocket.close();
}
} | repos\tutorials-master\core-java-modules\core-java-exceptions\src\main\java\com\baeldung\exceptions\socketexception\SocketServer.java | 1 |
请完成以下Java代码 | private Mono<SerializableGraphQlRequest> readRequest(ServerRequest serverRequest) {
if (this.codecDelegate != null) {
ServerRequest.Headers headers = serverRequest.headers();
MediaType contentType;
try {
contentType = headers.contentType().orElse(MediaType.APPLICATION_OCTET_STREAM);
}
catch (Invali... | /**
* Encode the GraphQL response if custom codecs were provided, or return the result map.
* @param response the GraphQL response
* @return the encoded response or the result map
*/
protected Object encodeResponseIfNecessary(WebGraphQlResponse response) {
Map<String, Object> resultMap = response.toMap();
... | repos\spring-graphql-main\spring-graphql\src\main\java\org\springframework\graphql\server\webflux\AbstractGraphQlHttpHandler.java | 1 |
请完成以下Java代码 | public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
} | public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getPictureUrl() {
return pictureUrl;
}
public void setPictureUrl(String pictureUrl) {
this.pictureUrl = pictureUrl;
}
} | repos\tutorials-master\spring-boot-modules\spring-boot-angular\src\main\java\com\baeldung\ecommerce\model\Product.java | 1 |
请在Spring Boot框架中完成以下Java代码 | RequestMatcher getRequestMatcher() {
return this.requestMatcher;
}
private static List<AuthenticationConverter> createDefaultAuthenticationConverters() {
List<AuthenticationConverter> authenticationConverters = new ArrayList<>();
authenticationConverters.add(new JwtClientAssertionAuthenticationConverter());
... | JwtClientAssertionAuthenticationProvider jwtClientAssertionAuthenticationProvider = new JwtClientAssertionAuthenticationProvider(
registeredClientRepository, authorizationService);
authenticationProviders.add(jwtClientAssertionAuthenticationProvider);
X509ClientCertificateAuthenticationProvider x509ClientCerti... | repos\spring-security-main\config\src\main\java\org\springframework\security\config\annotation\web\configurers\oauth2\server\authorization\OAuth2ClientAuthenticationConfigurer.java | 2 |
请在Spring Boot框架中完成以下Java代码 | public HistoricTaskLogEntryQuery caseDefinitionId(String caseDefinitionId) {
this.scopeDefinitionId = caseDefinitionId;
this.scopeType = ScopeTypes.CMMN;
return this;
}
@Override
public HistoricTaskLogEntryQuery subScopeId(String subScopeId) {
this.subScopeId = subScopeId;
... | }
public Date getFromDate() {
return fromDate;
}
public Date getToDate() {
return toDate;
}
public String getTenantId() {
return tenantId;
}
public long getFromLogNumber() {
return fromLogNumber;
}
public long getToLogNumber() {
return toL... | repos\flowable-engine-main\modules\flowable-task-service\src\main\java\org\flowable\task\service\impl\HistoricTaskLogEntryQueryImpl.java | 2 |
请完成以下Java代码 | public Optional<AsyncBatchId> extractAsyncBatchFromItem(final WorkpackagesOnCommitSchedulerTemplate<Object>.Collector collector, final Object item)
{
return asyncBatchBL.getAsyncBatchId(item);
}
};
static
{
SCHEDULER.setCreateOneWorkpackagePerAsyncBatch(true);
}
// services
private final transient IQue... | try (final MDCCloseable ignored1 = TableRecordMDC.putTableRecordReference(model))
{
final List<I_C_Invoice_Candidate> invoiceCandidates = invoiceCandidateHandlerBL.createMissingCandidatesFor(model);
Loggables.addLog("Created {} invoice candidate for {}", invoiceCandidates.size(), model);
}
}
}
... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\invoicecandidate\async\spi\impl\CreateMissingInvoiceCandidatesWorkpackageProcessor.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void setKey(String key) {
this.key = key;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public List<FormField> getFields() {
return fields;
}
public void setFields(List<FormField> f... | return outcomes;
}
public void setOutcomes(List<FormOutcome> outcomes) {
this.outcomes = outcomes;
}
public String getOutcomeVariableName() {
return outcomeVariableName;
}
public void setOutcomeVariableName(String outcomeVariableName) {
this.outcomeVariableName = outco... | repos\flowable-engine-main\modules\flowable-cmmn-rest\src\main\java\org\flowable\cmmn\rest\service\api\FormModelResponse.java | 2 |
请完成以下Java代码 | default ConfigurationPropertySource withAliases(ConfigurationPropertyNameAliases aliases) {
return new AliasedConfigurationPropertySource(this, aliases);
}
/**
* Return a variant of this source that supports a prefix.
* @param prefix the prefix for properties in the source
* @return a {@link ConfigurationPro... | /**
* Return a single new {@link ConfigurationPropertySource} adapted from the given
* Spring {@link PropertySource} or {@code null} if the source cannot be adapted.
* @param source the Spring property source to adapt
* @return an adapted source or {@code null} {@link SpringConfigurationPropertySource}
* @sin... | repos\spring-boot-4.0.1\core\spring-boot\src\main\java\org\springframework\boot\context\properties\source\ConfigurationPropertySource.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public void softDeleteBook() {
Author author = authorRepository.findById(4L).get();
Book book = author.getBooks().get(0);
author.removeBook(book);
}
@Transactional
public void softDeleteAuthor() {
Author author = authorRepository.findById(1L).get();
authorRepositor... | System.out.println();
}
public void displayAllOnlyDeletedAuthors() {
List<Author> authors = authorRepository.findAllOnlyDeleted();
System.out.println("\nAll deleted authors:");
authors.forEach(a -> System.out.println("Author name: " + a.getName()));
System.out.println();
}
... | repos\Hibernate-SpringBoot-master\HibernateSpringBootSoftDeletes\src\main\java\com\bookstore\service\BookstoreService.java | 2 |
请完成以下Java代码 | public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Double getBalance() {
return balance;
}
public void setBalance(Double balance) {
this.balance = balance;
} | public Double addBalance(Double amount) {
if (balance == null)
balance = 0.0;
return balance += amount;
}
public boolean hasFunds(Double amount) {
if (balance == null || amount == null) {
return false;
}
return (balance - amount) >= 0;
}
} | repos\tutorials-master\web-modules\jersey\src\main\java\com\baeldung\jersey\exceptionhandling\data\Wallet.java | 1 |
请完成以下Java代码 | public boolean isAllowed(String uri, @Nullable Authentication authentication) {
return isAllowed(null, uri, null, authentication);
}
@Override
public boolean isAllowed(@Nullable String contextPath, String uri, @Nullable String method,
@Nullable Authentication authentication) {
FilterInvocation filterInvocati... | Assert.notNull(requestTransformer, "requestTransformer cannot be null");
this.requestTransformer = requestTransformer;
}
/**
* Used to transform the {@link HttpServletRequest} prior to passing it into the
* {@link AuthorizationManager}.
*/
public interface HttpServletRequestTransformer {
HttpServletReque... | repos\spring-security-main\web\src\main\java\org\springframework\security\web\access\AuthorizationManagerWebInvocationPrivilegeEvaluator.java | 1 |
请在Spring Boot框架中完成以下Java代码 | private Map<String, Object> producerConfig() {
Map<String, Object> config = new HashMap<>();
config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
config.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
config.put(ProducerConfig.VALUE_SERIALIZER_C... | Map<String, Object> producerConfig = producerConfig();
return SenderOptions.create(producerConfig);
}
@Bean
public ReactiveKafkaProducerTemplate<String, String> reactiveKafkaProducerTemplate() {
return new ReactiveKafkaProducerTemplate<>(senderOptions());
}
@Bean
public Reactiv... | repos\tutorials-master\spring-reactive-modules\spring-reactive-kafka\src\main\java\com\baeldung\config\KafkaConfig.java | 2 |
请完成以下Java代码 | public void paint (Graphics2D g2D, int pageNo, Point2D pageStart,
Properties ctx, boolean isView)
{
if (m_item == null)
return;
//
g2D.setColor(m_color);
BasicStroke s = new BasicStroke(m_item.getLineWidth());
g2D.setStroke(s);
//
Point2D.Double location = getAbsoluteLocation(pageStart);
int x = (... | if (type.equals(MPrintFormatItem.SHAPETYPE_3DRectangle))
g2D.fill3DRect(x, y, width, height, true);
else if (type.equals(MPrintFormatItem.SHAPETYPE_Oval))
g2D.fillOval(x, y, width, height);
else if (type.equals(MPrintFormatItem.SHAPETYPE_RoundRectangle))
g2D.fillRoundRect(x, y, width, height, m_i... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-legacy\org\compiere\print\layout\BoxElement.java | 1 |
请完成以下Java代码 | Optional<AttributeConfig> findMatchingAttributeConfig(
final int orgId,
final I_M_Attribute m_Attribute)
{
final ImmutableList<AttributeConfig> attributeConfigs = getAttributeConfigs();
final Comparator<AttributeConfig> orgComparator = Comparator
.comparing(AttributeConfig::getOrgId)
.reversed();
... | /**
* Visible so that we can stub out the cache in tests.
*/
@VisibleForTesting
ImmutableList<AttributeConfig> getAttributeConfigs()
{
final ImmutableList<AttributeConfig> attributeConfigs = //
cache.getOrLoad(M_IolCandHandler_ID, () -> loadAttributeConfigs(M_IolCandHandler_ID));
return attributeConfigs;... | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\inoutcandidate\spi\ShipmentScheduleHandler.java | 1 |
请完成以下Java代码 | private int getFallbackPreparationDateOffsetInHours() {return sysConfigBL.getIntValue(SYSCONFIG_Fallback_PreparationDate_Offset_Hours, 0);}
@VisibleForTesting
static ZonedDateTime computePreparationTime(final ZonedDateTime preparationTimeBase, final int offsetInHours)
{
ZonedDateTime preparationTime;
if (offset... | // Avoid daylight saving errors in case we have to offset entire days
if (offset % 24 == 0)
{
offset /= 24;
unit = ChronoUnit.DAYS;
}
preparationTime = add
? preparationTimeBase.plus(offset, unit)
: preparationTimeBase.minus(offset, unit);
}
return preparationTime;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.swat\de.metas.swat.base\src\main\java\de\metas\tourplanning\api\impl\OrderDeliveryDayBL.java | 1 |
请完成以下Java代码 | public Set<Entry<String, ClassLoaderFile>> getFilesEntrySet() {
return this.files.entrySet();
}
protected final void add(String name, ClassLoaderFile file) {
this.files.put(name, file);
}
protected final void remove(String name) {
this.files.remove(name);
}
protected final @Nullable ClassLoaderF... | public String getName() {
return this.name;
}
/**
* Return all {@link ClassLoaderFile ClassLoaderFiles} in the collection that are
* contained in this source directory.
* @return the files contained in the source directory
*/
public Collection<ClassLoaderFile> getFiles() {
return Collections.un... | repos\spring-boot-4.0.1\module\spring-boot-devtools\src\main\java\org\springframework\boot\devtools\restart\classloader\ClassLoaderFiles.java | 1 |
请完成以下Java代码 | public class BpmPlatformRootDefinition extends PersistentResourceDefinition {
public static final BpmPlatformRootDefinition INSTANCE = new BpmPlatformRootDefinition();
private BpmPlatformRootDefinition() {
super(new Parameters(BpmPlatformExtension.SUBSYSTEM_PATH,
BpmPlatformExtension.getResourceDescri... | @Override
protected List<? extends PersistentResourceDefinition> getChildren() {
List<PersistentResourceDefinition> children = new ArrayList<>();
children.add(JobExecutorDefinition.INSTANCE);
children.add(ProcessEngineDefinition.INSTANCE);
return children;
}
@Override
public void registerOper... | repos\camunda-bpm-platform-master\distro\wildfly\subsystem\src\main\java\org\camunda\bpm\container\impl\jboss\extension\resource\BpmPlatformRootDefinition.java | 1 |
请完成以下Java代码 | public void setM_HU_PI_Item(final de.metas.handlingunits.model.I_M_HU_PI_Item M_HU_PI_Item)
{
set_ValueFromPO(COLUMNNAME_M_HU_PI_Item_ID, de.metas.handlingunits.model.I_M_HU_PI_Item.class, M_HU_PI_Item);
}
@Override
public void setM_HU_PI_Item_ID (final int M_HU_PI_Item_ID)
{
if (M_HU_PI_Item_ID < 1)
set_... | return get_ValueAsInt(COLUMNNAME_M_HU_PI_Item_ID);
}
@Override
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;
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.handlingunits.base\src\main\java-gen\de\metas\handlingunits\model\X_M_HU_Item.java | 1 |
请在Spring Boot框架中完成以下Java代码 | static class EnableTransactionManagementConfiguration {
@Configuration(proxyBeanMethods = false)
@EnableTransactionManagement(proxyTargetClass = false)
@ConditionalOnBooleanProperty(name = "spring.aop.proxy-target-class", havingValue = false)
static class JdkDynamicAutoProxyConfiguration {
}
@Configurati... | }
@Configuration(proxyBeanMethods = false)
@ConditionalOnBean(AbstractTransactionAspect.class)
static class AspectJTransactionManagementConfiguration {
@Bean
static LazyInitializationExcludeFilter eagerTransactionAspect() {
return LazyInitializationExcludeFilter.forBeanTypes(AbstractTransactionAspect.class)... | repos\spring-boot-4.0.1\module\spring-boot-transaction\src\main\java\org\springframework\boot\transaction\autoconfigure\TransactionAutoConfiguration.java | 2 |
请完成以下Java代码 | public void setPayDate (java.sql.Timestamp PayDate)
{
set_Value (COLUMNNAME_PayDate, PayDate);
}
/** Get Zahldatum.
@return Date Payment made
*/
@Override
public java.sql.Timestamp getPayDate ()
{
return (java.sql.Timestamp)get_Value(COLUMNNAME_PayDate);
}
/** Set PaySelection_includedTab.
@param P... | return (java.lang.String)get_Value(COLUMNNAME_PaySelectionTrxType);
}
/** Set Verarbeitet.
@param Processed
Checkbox sagt aus, ob der Datensatz verarbeitet wurde.
*/
@Override
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Verarbe... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_PaySelection.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class SpringContextUtils implements ApplicationContextAware {
/**
* 上下文对象实例
*/
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringContextUtils.applicationContext = applicationContext;
... | public static String getOrigin(){
HttpServletRequest request = getHttpServletRequest();
return request.getHeader("Origin");
}
/**
* 通过name获取 Bean.
*
* @param name
* @return
*/
public static Object getBean(String name) {
return getApplicationContext().getBean(name);
}
/**
* 通过class获取Bean.
*
... | repos\JeecgBoot-main\jeecg-boot\jeecg-boot-base-core\src\main\java\org\jeecg\common\util\SpringContextUtils.java | 2 |
请完成以下Java代码 | public boolean isTarget()
{
return getMeasureTarget().signum() != 0;
} // isTarget
/**
* String Representation
*
* @return info
*/
@Override
public String toString()
{
StringBuffer sb = new StringBuffer("MGoal[");
sb.append(get_ID())
.append("-").append(getName())
.append(",").append(getGo... | AD_Role_ID = 0;
}
if (AD_Role_ID == 0) // set to first one
setAD_Role_ID(roles.get(0).getRoleId().getRepoId());
} // multiple roles
} // user check
return true;
} // beforeSave
/**
* After Save
*
* @param newRecord new
* @param success success
* @return true
*/
@Override
protecte... | repos\metasfresh-new_dawn_uat\backend\de.metas.business\src\main\java-legacy\org\compiere\model\MGoal.java | 1 |
请完成以下Java代码 | public void setIsSameCurrency (boolean IsSameCurrency)
{
set_Value (COLUMNNAME_IsSameCurrency, Boolean.valueOf(IsSameCurrency));
}
/** Get Same Currency.
@return Same Currency */
public boolean isSameCurrency ()
{
Object oo = get_Value(COLUMNNAME_IsSameCurrency);
if (oo != null)
{
if (oo instanc... | {
Object oo = get_Value(COLUMNNAME_IsTaxIncluded);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_C_Charge.java | 1 |
请完成以下Java代码 | public class AccessorComparator<OT, IT> implements Comparator<OT>
{
private final Comparator<IT> cmp;
private final TypedAccessor<IT> accessor;
/**
*
* @param cmp comparator to be used for comparing inner type values
* @param accessor accessor which will get the inner type from a given outer type object
*/
... | }
if (o1 == null)
{
return +1;
}
if (o2 == null)
{
return -1;
}
final IT value1 = accessor.getValue(o1);
final IT value2 = accessor.getValue(o2);
return cmp.compare(value1, value2);
}
@Override
public String toString()
{
return "AccessorComparator [cmp=" + cmp + ", accessor=" + accessor... | repos\metasfresh-new_dawn_uat\backend\de.metas.util\src\main\java\org\adempiere\util\comparator\AccessorComparator.java | 1 |
请完成以下Java代码 | public class UserWrapper<T> {
@JsonProperty("user")
T content;
@NoArgsConstructor
public static class UserViewWrapper extends UserWrapper<UserView> {
public UserViewWrapper(UserView userView) {
super(userView);
}
}
@NoArgsConstructor
public static class UserRegi... | }
@NoArgsConstructor
public static class UserAuthenticationRequestWrapper extends UserWrapper<UserAuthenticationRequest> {
public UserAuthenticationRequestWrapper(UserAuthenticationRequest user) {
super(user);
}
}
@NoArgsConstructor
public static class UpdateUserRequest... | repos\realworld-spring-webflux-master\src\main\java\com\realworld\springmongo\api\wrappers\UserWrapper.java | 1 |
请完成以下Java代码 | void setCapacity(int capacity)
{
Capacity = capacity;
}
int getCapacity()
{
return Capacity;
}
void setLoad(int load)
{
Load = load;
}
int getLoad()
{
return Load;
}
int getDifference()
{
return Capacity - Load;
}
void setSummary(int s... | {
From = from;
}
String getFrom()
{
return From;
}
void setTo(String to)
{
To = to;
}
String getTo()
{
return To;
}
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.manufacturing\src\main\java\org\eevolution\process\CRPSummary.java | 1 |
请完成以下Java代码 | public void checkRenewal(String token) {
// 判断是否续期token,计算token的过期时间
String loginKey = loginKey(token);
long time = redisUtils.getExpire(loginKey) * 1000;
Date expireDate = DateUtil.offset(new Date(), DateField.MILLISECOND, (int) time);
// 判断当前时间与过期时间的时间差
long differ = ex... | * @return key
*/
public String loginKey(String token) {
Claims claims = getClaims(token);
return properties.getOnlineKey() + claims.getSubject() + ":" + getId(token);
}
/**
* 获取登录用户TokenKey
* @param token /
* @return /
*/
public String getId(String token) {
... | repos\eladmin-master\eladmin-system\src\main\java\me\zhengjie\modules\security\security\TokenProvider.java | 1 |
请完成以下Java代码 | public ImmutableMap<ProductId, String> getProductValues(final ImmutableSet<ProductId> productIds)
{
return productsService.getProductValues(productIds);
}
@NonNull
public String getProductValue(@NonNull final ProductId productId)
{
return productsService.getProductValue(productId);
}
// TODO move this meth... | else if (Type.VALUE.equals(type))
{
return builder
.bpartnerValue(bpartnerIdentifier.asValue())
.build();
}
else if (Type.GLN.equals(type))
{
return builder
.gln(bpartnerIdentifier.asGLN())
.build();
}
else
{
throw new AdempiereException("Invalid bpartnerIdentifier: " + bpartn... | repos\metasfresh-new_dawn_uat\backend\de.metas.business.rest-api-impl\src\main\java\de\metas\rest_api\bpartner_pricelist\BpartnerPriceListServicesFacade.java | 1 |
请完成以下Java代码 | public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj instanceof TypedSqlQueryFilter)
{
final TypedSqlQueryFilter<?> other = (TypedSqlQueryFilter<?>)obj;
return Objects.equals(sql, other.sql)
&& Objects.equals(sqlParams, other.sqlParams);
}
else
{
return ... | @Override
public String getSql()
{
return sql;
}
@Override
public List<Object> getSqlParams(final Properties ctx_NOTUSED)
{
return sqlParams;
}
@Override
public boolean accept(final T model)
{
throw new UnsupportedOperationException();
}
} | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java\org\adempiere\ad\dao\impl\TypedSqlQueryFilter.java | 1 |
请在Spring Boot框架中完成以下Java代码 | public class X_M_ShipmentSchedule_Carrier_Service extends org.compiere.model.PO implements I_M_ShipmentSchedule_Carrier_Service, org.compiere.model.I_Persistent
{
private static final long serialVersionUID = -1460375029L;
/** Standard Constructor */
public X_M_ShipmentSchedule_Carrier_Service (final Propert... | @Override
public void setM_ShipmentSchedule_Carrier_Service_ID (final int M_ShipmentSchedule_Carrier_Service_ID)
{
if (M_ShipmentSchedule_Carrier_Service_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_ShipmentSchedule_Carrier_Service_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_ShipmentSchedule_Carrier_Service_... | repos\metasfresh-new_dawn_uat\backend\de.metas.adempiere.adempiere\base\src\main\java-gen\org\compiere\model\X_M_ShipmentSchedule_Carrier_Service.java | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.