Created
March 25, 2016 16:11
-
-
Save SlyDen/8c1810470445f895cbd0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MyConfig { | |
private final String dogsName | |
private final int dogsAge | |
private final List<Raindeer> raindeers | |
static class Raindeer { | |
private final String name | |
private final String position | |
@JsonCreator | |
Raindeer(@JsonProperty('name') String name, | |
@JsonProperty('position') String position) { | |
this.name = name | |
this.position = position | |
} | |
} | |
@JsonCreator | |
public MyConfig(@JsonProperty('dogsName') String dogsName, | |
@JsonProperty('dogsAge') int dogsAge, | |
@JsonProperty('raindeers') Map<String,Raindeer> s) { | |
this.dogsName = dogsName | |
this.dogsAge = dogsAge | |
this.raindeers = s.values().toList() | |
} | |
} | |
//MYC_APP__DOGS_NAME=woofer2 MYC_APP__DOGS_AGE=31 MYC_APP__RAINDEERS__1__NAME=Rudolf MYC_APP__RAINDEERS__1__POSITION=Front MYC_APP__RAINDEERS__2__NAME=Comet MYC_APP__RAINDEERS__2__POSITION=Back groovy rpcdemo.groovy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment