Created
November 13, 2020 05:16
-
-
Save satylogin/6a41774345a53b8fd3ec76219517e425 to your computer and use it in GitHub Desktop.
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
import lombok.NonNull; | |
import com.google.inject.Inject; | |
public abstract class Base { | |
@NonNull protected final String name; | |
protected Base(@NonNull final String name) { | |
this.name = name; | |
} | |
public abstract String getInfo(); | |
} | |
public class Concrete extends Base { | |
@NonNull private final String address; | |
@Inject | |
public Concrete( | |
@NonNull final String name, | |
@NonNull final String address | |
) { | |
super(name); | |
this.address = address; | |
} | |
@Override | |
public String getInfo() { | |
return this.name + " lives in " + this.address; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment