@Test public void testPatch() { PatchClientRegistrationSettings patcher = new PatchClientRegistrationSettings(); patcher.setDynamicClientRegistrationEnabled(Optional.of(false)); patcher.setOpenDynamicClientRegistrationEnabled(Optional.empty()); ClientRegistrationSettings toPatch = ClientRegistrationSettings.defaultSettings(); toPatch.setDynamicClientRegistrationEnabled(true); toPatch.setOpenDynamicClientRegistrationEnabled(true); toPatch.setAllowLocalhostRedirectUri(true); ClientRegistrationSettings result = patcher.patch(toPatch); assertFalse("should be disabled by default", result.isDynamicClientRegistrationEnabled()); assertFalse("should be disabled by default", result.isOpenDynamicClientRegistrationEnabled()); assertTrue("should be disabled by default", result.isAllowLocalhostRedirectUri()); }
public ClientRegistrationSettings patch(ClientRegistrationSettings toPatch) { ClientRegistrationSettings result=toPatch!=null?toPatch: ClientRegistrationSettings.defaultSettings(); SetterUtils.safeSet(result::setAllowWildCardRedirectUri, this.getAllowWildCardRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowHttpSchemeRedirectUri, this.getAllowHttpSchemeRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowLocalhostRedirectUri, this.getAllowLocalhostRedirectUri(), boolean.class); SetterUtils.safeSet(result::setOpenDynamicClientRegistrationEnabled, this.isOpenDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDynamicClientRegistrationEnabled, this.isDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDefaultScopes, this.getDefaultScopes()); SetterUtils.safeSet(result::setAllowedScopesEnabled, this.isAllowedScopesEnabled(), boolean.class); SetterUtils.safeSet(result::setAllowedScopes, this.getAllowedScopes()); SetterUtils.safeSet(result::setClientTemplateEnabled, this.isClientTemplateEnabled(), boolean.class); return result; }
PatchClientRegistrationSettings { public ClientRegistrationSettings patch(ClientRegistrationSettings toPatch) { ClientRegistrationSettings result=toPatch!=null?toPatch: ClientRegistrationSettings.defaultSettings(); SetterUtils.safeSet(result::setAllowWildCardRedirectUri, this.getAllowWildCardRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowHttpSchemeRedirectUri, this.getAllowHttpSchemeRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowLocalhostRedirectUri, this.getAllowLocalhostRedirectUri(), boolean.class); SetterUtils.safeSet(result::setOpenDynamicClientRegistrationEnabled, this.isOpenDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDynamicClientRegistrationEnabled, this.isDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDefaultScopes, this.getDefaultScopes()); SetterUtils.safeSet(result::setAllowedScopesEnabled, this.isAllowedScopesEnabled(), boolean.class); SetterUtils.safeSet(result::setAllowedScopes, this.getAllowedScopes()); SetterUtils.safeSet(result::setClientTemplateEnabled, this.isClientTemplateEnabled(), boolean.class); return result; } }
PatchClientRegistrationSettings { public ClientRegistrationSettings patch(ClientRegistrationSettings toPatch) { ClientRegistrationSettings result=toPatch!=null?toPatch: ClientRegistrationSettings.defaultSettings(); SetterUtils.safeSet(result::setAllowWildCardRedirectUri, this.getAllowWildCardRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowHttpSchemeRedirectUri, this.getAllowHttpSchemeRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowLocalhostRedirectUri, this.getAllowLocalhostRedirectUri(), boolean.class); SetterUtils.safeSet(result::setOpenDynamicClientRegistrationEnabled, this.isOpenDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDynamicClientRegistrationEnabled, this.isDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDefaultScopes, this.getDefaultScopes()); SetterUtils.safeSet(result::setAllowedScopesEnabled, this.isAllowedScopesEnabled(), boolean.class); SetterUtils.safeSet(result::setAllowedScopes, this.getAllowedScopes()); SetterUtils.safeSet(result::setClientTemplateEnabled, this.isClientTemplateEnabled(), boolean.class); return result; } PatchClientRegistrationSettings(); }
PatchClientRegistrationSettings { public ClientRegistrationSettings patch(ClientRegistrationSettings toPatch) { ClientRegistrationSettings result=toPatch!=null?toPatch: ClientRegistrationSettings.defaultSettings(); SetterUtils.safeSet(result::setAllowWildCardRedirectUri, this.getAllowWildCardRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowHttpSchemeRedirectUri, this.getAllowHttpSchemeRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowLocalhostRedirectUri, this.getAllowLocalhostRedirectUri(), boolean.class); SetterUtils.safeSet(result::setOpenDynamicClientRegistrationEnabled, this.isOpenDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDynamicClientRegistrationEnabled, this.isDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDefaultScopes, this.getDefaultScopes()); SetterUtils.safeSet(result::setAllowedScopesEnabled, this.isAllowedScopesEnabled(), boolean.class); SetterUtils.safeSet(result::setAllowedScopes, this.getAllowedScopes()); SetterUtils.safeSet(result::setClientTemplateEnabled, this.isClientTemplateEnabled(), boolean.class); return result; } PatchClientRegistrationSettings(); Optional<Boolean> getAllowLocalhostRedirectUri(); void setAllowLocalhostRedirectUri(Optional<Boolean> allowLocalhostRedirectUri); Optional<Boolean> getAllowHttpSchemeRedirectUri(); void setAllowHttpSchemeRedirectUri(Optional<Boolean> allowHttpSchemeRedirectUri); Optional<Boolean> getAllowWildCardRedirectUri(); void setAllowWildCardRedirectUri(Optional<Boolean> allowWildCardRedirectUri); Optional<Boolean> isDynamicClientRegistrationEnabled(); void setDynamicClientRegistrationEnabled(Optional<Boolean> isDynamicClientRegistrationEnabled); Optional<Boolean> isOpenDynamicClientRegistrationEnabled(); void setOpenDynamicClientRegistrationEnabled(Optional<Boolean> isOpenDynamicClientRegistrationEnabled); Optional<List<String>> getDefaultScopes(); void setDefaultScopes(Optional<List<String>> defaultScopes); Optional<Boolean> isAllowedScopesEnabled(); void setIsAllowedScopesEnabled(Optional<Boolean> isAllowedScopesEnabled); Optional<List<String>> getAllowedScopes(); void setAllowedScopes(Optional<List<String>> allowedScopes); Optional<Boolean> isClientTemplateEnabled(); void setClientTemplateEnabled(Optional<Boolean> clientTemplateEnabled); ClientRegistrationSettings patch(ClientRegistrationSettings toPatch); }
PatchClientRegistrationSettings { public ClientRegistrationSettings patch(ClientRegistrationSettings toPatch) { ClientRegistrationSettings result=toPatch!=null?toPatch: ClientRegistrationSettings.defaultSettings(); SetterUtils.safeSet(result::setAllowWildCardRedirectUri, this.getAllowWildCardRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowHttpSchemeRedirectUri, this.getAllowHttpSchemeRedirectUri(), boolean.class); SetterUtils.safeSet(result::setAllowLocalhostRedirectUri, this.getAllowLocalhostRedirectUri(), boolean.class); SetterUtils.safeSet(result::setOpenDynamicClientRegistrationEnabled, this.isOpenDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDynamicClientRegistrationEnabled, this.isDynamicClientRegistrationEnabled(), boolean.class); SetterUtils.safeSet(result::setDefaultScopes, this.getDefaultScopes()); SetterUtils.safeSet(result::setAllowedScopesEnabled, this.isAllowedScopesEnabled(), boolean.class); SetterUtils.safeSet(result::setAllowedScopes, this.getAllowedScopes()); SetterUtils.safeSet(result::setClientTemplateEnabled, this.isClientTemplateEnabled(), boolean.class); return result; } PatchClientRegistrationSettings(); Optional<Boolean> getAllowLocalhostRedirectUri(); void setAllowLocalhostRedirectUri(Optional<Boolean> allowLocalhostRedirectUri); Optional<Boolean> getAllowHttpSchemeRedirectUri(); void setAllowHttpSchemeRedirectUri(Optional<Boolean> allowHttpSchemeRedirectUri); Optional<Boolean> getAllowWildCardRedirectUri(); void setAllowWildCardRedirectUri(Optional<Boolean> allowWildCardRedirectUri); Optional<Boolean> isDynamicClientRegistrationEnabled(); void setDynamicClientRegistrationEnabled(Optional<Boolean> isDynamicClientRegistrationEnabled); Optional<Boolean> isOpenDynamicClientRegistrationEnabled(); void setOpenDynamicClientRegistrationEnabled(Optional<Boolean> isOpenDynamicClientRegistrationEnabled); Optional<List<String>> getDefaultScopes(); void setDefaultScopes(Optional<List<String>> defaultScopes); Optional<Boolean> isAllowedScopesEnabled(); void setIsAllowedScopesEnabled(Optional<Boolean> isAllowedScopesEnabled); Optional<List<String>> getAllowedScopes(); void setAllowedScopes(Optional<List<String>> allowedScopes); Optional<Boolean> isClientTemplateEnabled(); void setClientTemplateEnabled(Optional<Boolean> clientTemplateEnabled); ClientRegistrationSettings patch(ClientRegistrationSettings toPatch);  }