JAVA-628: Moved 3 articles from spring-core
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
package com.baeldung.lombok;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ApologizeService {
|
||||
|
||||
private final Translator translator;
|
||||
private final String message;
|
||||
|
||||
@Autowired
|
||||
public ApologizeService(Translator translator) {
|
||||
this(translator, "sorry");
|
||||
}
|
||||
|
||||
public String apologize() {
|
||||
return translator.translate(message);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.baeldung.lombok;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class FarewellService {
|
||||
|
||||
private final Translator translator;
|
||||
|
||||
public FarewellService(Translator translator) {
|
||||
this.translator = translator;
|
||||
}
|
||||
|
||||
public String farewell() {
|
||||
return translator.translate("bye");
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.baeldung.lombok;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GreetingService {
|
||||
|
||||
@Autowired
|
||||
private Translator translator;
|
||||
|
||||
public String greet() {
|
||||
return translator.translate("hello");
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.baeldung.lombok;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class ThankingService {
|
||||
|
||||
private final Translator translator;
|
||||
|
||||
public String thank() {
|
||||
return translator.translate("thank you");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.baeldung.lombok;
|
||||
|
||||
public interface Translator {
|
||||
String translate(String input);
|
||||
}
|
||||
Reference in New Issue
Block a user