Skip to content

Instantly share code, notes, and snippets.

@satylogin
Created November 13, 2020 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satylogin/6a41774345a53b8fd3ec76219517e425 to your computer and use it in GitHub Desktop.
Save satylogin/6a41774345a53b8fd3ec76219517e425 to your computer and use it in GitHub Desktop.
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