3232import java .util .stream .Stream ;
3333
3434import org .mycore .common .MCRClassTools ;
35+ import org .mycore .common .config .MCRInstanceConfiguration .Option ;
36+ import org .mycore .common .config .MCRInstanceConfiguration .Options ;
3537import org .mycore .common .function .MCRTriConsumer ;
3638
3739/**
@@ -131,11 +133,11 @@ public static Map<String, String> getSubPropertiesMap(String propertyPrefix) {
131133 * @throws MCRConfigurationException if the class can not be loaded or instantiated
132134 */
133135 public static <S > Optional <S > getInstanceOf (Class <S > superClass , String name ) throws MCRConfigurationException {
134- return getInstanceOf (superClass , name , MCRConfigurableInstanceHelper . NO_OPTIONS );
136+ return getInstanceOf (superClass , name , Options . NONE );
135137 }
136138
137139 private static <S > Optional <S > getInstanceOf (Class <S > superClass , String name ,
138- Set <MCRConfigurableInstanceHelper . Option > options ) {
140+ Set <Option > options ) {
139141 if (MCRConfigurableInstanceHelper .isSingleton (superClass )) {
140142 return getSingleInstanceOf (superClass , name , options );
141143 } else {
@@ -153,7 +155,7 @@ private static <S> Optional<S> getInstanceOf(Class<S> superClass, String name,
153155 * or the configuration property is not set
154156 */
155157 public static <S > S getInstanceOfOrThrow (Class <S > superClass , String name ) throws MCRConfigurationException {
156- return getInstanceOf (superClass , name , MCRConfigurableInstanceHelper . ADD_IMPLICIT_CLASS_PROPERTIES )
158+ return getInstanceOf (superClass , name , Options . IMPLICIT )
157159 .orElseThrow (() -> createConfigurationException (name ));
158160 }
159161
@@ -167,11 +169,11 @@ public static <S> S getInstanceOfOrThrow(Class<S> superClass, String name) throw
167169 * @throws MCRConfigurationException if the class can not be loaded or instantiated
168170 */
169171 public static <S > Optional <S > getSingleInstanceOf (Class <S > superClass , String name ) {
170- return getSingleInstanceOf (superClass , name , MCRConfigurableInstanceHelper . NO_OPTIONS );
172+ return getSingleInstanceOf (superClass , name , Options . NONE );
171173 }
172174
173175 private static <S > Optional <S > getSingleInstanceOf (Class <S > superClass , String name ,
174- Set <MCRConfigurableInstanceHelper . Option > options ) {
176+ Set <Option > options ) {
175177 return getString (name )
176178 .map (className -> new ConfigSingletonKey (name , className ))
177179 .map (key -> (S ) instanceHolder .computeIfAbsent (key ,
@@ -189,7 +191,7 @@ private static <S> Optional<S> getSingleInstanceOf(Class<S> superClass, String n
189191 * or the configuration property is not set
190192 */
191193 public static <S > S getSingleInstanceOfOrThrow (Class <S > superClass , String name ) {
192- return getSingleInstanceOf (superClass , name , MCRConfigurableInstanceHelper . ADD_IMPLICIT_CLASS_PROPERTIES )
194+ return getSingleInstanceOf (superClass , name , Options . IMPLICIT )
193195 .orElseThrow (() -> createConfigurationException (name ));
194196 }
195197
0 commit comments