lombok.NonNull.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(193)

本文整理了Java中lombok.NonNull.<init>()方法的一些代码示例,展示了NonNull.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NonNull.<init>()方法的具体详情如下:
包路径:lombok.NonNull
类名称:NonNull
方法名:<init>

NonNull.<init>介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-elasticsearch

/**
 * An {@link ReactiveElasticsearchQueryExecution} that wraps the results of the given delegate with the given result
 * processing.
 */
@RequiredArgsConstructor
final class ResultProcessingExecution implements ReactiveElasticsearchQueryExecution {
  private final @NonNull ReactiveElasticsearchQueryExecution delegate;
  private final @NonNull Converter<Object, Object> converter;
  @Override
  public Object execute(Query query, Class<?> type, String indexName, String indexType,
      @Nullable Class<?> targetType) {
    return converter.convert(delegate.execute(query, type, indexName, indexType, targetType));
  }
}

代码示例来源:origin: spring-projects/spring-data-mongodb

/**
 * An {@link ReactiveMongoQueryExecution} that wraps the results of the given delegate with the given result
 * processing.
 */
@RequiredArgsConstructor
final class ResultProcessingExecution implements ReactiveMongoQueryExecution {
  private final @NonNull ReactiveMongoQueryExecution delegate;
  private final @NonNull Converter<Object, Object> converter;
  @Override
  public Object execute(Query query, Class<?> type, String collection) {
    return converter.convert(delegate.execute(query, type, collection));
  }
}

代码示例来源:origin: spring-projects/spring-data-examples

/**
 * {@link ContactRepository} fragment implementation.
 *
 * @author Mark Paluch
 */
@RequiredArgsConstructor
public class ContactRepositoryImpl implements ContactRepository {

  final @NonNull EntityManager entityManager;

  /*
   * (non-Javadoc)
   * @see example.springdata.jpa.compositions.ContactRepository#findRelatives(example.springdata.jpa.compositions.Contact)
   */
  @Override
  @SuppressWarnings("unchecked")
  public List<Contact> findRelatives(Contact contact) {

    return entityManager.createQuery("SELECT u FROM User u WHERE u.lastname = :lastname") //
        .setParameter("lastname", contact.getLastname()) //
        .getResultList();
  }
}

代码示例来源:origin: spring-projects/spring-data-elasticsearch

/**
   * A {@link Converter} to post-process all source objects using the given {@link ResultProcessor}.
   *
   * @author Mark Paluch
   */
  @RequiredArgsConstructor
  final class ResultProcessingConverter implements Converter<Object, Object> {

    private final @NonNull ResultProcessor processor;
    private final @NonNull ReactiveElasticsearchOperations operations;

    /*
     * (non-Javadoc)
     * @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
     */
    @Override
    public Object convert(Object source) {

      ReturnedType returnedType = processor.getReturnedType();

      if (ClassUtils.isPrimitiveOrWrapper(returnedType.getReturnedType())) {
        return source;
      }

      return processor.processResult(source, it -> it);
    }
  }
}

代码示例来源:origin: spring-projects/spring-data-mongodb

@RequiredArgsConstructor
final class ResultProcessingConverter implements Converter<Object, Object> {
  private final @NonNull ResultProcessor processor;
  private final @NonNull ReactiveMongoOperations operations;
  private final @NonNull EntityInstantiators instantiators;

代码示例来源:origin: spring-projects/spring-data-mongodb

/**
 * Simple {@link DocumentCallback} that will transform {@link Document} into the given target type using the given
 * {@link EntityReader}.
 *
 * @author Oliver Gierke
 * @author Christoph Strobl
 */
@RequiredArgsConstructor
private class ReadDocumentCallback<T> implements DocumentCallback<T> {
  private final @NonNull EntityReader<? super T, Bson> reader;
  private final @NonNull Class<T> type;
  private final String collectionName;
  @Nullable
  public T doWith(@Nullable Document object) {
    if (null != object) {
      maybeEmitEvent(new AfterLoadEvent<>(object, type, collectionName));
    }
    T source = reader.read(type, object);
    if (null != source) {
      maybeEmitEvent(new AfterConvertEvent<>(object, source, collectionName));
    }
    return source;
  }
}

代码示例来源:origin: spring-projects/spring-data-mongodb

/**
   * {@link MongoQueryExecution} removing documents matching the query.
   *
   * @since 1.5
   */
  @RequiredArgsConstructor
  final class DeleteExecution implements MongoQueryExecution {

    private final @NonNull MongoOperations operations;
    private final @NonNull MongoQueryMethod method;

    /*
     * (non-Javadoc)
     * @see org.springframework.data.mongodb.repository.query.MongoQueryExecution#execute(org.springframework.data.mongodb.core.query.Query)
     */
    @Override
    public Object execute(Query query) {

      String collectionName = method.getEntityInformation().getCollectionName();
      Class<?> type = method.getEntityInformation().getJavaType();

      if (method.isCollectionQuery()) {
        return operations.findAllAndRemove(query, type, collectionName);
      }

      DeleteResult writeResult = operations.remove(query, type, collectionName);
      return writeResult != null ? writeResult.getDeletedCount() : 0L;
    }
  }
}

代码示例来源:origin: spring-projects/spring-data-mongodb

/**
 * {@link MongoQueryExecution} for {@link Slice} query methods.
 *
 * @author Oliver Gierke
 * @author Christoph Strobl
 * @since 1.5
 */
@RequiredArgsConstructor
final class SlicedExecution implements MongoQueryExecution {
  private final @NonNull FindWithQuery<?> find;
  private final @NonNull Pageable pageable;
  /*
   * (non-Javadoc)
   * @see org.springframework.data.mongodb.repository.query.MongoQueryExecution#execute(org.springframework.data.mongodb.core.query.Query)
   */
  @Override
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public Object execute(Query query) {
    int pageSize = pageable.getPageSize();
    // Apply Pageable but tweak limit to peek into next page
    Query modifiedQuery = query.with(pageable).limit(pageSize + 1);
    List result = find.matching(modifiedQuery).all();
    boolean hasNext = result.size() > pageSize;
    return new SliceImpl<Object>(hasNext ? result.subList(0, pageSize) : result, pageable, hasNext);
  }
}

代码示例来源:origin: spring-projects/spring-data-examples

@RequiredArgsConstructor
public class UserEntityLookup extends EntityLookupSupport<User> {
  private final @NonNull UserRepository repository;

代码示例来源:origin: spring-projects/spring-data-mongodb

@RequiredArgsConstructor
private class ProjectingReadCallback<S, T> implements DocumentCallback<T> {
  private final @NonNull EntityReader<Object, Bson> reader;
  private final @NonNull Class<S> entityType;
  private final @NonNull Class<T> targetType;
  private final @NonNull String collectionName;

代码示例来源:origin: spring-projects/spring-data-mongodb

@RequiredArgsConstructor
private class ProjectingReadCallback<S, T> implements DocumentCallback<T> {
  private final @NonNull EntityReader<Object, Bson> reader;
  private final @NonNull Class<S> entityType;
  private final @NonNull Class<T> targetType;
  private final @NonNull String collectionName;

代码示例来源:origin: spring-projects/spring-data-examples

@RequiredArgsConstructor
public class EmployeeRepositoryImpl implements EmployeeRepository {
  final @NonNull EntityManager entityManager;

代码示例来源:origin: apache/incubator-gobblin

@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public static class TableMetadata {
 @NonNull private String database;
 @NonNull private String table;
 @NonNull private Schema tableSchema;

代码示例来源:origin: spring-projects/spring-data-mongodb

/**
 * {@link MongoQueryExecution} for pagination queries.
 *
 * @author Oliver Gierke
 * @author Mark Paluch
 */
@RequiredArgsConstructor
final class PagedExecution implements MongoQueryExecution {
  private final @NonNull FindWithQuery<?> operation;
  private final @NonNull Pageable pageable;
  /*
   * (non-Javadoc)
   * @see org.springframework.data.mongodb.repository.query.MongoQueryExecution#execute(org.springframework.data.mongodb.core.query.Query)
   */
  @Override
  public Object execute(Query query) {
    int overallLimit = query.getLimit();
    TerminatingFind<?> matching = operation.matching(query);
    // Apply raw pagination
    query.with(pageable);
    // Adjust limit if page would exceed the overall limit
    if (overallLimit != 0 && pageable.getOffset() + pageable.getPageSize() > overallLimit) {
      query.limit((int) (overallLimit - pageable.getOffset()));
    }
    return PageableExecutionUtils.getPage(matching.all(), pageable, () -> {
      long count = matching.count();
      return overallLimit != 0 ? Math.min(count, overallLimit) : count;
    });
  }
}

代码示例来源:origin: spring-projects/spring-data-mongodb

@RequiredArgsConstructor
class GeoNearExecution implements MongoQueryExecution {
  private final @NonNull FindWithQuery<?> operation;
  private final @NonNull MongoQueryMethod method;
  private final @NonNull MongoParameterAccessor accessor;

代码示例来源:origin: spring-projects/spring-data-examples

@RequiredArgsConstructor
public class DataInitializer {
  private final @NonNull OrderRepository orders;
  private final @NonNull CustomerRepository customers;

代码示例来源:origin: spring-projects/spring-data-examples

@RequiredArgsConstructor
public class FlushOnSaveRepositoryImpl<T> implements FlushOnSaveRepository<T> {
  final @NonNull EntityManager entityManager;

代码示例来源:origin: spring-projects/spring-data-mongodb

@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public class PartialIndexFilter implements IndexFilter {
  private final @NonNull Object filterExpression;

代码示例来源:origin: spring-projects/spring-data-redis

@RequiredArgsConstructor
class DefaultReactiveHyperLogLogOperations<K, V> implements ReactiveHyperLogLogOperations<K, V> {
  private final @NonNull ReactiveRedisTemplate<?, ?> template;
  private final @NonNull RedisSerializationContext<K, V> serializationContext;

代码示例来源:origin: spring-projects/spring-data-redis

@RequiredArgsConstructor
class LettuceReactivePubSubCommands implements ReactivePubSubCommands {
  private final @NonNull LettuceReactiveRedisConnection connection;

相关文章

NonNull类方法