static Map<String, Comparable> prepareProperties(Map<String, Comparable> properties,
                                                     Collection<PropertyDefinition> propertyDefinitions) {
        Map<String, Comparable> mappedProperties = createHashMap(propertyDefinitions.size());

        for (PropertyDefinition propertyDefinition : propertyDefinitions) {
            String propertyKey = propertyDefinition.key();
            if (!properties.containsKey(propertyKey)) {
                if (!propertyDefinition.optional()) {
                    throw new InvalidConfigurationException(
                            String.format("Missing property '%s' on discovery strategy", propertyKey));
                }
                continue;
            }
            Comparable value = properties.get(propertyKey);

            TypeConverter typeConverter = propertyDefinition.typeConverter();
            Comparable mappedValue = typeConverter.convert(value);

            ValueValidator validator = propertyDefinition.validator();
            if (validator != null) {
                validator.validate(mappedValue);
            }

            mappedProperties.put(propertyKey, mappedValue);
        }

        verifyNoUnknownProperties(mappedProperties, properties);

        return mappedProperties;
    }
static Map < String , Comparable > prepareProperties ( Map < String , Comparable > properties , Collection < PropertyDefinition > propertyDefinitions ) { Map < String , Comparable > mappedProperties = createHashMap ( propertyDefinitions . size ( ) ) ; for ( PropertyDefinition propertyDefinition : propertyDefinitions ) { String propertyKey = propertyDefinition . key ( ) ; if ( ! properties . containsKey ( propertyKey ) ) { if ( ! propertyDefinition . optional ( ) ) { throw new InvalidConfigurationException ( String . format ( "Missing property '%s' on discovery strategy" , propertyKey ) ) ; } continue ; } Comparable value = properties . get ( propertyKey ) ; TypeConverter typeConverter = propertyDefinition . typeConverter ( ) ; Comparable mappedValue = typeConverter . convert ( value ) ; ValueValidator validator = propertyDefinition . validator ( ) ; if ( validator != null ) { validator . validate ( mappedValue ) ; } mappedProperties . put ( propertyKey , mappedValue ) ; } verifyNoUnknownProperties ( mappedProperties , properties ) ; return mappedProperties ; }
Validates, verifies, and maps {@code properties} with the given {@code propertyDefinitions}.

@param properties          properties from the Hazelcast node configuration (from the service-discovery section)
@param propertyDefinitions property definitions specific for the given
{@link com.hazelcast.spi.discovery.DiscoveryStrategy}
@return mapped properties
@throws InvalidConfigurationException if the the required properties are not satisfied or any property is not not
applicable to the given definitions
@throws ValidationException           if any property is invalid