Created
August 21, 2012 01:23
-
-
Save ck1125/3410292 to your computer and use it in GitHub Desktop.
Propertysources extension
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
package com.in3k8.javaconfig.config.propertysource | |
import org.springframework.core.env.PropertySources | |
import org.springframework.core.env.PropertySource | |
class ListPropertySources implements PropertySources { | |
List<PropertySource<?>> propertySources | |
ListPropertySources(List<PropertySource<?>> propertySources) { | |
this.propertySources = propertySources | |
} | |
@Override | |
boolean contains(String name) { | |
return propertySources.find { PropertySource source -> | |
return source.named(name) | |
} != null | |
} | |
@Override | |
PropertySource<?> get(String name) { | |
return propertySources.find { PropertySource source -> | |
return source.named(name) | |
} | |
} | |
@Override | |
Iterator<PropertySource<?>> iterator() { | |
return propertySources.iterator() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment