Skip to content

Commit e271f15

Browse files
committed
refactor: IDE auto code cleanup
1 parent 0ee4f4e commit e271f15

File tree

434 files changed

+11387
-10916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+11387
-10916
lines changed

README.md

+126-60
Large diffs are not rendered by default.

demos/roms-documents/pom.xml

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
99
<version>3.2.5</version>
10-
<relativePath /> <!-- lookup parent from repository -->
10+
<relativePath/> <!-- lookup parent from repository -->
1111
</parent>
1212

1313
<groupId>com.redis.om</groupId>
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>com.redis.om</groupId>
3333
<artifactId>redis-om-spring</artifactId>
34-
<version>0.9.1-SNAPSHOT</version>
34+
<version>0.9.1</version>
3535
</dependency>
3636
<dependency>
3737
<groupId>org.springframework.boot</groupId>
@@ -65,11 +65,11 @@
6565
<version>${testcontainers.redis.version}</version>
6666
<scope>test</scope>
6767
</dependency>
68-
<!-- <dependency>-->
69-
<!-- <groupId>org.springdoc</groupId>-->
70-
<!-- <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>-->
71-
<!-- <version>2.0.0</version>-->
72-
<!-- </dependency>-->
68+
<!-- <dependency>-->
69+
<!-- <groupId>org.springdoc</groupId>-->
70+
<!-- <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>-->
71+
<!-- <version>2.0.0</version>-->
72+
<!-- </dependency>-->
7373
</dependencies>
7474

7575
<repositories>
@@ -147,7 +147,7 @@
147147
<path>
148148
<groupId>com.redis.om</groupId>
149149
<artifactId>redis-om-spring</artifactId>
150-
<version>0.9.1-SNAPSHOT</version>
150+
<version>0.9.1</version>
151151
</path>
152152
</annotationProcessorPaths>
153153
</configuration>

