Deprecate Factory in favor of java.util.function.Supplier
This commit is contained in:
parent
c17637259b
commit
e5c3d7ec12
|
@ -27,6 +27,7 @@
|
||||||
<action issue="COLLECTIONS-852" type="update" dev="ggregory" due-to="Claude Warren, Alex Herbert">Add layerd bloom filter clean method #476.</action>
|
<action issue="COLLECTIONS-852" type="update" dev="ggregory" due-to="Claude Warren, Alex Herbert">Add layerd bloom filter clean method #476.</action>
|
||||||
<!-- FIX -->
|
<!-- FIX -->
|
||||||
<action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Closure in favor of java.util.function.Consumer.</action>
|
<action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Closure in favor of java.util.function.Consumer.</action>
|
||||||
|
<action type="update" dev="ggregory" due-to="Gary Gregory">Deprecate Factory in favor of java.util.function.Supplier.</action>
|
||||||
<!-- UPDATE -->
|
<!-- UPDATE -->
|
||||||
<action type="update" dev="ggregory" due-to="Dependabot">Bump org.apache.commons:commons-parent from 67 to 69 #473.</action>
|
<action type="update" dev="ggregory" due-to="Dependabot">Bump org.apache.commons:commons-parent from 67 to 69 #473.</action>
|
||||||
<action type="update" dev="ggregory" due-to="Dependabot">Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #475 .</action>
|
<action type="update" dev="ggregory" due-to="Dependabot">Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #475 .</action>
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.commons.collections4;
|
package org.apache.commons.collections4;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a functor interface implemented by classes that create objects.
|
* Defines a functor interface implemented by classes that create objects.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -31,9 +33,10 @@ package org.apache.commons.collections4;
|
||||||
* @param <T> the type that the factory creates
|
* @param <T> the type that the factory creates
|
||||||
*
|
*
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
|
* @deprecated Use {@link Supplier}.
|
||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@Deprecated
|
||||||
public interface Factory<T> {
|
public interface Factory<T> extends Supplier<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new object.
|
* Create a new object.
|
||||||
|
@ -43,4 +46,9 @@ public interface Factory<T> {
|
||||||
*/
|
*/
|
||||||
T create();
|
T create();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
default T get() {
|
||||||
|
return create();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue