-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a default implementation of delegate if none could be autowired (
#92)
- Loading branch information
Showing
20 changed files
with
78 additions
and
52 deletions.
There are no files selected for viewing
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
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
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
7 changes: 4 additions & 3 deletions
7
...e/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.openapitools.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import java.util.Optional; | ||
|
||
@Controller | ||
public class AnotherFakeApiController implements AnotherFakeApi { | ||
|
||
private final AnotherFakeApiDelegate delegate; | ||
|
||
@org.springframework.beans.factory.annotation.Autowired | ||
public AnotherFakeApiController(AnotherFakeApiDelegate delegate) { | ||
this.delegate = delegate; | ||
public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) AnotherFakeApiDelegate delegate) { | ||
this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); | ||
} | ||
|
||
@Override | ||
public AnotherFakeApiDelegate getDelegate() { | ||
return delegate; | ||
} | ||
|
||
} |
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
7 changes: 4 additions & 3 deletions
7
...petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.openapitools.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import java.util.Optional; | ||
|
||
@Controller | ||
public class FakeApiController implements FakeApi { | ||
|
||
private final FakeApiDelegate delegate; | ||
|
||
@org.springframework.beans.factory.annotation.Autowired | ||
public FakeApiController(FakeApiDelegate delegate) { | ||
this.delegate = delegate; | ||
public FakeApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeApiDelegate delegate) { | ||
this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); | ||
} | ||
|
||
@Override | ||
public FakeApiDelegate getDelegate() { | ||
return delegate; | ||
} | ||
|
||
} |
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
7 changes: 4 additions & 3 deletions
7
...ngboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.openapitools.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import java.util.Optional; | ||
|
||
@Controller | ||
public class FakeClassnameTestApiController implements FakeClassnameTestApi { | ||
|
||
private final FakeClassnameTestApiDelegate delegate; | ||
|
||
@org.springframework.beans.factory.annotation.Autowired | ||
public FakeClassnameTestApiController(FakeClassnameTestApiDelegate delegate) { | ||
this.delegate = delegate; | ||
public FakeClassnameTestApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) FakeClassnameTestApiDelegate delegate) { | ||
this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); | ||
} | ||
|
||
@Override | ||
public FakeClassnameTestApiDelegate getDelegate() { | ||
return delegate; | ||
} | ||
|
||
} |
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
7 changes: 4 additions & 3 deletions
7
.../petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.openapitools.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import java.util.Optional; | ||
|
||
@Controller | ||
public class PetApiController implements PetApi { | ||
|
||
private final PetApiDelegate delegate; | ||
|
||
@org.springframework.beans.factory.annotation.Autowired | ||
public PetApiController(PetApiDelegate delegate) { | ||
this.delegate = delegate; | ||
public PetApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) PetApiDelegate delegate) { | ||
this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); | ||
} | ||
|
||
@Override | ||
public PetApiDelegate getDelegate() { | ||
return delegate; | ||
} | ||
|
||
} |
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
7 changes: 4 additions & 3 deletions
7
...etstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.openapitools.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import java.util.Optional; | ||
|
||
@Controller | ||
public class StoreApiController implements StoreApi { | ||
|
||
private final StoreApiDelegate delegate; | ||
|
||
@org.springframework.beans.factory.annotation.Autowired | ||
public StoreApiController(StoreApiDelegate delegate) { | ||
this.delegate = delegate; | ||
public StoreApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) StoreApiDelegate delegate) { | ||
this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); | ||
} | ||
|
||
@Override | ||
public StoreApiDelegate getDelegate() { | ||
return delegate; | ||
} | ||
|
||
} |
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
7 changes: 4 additions & 3 deletions
7
...petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiController.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package org.openapitools.api; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import java.util.Optional; | ||
|
||
@Controller | ||
public class UserApiController implements UserApi { | ||
|
||
private final UserApiDelegate delegate; | ||
|
||
@org.springframework.beans.factory.annotation.Autowired | ||
public UserApiController(UserApiDelegate delegate) { | ||
this.delegate = delegate; | ||
public UserApiController(@org.springframework.beans.factory.annotation.Autowired(required = false) UserApiDelegate delegate) { | ||
this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); | ||
} | ||
|
||
@Override | ||
public UserApiDelegate getDelegate() { | ||
return delegate; | ||
} | ||
|
||
} |
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
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
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
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
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
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