demos/roms-documents/src/main/java/com/redis/om/documents/RomsDocumentsApplication.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,20 @@ public class RomsDocumentsApplication {
2525
@Autowired
2626
PersonRepository personRepo;
2727

28+
public static void main(String[] args) {
29+
SpringApplication.run(RomsDocumentsApplication.class, args);
30+
}
31+
2832
@Bean
2933
CommandLineRunner loadTestData() {
3034
return args -> {
3135
companyRepo.deleteAll();
32-
Company redis = Company.of("Redis", "https://redis.com", new Point(-122.066540, 37.377690), 526, 2011, Set.of(CompanyMeta.of("Redis", 100, Set.of("RedisTag"))));
36+
Company redis = Company.of("Redis", "https://redis.com", new Point(-122.066540, 37.377690), 526, 2011,
37+
Set.of(CompanyMeta.of("Redis", 100, Set.of("RedisTag"))));
3338
redis.setTags(Set.of("fast", "scalable", "reliable"));
3439

35-
Company microsoft = Company.of("Microsoft", "https://microsoft.com", new Point(-122.124500, 47.640160), 182268, 1975, Set.of(CompanyMeta.of("MS", 50, Set.of("MsTag"))));
40+
Company microsoft = Company.of("Microsoft", "https://microsoft.com", new Point(-122.124500, 47.640160), 182268,
41+
1975, Set.of(CompanyMeta.of("MS", 50, Set.of("MsTag"))));
3642
microsoft.setTags(Set.of("innovative", "reliable"));
3743

3844
companyRepo.save(redis);
@@ -46,8 +52,4 @@ CommandLineRunner loadTestData() {
4652
};
4753
}
4854

49-
public static void main(String[] args) {
50-
SpringApplication.run(RomsDocumentsApplication.class, args);
51-
}
52-
5355
}

demos/roms-documents/src/main/java/com/redis/om/documents/controllers/CompanyController.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,35 @@
1818
public class CompanyController {
1919
@Autowired
2020
CompanyRepository repository;
21-
21+
2222
@GetMapping("employees/count/{count}")
2323
Iterable<Company> byNumberOfEmployees(@PathVariable("count") int count) {
2424
return repository.findByNumberOfEmployees(count);
2525
}
26-
26+
2727
@GetMapping("employees/range/{low}/{high}")
2828
Iterable<Company> byNumberOfEmployeesRange(@PathVariable("low") int low, @PathVariable("high") int high) {
2929
return repository.findByNumberOfEmployeesBetween(low, high);
3030
}
31-
31+
3232
@GetMapping("all")
3333
Page<Company> all(Pageable pageable) {
3434
return repository.findAll(pageable);
3535
}
36-
36+
3737
@GetMapping("all-ids")
3838
Page<String> allIds(Pageable pageable) {
3939
return repository.getIds(pageable);
4040
}
4141

4242
@GetMapping("near")
4343
Iterable<Company> byLocationNear(//
44-
@RequestParam("lat") double lat, //
45-
@RequestParam("lon") double lon, //
46-
@RequestParam("d") double distance) {
44+
@RequestParam("lat") double lat, //
45+
@RequestParam("lon") double lon, //
46+
@RequestParam("d") double distance) {
4747
return repository.findByLocationNear(new Point(lon, lat), new Distance(distance, Metrics.MILES));
4848
}
49-
49+
5050
@GetMapping("name/starts/{prefix}")
5151
Iterable<Company> byNameStartingWith(@PathVariable("prefix") String prefix) {
5252
return repository.findByNameStartingWith(prefix);

demos/roms-documents/src/main/java/com/redis/om/documents/controllers/EventController.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
@RequiredArgsConstructor
1818
public class EventController {
1919

20-
private final EventService eventService;
20+
private final EventService eventService;
2121

22-
@GetMapping("between")
23-
List<Event> byNumberOfEmployees(@RequestParam("start")
24-
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime start,
25-
@RequestParam("end")
26-
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime end) {
27-
return eventService.searchByBeginDateBetween(start, end);
28-
}
22+
@GetMapping("between")
23+
List<Event> byNumberOfEmployees(
24+
@RequestParam("start") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime start,
25+
@RequestParam("end") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime end) {
26+
return eventService.searchByBeginDateBetween(start, end);
27+
}
2928

3029
}

demos/roms-documents/src/main/java/com/redis/om/documents/controllers/PersonController.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@
2020
public class PersonController {
2121
@Autowired
2222
PersonRepository repository;
23-
23+
2424
@GetMapping("all")
2525
Page<Person> all(Pageable pageable) {
2626
return repository.findAll(pageable);
2727
}
28-
28+
2929
@GetMapping("all-ids")
3030
Page<String> allIds(Pageable pageable) {
3131
return repository.getIds(pageable);
3232
}
33-
33+
3434
@GetMapping("name/{last}/{first}")
3535
List<Person> byLastAndFirst(//
36-
@PathVariable("last") String last, @PathVariable("first") String first) {
36+
@PathVariable("last") String last, @PathVariable("first") String first) {
3737
return repository.findByLastNameAndFirstName(last, first);
3838
}
39-
39+
4040
@GetMapping("{id}")
4141
Optional<Person> byId(@PathVariable("id") String id) {
4242
return repository.findById(id);

demos/roms-documents/src/main/java/com/redis/om/documents/domain/Company.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ public class Company {
4949
private Set<CompanyMeta> metaList;
5050

5151
private boolean publiclyListed;
52-
52+
5353
// audit fields
54-
54+
5555
@CreatedDate
5656
private Date createdDate;
57-
57+
5858
@LastModifiedDate
5959
private Date lastModifiedDate;
6060
}

demos/roms-documents/src/main/java/com/redis/om/documents/domain/Event.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
@AllArgsConstructor
1515
@Document
1616
public class Event {
17-
@Id
18-
private String id;
17+
@Id
18+
private String id;
1919

20-
@NonNull
21-
@Searchable
22-
private String name;
20+
@NonNull
21+
@Searchable
22+
private String name;
2323

24-
@Indexed
25-
private LocalDateTime beginDate;
24+
@Indexed
25+
private LocalDateTime beginDate;
2626

27-
@Indexed
28-
private LocalDateTime endDate;
27+
@Indexed
28+
private LocalDateTime endDate;
2929

3030
}

demos/roms-documents/src/main/java/com/redis/om/documents/domain/Person.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
public class Person {
1515
@Id
1616
private String id;
17-
17+
1818
@NonNull
1919
@TextIndexed
2020
private String firstName;
21-
21+
2222
@NonNull
2323
@TextIndexed
2424
private String lastName;
25-
25+
2626
@NonNull
2727
@TagIndexed
2828
private String email;

demos/roms-documents/src/main/java/com/redis/om/documents/repositories/CompanyRepository.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@
1313
public interface CompanyRepository extends RedisDocumentRepository<Company, String> {
1414
// find one by property
1515
Optional<Company> findOneByName(String name);
16-
16+
1717
// geospatial query
18-
Iterable<Company> findByLocationNear(Point point, Distance distance);
19-
18+
Iterable<Company> findByLocationNear(Point point, Distance distance);
19+
2020
// find by tag field, using JRediSearch "native" annotation
2121
@Query("@tags:{$tags}")
2222
Iterable<Company> findByTags(@Param("tags") Set<String> tags);
23-
23+
2424
// find by numeric property
2525
Iterable<Company> findByNumberOfEmployees(int noe);
26-
26+
2727
// find by numeric property range
2828
Iterable<Company> findByNumberOfEmployeesBetween(int noeGT, int noeLT);
29-
29+
3030
// starting with/ending with
3131
Iterable<Company> findByNameStartingWith(String prefix);
3232
}

demos/roms-documents/src/main/java/com/redis/om/documents/service/EventService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
import java.util.List;
77

88
public interface EventService {
9-
List<Event> searchByBeginDateBetween(LocalDateTime start, LocalDateTime end);
9+
List<Event> searchByBeginDateBetween(LocalDateTime start, LocalDateTime end);
1010
}

demos/roms-documents/src/main/java/com/redis/om/documents/service/impl/EventServiceImpl.java

+5-7
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
@RequiredArgsConstructor
1616
public class EventServiceImpl implements EventService {
1717

18-
private final EntityStream entityStream;
18+
private final EntityStream entityStream;
1919

20-
@Override
21-
public List<Event> searchByBeginDateBetween(LocalDateTime start, LocalDateTime end) {
20+
@Override
21+
public List<Event> searchByBeginDateBetween(LocalDateTime start, LocalDateTime end) {
2222

23-
return entityStream.of(Event.class)
24-
.filter(Event$.BEGIN_DATE.between(start, end))
25-
.collect(Collectors.toList());
26-
}
23+
return entityStream.of(Event.class).filter(Event$.BEGIN_DATE.between(start, end)).collect(Collectors.toList());
24+
}
2725
}

demos/roms-documents/src/test/java/com/redis/om/documents/AbstractDocumentTest.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
@Testcontainers
1111
@DirtiesContext
1212
@SpringBootTest(
13-
classes = AbstractDocumentTest.Config.class,
14-
properties = {"spring.main.allow-bean-definition-overriding=true"}
13+
classes = AbstractDocumentTest.Config.class, properties = { "spring.main.allow-bean-definition-overriding=true" }
1514
)
1615
public abstract class AbstractDocumentTest extends AbstractTest {
17-
@SpringBootApplication
18-
@Configuration
19-
@EnableRedisDocumentRepositories
20-
static class Config extends TestConfig {
21-
}
16+
@SpringBootApplication
17+
@Configuration
18+
@EnableRedisDocumentRepositories
19+
static class Config extends TestConfig {
20+
}
2221
}

demos/roms-documents/src/test/java/com/redis/om/documents/AbstractTest.java

+24-24
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,36 @@
1818
@Testcontainers(disabledWithoutDocker = true)
1919
@DirtiesContext
2020
public abstract class AbstractTest {
21-
@Container
22-
static final RedisStackContainer REDIS;
21+
@Container
22+
static final RedisStackContainer REDIS;
2323

24-
static {
25-
REDIS = new RedisStackContainer(DEFAULT_IMAGE_NAME.withTag("edge")).withReuse(true);
26-
REDIS.start();
27-
}
24+
static {
25+
REDIS = new RedisStackContainer(DEFAULT_IMAGE_NAME.withTag("edge")).withReuse(true);
26+
REDIS.start();
27+
}
2828

29-
@Autowired
30-
protected StringRedisTemplate template;
29+
@Autowired
30+
protected StringRedisTemplate template;
3131

32-
@Autowired
33-
protected RedisModulesOperations<String> modulesOperations;
32+
@Autowired
33+
protected RedisModulesOperations<String> modulesOperations;
3434

35-
@Autowired
36-
@Qualifier("redisCustomKeyValueTemplate")
37-
protected CustomRedisKeyValueTemplate kvTemplate;
35+
@Autowired
36+
@Qualifier("redisCustomKeyValueTemplate")
37+
protected CustomRedisKeyValueTemplate kvTemplate;
3838

39-
@Autowired
40-
protected RediSearchIndexer indexer;
39+
@Autowired
40+
protected RediSearchIndexer indexer;
4141

42-
@DynamicPropertySource
43-
static void properties(DynamicPropertyRegistry registry) {
44-
registry.add("spring.redis.host", REDIS::getHost);
45-
registry.add("spring.redis.port", REDIS::getFirstMappedPort);
46-
}
42+
@DynamicPropertySource
43+
static void properties(DynamicPropertyRegistry registry) {
44+
registry.add("spring.redis.host", REDIS::getHost);
45+
registry.add("spring.redis.port", REDIS::getFirstMappedPort);
46+
}
4747

48-
protected void flushSearchIndexFor(Class<?> entityClass) {
49-
indexer.dropIndexAndDocumentsFor(entityClass);
50-
indexer.createIndexFor(entityClass);
51-
}
48+
protected void flushSearchIndexFor(Class<?> entityClass) {
49+
indexer.dropIndexAndDocumentsFor(entityClass);
50+
indexer.createIndexFor(entityClass);
51+
}
5252

5353
}

demos/roms-documents/src/test/java/com/redis/om/documents/RomsDocumentsApplicationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//@SpringBootTest
66
class RomsDocumentsApplicationTests {
77

8-
@Test
9-
void contextLoads() {
10-
}
8+
@Test
9+
void contextLoads() {
10+
}
1111

1212
}

0 commit comments

Comments
 (0)