Skip to content

Commit

Permalink
Fix AuthenticationProviderConfiguration marshaling/unmarshaling for d…
Browse files Browse the repository at this point in the history
…eep nested options and the title attributes
  • Loading branch information
poikilotherm committed Mar 16, 2020
1 parent 100d96a commit 1413223
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public class AuthenticationProviderConfiguration implements java.io.Serializable
private Map<Locale,String> description;

@Lob
@JsonUnwrapped
@JsonProperty("options")
@Convert(converter = AuthenticationProviderOptions.AuthenticationProviderOptionsConverter.class)
private AuthenticationProviderOptions options;
Expand Down Expand Up @@ -97,6 +96,7 @@ public void parseTitle(JsonNode node) {
* @param locale The locale to lookup the title.
* @return An optional string, being empty if not found and no default.
*/
@JsonIgnore
public Optional<String> getTitle(Locale locale) {
return Optional.ofNullable(title.getOrDefault(locale, title.get(BundleUtil.getDefaultLocale())));
}
Expand All @@ -106,6 +106,7 @@ public Optional<String> getTitle(Locale locale) {
* @param locale The locale to lookup the title as string tag, following IETF BCP 47, e.g. 'en' or 'en-US'.
* @return An optional string, being empty if not found and no default.
*/
@JsonIgnore
public Optional<String> getTitle(String locale) {
Locale lookup = LocaleUtils.toLocale(locale);
return getTitle(lookup);
Expand All @@ -115,6 +116,7 @@ public Optional<String> getTitle(String locale) {
* Receive title string using system default locale
* @return An optional string, being empty if not found and no default.
*/
@JsonIgnore
public Optional<String> getTitle() {
return getTitle(BundleUtil.getDefaultLocale());
}
Expand Down

0 comments on commit 1413223

Please sign in to comment.