-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from zalando-stups/typed-configs
Enable structured types as config values
- Loading branch information
Showing
25 changed files
with
686 additions
and
259 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
23 changes: 23 additions & 0 deletions
23
src/main/java/org/zalando/baigan/proxy/BaiganConfigClasses.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.zalando.baigan.proxy; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.Map; | ||
|
||
public class BaiganConfigClasses { | ||
private Map<String, Type> configTypesByKey; | ||
|
||
public BaiganConfigClasses() {} | ||
|
||
public void setConfigTypesByKey(Map<String, Type> configTypesByKey) { | ||
configTypesByKey.forEach((key, value) -> { | ||
if (value.getClass().isPrimitive()) { | ||
throw new IllegalArgumentException("Config " + key + " has an illegal return type " + value + ". Primitives are not supported as return type."); | ||
} | ||
}); | ||
this.configTypesByKey = configTypesByKey; | ||
} | ||
|
||
public Map<String, Type> getConfigTypesByKey() { | ||
return configTypesByKey; | ||
} | ||
} |
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
26 changes: 0 additions & 26 deletions
26
src/main/java/org/zalando/baigan/repository/AbstractConfigurationRepository.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.