public GoogleVideoExtension setAccessRestriction()

in src/main/java/org/apache/sling/sitemap/impl/builder/extensions/GoogleVideoExtensionProvider.java [269:284]


        public GoogleVideoExtension setAccessRestriction(@Nullable Access restriction, @Nullable Collection<String> countryCodes) {
            String accessRestrictionsCorrected = countryCodes != null
                    ? countryCodes.stream()
                    .map(countryCode -> countryCode.toUpperCase(Locale.ROOT))
                    .filter(countryCode -> countryCode.length() == 2)
                    .collect(Collectors.joining(" "))
                    : null;
            if (restriction != null && accessRestrictionsCorrected != null && accessRestrictionsCorrected.length() > 0) {
                this.accessRestrictions = accessRestrictionsCorrected;
                this.accessRestrictionsRel = restriction.getValue();
            } else {
                this.accessRestrictions = null;
                this.accessRestrictionsRel = null;
            }
            return this;
        }