Hmmmm .. how to express an optional dependency in ...
# spring
s
Hmmmm .. how to express an optional dependency in a spring component in kotlin ..
lateinit var
can't be used as it can't be a nullable type I don't want to use
Optional
as it doesn't seem the "kotlin way". Basically what would be the kotlin way for the following pure code:
Copy code
public class Component {
  public Component(Required required, Optional<NotRequired> optional) {....}
}
or alternatively the OLD spring annotated way
Copy code
public class Component {

  @Autowired(required=false) NotRequired optional;

  public Component(Required required) {....}
}