11 Nisan 2022 Pazartesi

Jakarta EE Generics

Örnek
Şöyle yaparız
interface MyInterface<T> { }

class MyStringBean implements MyInterface<String> { }

class MyIntegerBean implements MyInterface<Integer> { }

// resolves to MyStringBean:
@Inject
MyInterface<String> myString;

// resolves to MyIntegerBean:
@Inject
MyInterface<Integer> myInteger;

Hiç yorum yok:

Yorum Gönder

Bean Validation @GroupSequence Anotasyonu

Örnek Elimizde şöyle bir kod olsun public class SampleRequest {   @NotNull   LocalDate startDate;   @NotNull   LocalDate endDate;   @AssertT...