- Using Generics with wildcards
- Unbounded wildcards
- Bounded wildcards
- Upper bounded wildcards
- Lower bounded wildcards
- Arrays with Generic types
- Using Generic types as parameter of a class or an interface.
- Using Generic types with method or constructor definition.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mainul35.entity.order; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import org.springframework.data.annotation.Id; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
import org.springframework.data.mongodb.core.mapping.Field; | |
import java.math.BigDecimal; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker run -p 5432:5432 \ | |
-e POSTGRES_PASSWORD=123456 \ | |
-e POSTGRES_HOST_AUTH_METHOD=trust \ | |
--add-host=social_community:172.24.5.110 postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringClassesComparison { | |
public static void main(String[] args) { | |
String s = ""; | |
StringBuffer stringBuffer = new StringBuffer (""); | |
StringBuilder stringBuilder = new StringBuilder (""); | |
long millis = System.currentTimeMillis (); | |
for (int i = 0; i < 10000; i++) { | |
s += "something"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StackHeapUnderstanding { | |
public static void main(String[] args) { | |
int i1 = 10; | |
int i2 = 10; | |
Integer i3 = Integer.valueOf (10); | |
System.out.println ("For int values: "); | |
System.out.println (i1 == i2); | |
System.out.println (i1 == i3); | |
System.out.println (i3.equals (i1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Repository | |
public interface ReservationRepository extends ReactiveCrudRepository<Reservation, Long> { | |
Mono<Reservation> getReservationByRoomId(Long roomId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class ReactivespringApplication implements CommandLineRunner { | |
@Autowired | |
private DatabaseClient databaseClient; | |
@Autowired | |
private ReservationRepository reservationRepository; | |
public static void main(String[] args) { | |
SpringApplication.run(ReactivespringApplication.class, args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableR2dbcRepositories(basePackages = "com.mainul35.repositories") | |
public class DatabaseConfig extends AbstractR2dbcConfiguration { | |
@Value("${datasource.host}") | |
private String host; | |
@Value("${datasource.port}") | |
private int port; | |
@Value("${datasource.database}") | |
private String database; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
# Database connection url: r2dbc:postgresql://host/bd_name | |
spring.r2dbc.url=r2dbc:postgresql://localhost/r2dbc_test | |
# Connection username | |
spring.r2dbc.username=postgres | |
# Connection Password | |
spring.r2dbc.password= | |
``` |
NewerOlder