polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [04/24] zest-java git commit: ZEST-112, Replaced org.apache.zest.functional.Function and org.apache.zest.functional.Function2 with java.util.functional.Function and java.util.functional.BiFunction
Date Wed, 26 Aug 2015 15:45:07 GMT
ZEST-112, Replaced org.apache.zest.functional.Function and org.apache.zest.functional.Function2 with java.util.functional.Function and java.util.functional.BiFunction


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/5989a71e
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/5989a71e
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/5989a71e

Branch: refs/heads/develop
Commit: 5989a71e3bed031bc9c969e9da6db05d01495dcd
Parents: f5bf22d
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Sat Aug 22 15:03:23 2015 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Sat Aug 22 15:03:24 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/zest/api/ZestAPI.java  |  6 +-
 .../org/apache/zest/api/common/MetaInfo.java    |  2 +-
 .../org/apache/zest/api/common/TypeName.java    |  2 +-
 .../zest/api/composite/CompositeContext.java    |  2 +-
 .../zest/api/composite/PropertyMapper.java      |  4 +-
 .../ConstraintViolationException.java           |  7 ++-
 .../org/apache/zest/api/dataset/DataSet.java    |  2 +-
 .../api/dataset/iterable/IterableDataSet.java   |  2 +-
 .../zest/api/query/NotQueryableException.java   |  2 +-
 .../api/query/grammar/AssociationFunction.java  | 12 ++--
 .../AssociationNotNullSpecification.java        |  2 +-
 .../grammar/AssociationNullSpecification.java   |  2 +-
 .../query/grammar/ComparisonSpecification.java  |  2 +-
 .../query/grammar/ContainsAllSpecification.java |  2 +-
 .../query/grammar/ContainsSpecification.java    |  2 +-
 .../ManyAssociationContainsSpecification.java   |  2 +-
 .../query/grammar/ManyAssociationFunction.java  |  6 +-
 .../api/query/grammar/MatchesSpecification.java |  2 +-
 ...medAssociationContainsNameSpecification.java |  2 +-
 .../NamedAssociationContainsSpecification.java  |  2 +-
 .../query/grammar/NamedAssociationFunction.java |  6 +-
 .../api/query/grammar/PropertyFunction.java     | 10 +--
 .../grammar/PropertyNotNullSpecification.java   |  2 +-
 .../grammar/PropertyNullSpecification.java      |  2 +-
 .../api/query/grammar/PropertyReference.java    |  2 +-
 .../api/service/importer/InstanceImporter.java  |  4 +-
 .../apache/zest/api/type/CollectionType.java    |  2 +-
 .../java/org/apache/zest/api/type/MapType.java  |  2 +-
 .../zest/api/type/ValueCompositeType.java       |  2 +-
 .../org/apache/zest/api/type/ValueType.java     |  4 +-
 .../unitofwork/EntityTypeNotFoundException.java |  5 +-
 .../api/unitofwork/NoSuchEntityException.java   |  6 +-
 .../apache/zest/api/unitofwork/UnitOfWork.java  |  2 +-
 .../org/apache/zest/api/util/Annotations.java   | 10 +--
 .../java/org/apache/zest/api/util/Classes.java  | 60 +++++++++---------
 .../org/apache/zest/api/util/Constructors.java  |  4 +-
 .../java/org/apache/zest/api/util/Fields.java   | 12 ++--
 .../java/org/apache/zest/api/util/Methods.java  |  8 +--
 .../zest/api/value/ValueBuilderFactory.java     |  2 +-
 .../zest/api/value/ValueDeserializer.java       |  6 +-
 .../apache/zest/api/value/ValueSerializer.java  |  2 +-
 .../org/apache/zest/api/util/ClassesTest.java   |  2 +-
 .../zest/api/value/DocumentationSupport.java    |  4 +-
 .../org/apache/zest/bootstrap/ClassScanner.java |  8 +--
 .../org/apache/zest/functional/ForEach.java     |  1 +
 .../org/apache/zest/functional/Function.java    | 35 -----------
 .../org/apache/zest/functional/Function2.java   | 33 ----------
 .../org/apache/zest/functional/Functions.java   | 36 +++++------
 .../org/apache/zest/functional/Iterables.java   | 17 +++---
 .../apache/zest/functional/Specifications.java  |  4 +-
 .../apache/zest/functional/FunctionsTest.java   | 13 ++--
 .../apache/zest/functional/IterablesTest.java   |  9 +--
 .../zest/functional/SpecificationsTest.java     |  3 +-
 .../java/org/apache/zest/io/Transforms.java     | 22 +++----
 .../org/apache/zest/io/InputOutputTest.java     |  6 +-
 .../AbstractAssociationInstance.java            |  8 +--
 .../association/AssociationInstance.java        |  4 +-
 .../association/ManyAssociationInstance.java    |  4 +-
 .../association/ManyAssociationModel.java       |  8 +--
 .../association/NamedAssociationInstance.java   | 10 +--
 .../association/NamedAssociationModel.java      |  8 +--
 .../bootstrap/CompositeAssemblyImpl.java        | 14 ++---
 .../runtime/bootstrap/EntityAssemblyImpl.java   |  2 +-
 .../runtime/bootstrap/ServiceAssemblyImpl.java  |  4 +-
 .../runtime/bootstrap/ValueAssemblyImpl.java    |  2 +-
 .../composite/ConstraintDeclaration.java        |  6 +-
 .../runtime/composite/ConstructorsModel.java    |  4 +-
 .../composite/FunctionStateResolver.java        | 10 +--
 .../zest/runtime/composite/MixinsModel.java     |  8 +--
 .../runtime/composite/TransientInstance.java    |  2 +-
 .../runtime/entity/EntityStateInstance.java     | 20 +++---
 .../zest/runtime/injection/Dependencies.java    |  4 +-
 .../zest/runtime/injection/DependencyModel.java |  4 +-
 .../runtime/injection/InjectedFieldsModel.java  |  6 +-
 .../runtime/injection/InjectedMethodsModel.java |  2 +-
 .../InvocationInjectionProviderFactory.java     |  4 +-
 .../ModifiesInjectionProviderFactory.java       |  2 +-
 .../ServiceInjectionProviderFactory.java        |  6 +-
 .../zest/runtime/query/IterableQuerySource.java |  4 +-
 .../zest/runtime/service/ServiceModel.java      |  2 +-
 .../zest/runtime/structure/LayerInstance.java   | 12 ++--
 .../zest/runtime/structure/ModuleInstance.java  | 12 ++--
 .../runtime/structure/ModuleUnitOfWork.java     | 18 +++---
 .../zest/runtime/structure/TypeLookup.java      |  8 +--
 .../runtime/structure/UsedLayersInstance.java   | 12 ++--
 .../zest/runtime/types/ValueTypeFactory.java    | 14 ++---
 .../value/ValueBuilderWithPrototype.java        | 10 +--
 .../runtime/composite/FunctionalListTest.java   |  6 +-
 .../entity/EntityBuilderWithStateTest.java      | 10 +--
 .../zest/spi/entity/QualifiedIdentity.java      |  2 +-
 .../org/apache/zest/spi/module/ModelModule.java |  8 +--
 .../spi/value/ValueDeserializerAdapter.java     | 64 ++++++++++----------
 .../zest/spi/value/ValueSerializerAdapter.java  | 56 ++++++++---------
 .../orgjson/OrgJsonValueDeserializer.java       | 18 +++---
 .../orgjson/OrgJsonValueSerialization.java      | 15 ++---
 .../helpers/JSONManyAssociationStateTest.java   |  4 +-
 .../elasticsearch/ElasticSearchFinder.java      |  4 +-
 .../support/skeletons/AbstractSQLIndexing.java  |  2 +-
 .../support/skeletons/AbstractSQLQuerying.java  | 11 ++--
 .../support/skeletons/AbstractSQLStartup.java   |  6 +-
 .../skeletons/SQLCompatEntityStateWrapper.java  |  4 +-
 .../jackson/JacksonValueDeserializer.java       | 18 +++---
 .../JacksonValueSerializationAssembler.java     |  2 +-
 .../OrgJsonValueSerializationAssembler.java     |  2 +-
 .../stax/StaxValueDeserializer.java             | 12 ++--
 .../stax/StaxValueSerializationAssembler.java   |  2 +-
 .../conversion/values/EntityToValue.java        | 24 ++++----
 .../conversion/values/ValueToEntity.java        |  2 +-
 .../conversion/values/ValueToEntityMixin.java   | 53 ++++++++--------
 .../conversion/values/EntityToValueTest.java    |  4 +-
 .../source/jdbm/JdbmEventStoreService.java      |  4 +-
 .../source/jdbm/JdbmEventStoreServiceTest.java  |  4 +-
 .../source/helper/ApplicationEvents.java        |  6 +-
 .../factory/DomainEventFactoryService.java      |  2 +-
 .../domain/source/helper/Events.java            |  8 +--
 .../eventsourcing/domain/DomainEventTest.java   |  4 +-
 .../source/helper/DomainEventTrackerTest.java   |  4 +-
 .../jmx/ConfigurationManagerService.java        |  4 +-
 .../zest/library/scala/ScalaTraitMixin.java     |  6 +-
 .../debug/service/DebugOnConsoleSideEffect.java |  2 +-
 .../debug/service/DebuggingServiceMixin.java    |  2 +-
 .../library/logging/log/SimpleLogConcern.java   |  2 +-
 .../log/service/LogOnConsoleSideEffect.java     |  2 +-
 .../log/service/LoggingServiceMixin.java        |  2 +-
 .../trace/service/TraceServiceMixin.java        |  2 +-
 .../zest/library/logging/DebuggingTest.java     |  4 +-
 .../rdf/entity/EntityStateSerializer.java       |  2 +-
 .../rdf/entity/EntityTypeSerializer.java        |  2 +-
 .../zest/library/rdf/model/Model2XML.java       |  4 +-
 .../apache/zest/library/rdf/Model2XMLTest.java  |  2 +-
 .../rest/client/api/ContextResourceClient.java  |  8 +--
 .../library/rest/client/api/HandlerCommand.java |  4 +-
 .../library/rest/common/link/LinksUtil.java     |  4 +-
 .../library/rest/common/table/TableBuilder.java |  6 +-
 .../rest/common/table/TableBuilderFactory.java  |  2 +-
 .../library/rest/common/table/TableQuery.java   |  2 +-
 .../freemarker/ValueCompositeTemplateModel.java | 12 ++--
 .../requestreader/DefaultRequestReader.java     | 10 +--
 libraries/restlet/build.gradle                  |  2 +
 .../restlet/assembly/domain/DomainLayer.java    |  2 +-
 .../infrastructue/InfrastructureLayer.java      |  2 +-
 .../infrastructue/SerializationModule.java      |  2 +-
 .../serialization/FormRepresentation.java       |  4 +-
 .../sql/liquibase/LiquibaseServiceTest.java     |  4 +-
 .../sample_a/bootstrap/assembly/Assembler.java  |  4 +-
 .../conversion/EntityToDTOService.java          | 18 +++---
 .../sample_a/bootstrap/test/TestAssembler.java  |  4 +-
 .../sample_b/bootstrap/assembly/Assembler.java  | 11 +---
 .../conversion/EntityToDTOService.java          | 18 +++---
 .../sample_b/bootstrap/test/TestAssembler.java  | 11 +---
 .../sample/forum/assembler/ForumAssembler.java  | 11 +---
 .../zest/sample/forum/context/Context.java      |  2 +-
 .../sample/forum/context/EventsService.java     |  4 +-
 .../sample/forum/domainevent/DomainEvent.java   |  4 +-
 .../org/apache/zest/sample/rental/web/Page.java |  2 +-
 .../zest/sample/rental/web/QuikitServlet.java   |  2 +-
 .../rental/web/assembly/StorageModule.java      | 11 +---
 157 files changed, 560 insertions(+), 648 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/ZestAPI.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/ZestAPI.java b/core/api/src/main/java/org/apache/zest/api/ZestAPI.java
index 6c20e94..6a1422e 100644
--- a/core/api/src/main/java/org/apache/zest/api/ZestAPI.java
+++ b/core/api/src/main/java/org/apache/zest/api/ZestAPI.java
@@ -16,6 +16,7 @@ package org.apache.zest.api;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
+import java.util.function.Function;
 import org.apache.zest.api.association.AbstractAssociation;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.composite.Composite;
@@ -30,7 +31,6 @@ import org.apache.zest.api.property.PropertyDescriptor;
 import org.apache.zest.api.service.ServiceDescriptor;
 import org.apache.zest.api.structure.Module;
 import org.apache.zest.api.value.ValueDescriptor;
-import org.apache.zest.functional.Function;
 
 /**
  * Encapsulation of the Zest API.
@@ -139,7 +139,7 @@ public interface ZestAPI
     Function<Composite, CompositeDescriptor> FUNCTION_DESCRIPTOR_FOR = new Function<Composite, CompositeDescriptor>()
     {
         @Override
-        public CompositeDescriptor map( Composite composite )
+        public CompositeDescriptor apply( Composite composite )
         {
             if( composite instanceof Proxy )
             {
@@ -168,7 +168,7 @@ public interface ZestAPI
     Function<Composite, CompositeInstance> FUNCTION_COMPOSITE_INSTANCE_OF = new Function<Composite, CompositeInstance>()
     {
         @Override
-        public CompositeInstance map( Composite composite )
+        public CompositeInstance apply( Composite composite )
         {
             if( composite instanceof Proxy )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/common/MetaInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/common/MetaInfo.java b/core/api/src/main/java/org/apache/zest/api/common/MetaInfo.java
index 6856c61..ac58192 100644
--- a/core/api/src/main/java/org/apache/zest/api/common/MetaInfo.java
+++ b/core/api/src/main/java/org/apache/zest/api/common/MetaInfo.java
@@ -110,7 +110,7 @@ public final class MetaInfo
             Iterable<Type> types = typesOf( metaInfoclass );
             for( Type type : types )
             {
-                metaInfoMap.put( Classes.RAW_CLASS.map( type ), metaInfo );
+                metaInfoMap.put( Classes.RAW_CLASS.apply( type ), metaInfo );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/common/TypeName.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/common/TypeName.java b/core/api/src/main/java/org/apache/zest/api/common/TypeName.java
index 78f03af..15e95b9 100644
--- a/core/api/src/main/java/org/apache/zest/api/common/TypeName.java
+++ b/core/api/src/main/java/org/apache/zest/api/common/TypeName.java
@@ -39,7 +39,7 @@ public final class TypeName
 
     public static TypeName nameOf( Type type )
     {
-        return nameOf( Classes.RAW_CLASS.map( type ) );
+        return nameOf( Classes.RAW_CLASS.apply( type ) );
     }
 
     public static TypeName nameOf( String typeName )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/composite/CompositeContext.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/composite/CompositeContext.java b/core/api/src/main/java/org/apache/zest/api/composite/CompositeContext.java
index 2e1aa59..db1421d 100644
--- a/core/api/src/main/java/org/apache/zest/api/composite/CompositeContext.java
+++ b/core/api/src/main/java/org/apache/zest/api/composite/CompositeContext.java
@@ -52,7 +52,7 @@ public class CompositeContext<T extends TransientComposite>
     {
         TransientComposite composite = get();
 
-        Iterable<Class<?>> types = ZestAPI.FUNCTION_COMPOSITE_INSTANCE_OF.map( composite ).types();
+        Iterable<Class<?>> types = ZestAPI.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite ).types();
         return (T) Proxy.newProxyInstance(
             composite.getClass().getClassLoader(),
             toArray( Class.class, Iterables.<Class>cast( types ) ),

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/composite/PropertyMapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/composite/PropertyMapper.java b/core/api/src/main/java/org/apache/zest/api/composite/PropertyMapper.java
index 16363c5..5303094 100644
--- a/core/api/src/main/java/org/apache/zest/api/composite/PropertyMapper.java
+++ b/core/api/src/main/java/org/apache/zest/api/composite/PropertyMapper.java
@@ -131,7 +131,7 @@ public final class PropertyMapper
             {
                 strategy = STRATEGY.get( Array.class );
             }
-            else if( Enum.class.isAssignableFrom( Classes.RAW_CLASS.map( propertyType ) ) )
+            else if( Enum.class.isAssignableFrom( Classes.RAW_CLASS.apply( propertyType ) ) )
             {
                 strategy = STRATEGY.get( Enum.class );
             }
@@ -462,7 +462,7 @@ public final class PropertyMapper
         @SuppressWarnings( "unchecked" )
         public Object map( Composite composite, Type type, String value )
         {
-            return ZestAPI.FUNCTION_COMPOSITE_INSTANCE_OF.map( composite ).module().newValueFromSerializedState( (Class<Object>) type, value );
+            return ZestAPI.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite ).module().newValueFromSerializedState( (Class<Object>) type, value );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/constraint/ConstraintViolationException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/constraint/ConstraintViolationException.java b/core/api/src/main/java/org/apache/zest/api/constraint/ConstraintViolationException.java
index f3bd0da..e04bfb9 100644
--- a/core/api/src/main/java/org/apache/zest/api/constraint/ConstraintViolationException.java
+++ b/core/api/src/main/java/org/apache/zest/api/constraint/ConstraintViolationException.java
@@ -25,9 +25,10 @@ import java.util.Collection;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
+import java.util.function.Function;
+import java.util.stream.StreamSupport;
 import org.apache.zest.api.ZestAPI;
 import org.apache.zest.api.composite.Composite;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 
 /**
@@ -54,7 +55,7 @@ public class ConstraintViolationException
                                          Collection<ConstraintViolation> constraintViolations
     )
     {
-        this( instance.toString(), ZestAPI.FUNCTION_DESCRIPTOR_FOR.map( instance ).types(), method, constraintViolations );
+        this( instance.toString(), ZestAPI.FUNCTION_DESCRIPTOR_FOR.apply( instance ).types(), method, constraintViolations );
     }
 
     public ConstraintViolationException( String instanceToString,
@@ -192,7 +193,7 @@ public class ConstraintViolationException
                 classes = "[" + Iterables.<Class<?>>toString( instanceTypes, new Function<Class<?>, String>()
                 {
                     @Override
-                    public String map( Class<?> from )
+                    public String apply( Class<?> from )
                     {
                         return from.getSimpleName();
                     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/dataset/DataSet.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/dataset/DataSet.java b/core/api/src/main/java/org/apache/zest/api/dataset/DataSet.java
index f52a563..532c4c2 100644
--- a/core/api/src/main/java/org/apache/zest/api/dataset/DataSet.java
+++ b/core/api/src/main/java/org/apache/zest/api/dataset/DataSet.java
@@ -18,7 +18,7 @@
  */
 package org.apache.zest.api.dataset;
 
-import org.apache.zest.functional.Function;
+import java.util.function.Function;
 import org.apache.zest.functional.Specification;
 
 /**

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/dataset/iterable/IterableDataSet.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/dataset/iterable/IterableDataSet.java b/core/api/src/main/java/org/apache/zest/api/dataset/iterable/IterableDataSet.java
index e0d8614..1f88034 100644
--- a/core/api/src/main/java/org/apache/zest/api/dataset/iterable/IterableDataSet.java
+++ b/core/api/src/main/java/org/apache/zest/api/dataset/iterable/IterableDataSet.java
@@ -18,9 +18,9 @@
  */
 package org.apache.zest.api.dataset.iterable;
 
+import java.util.function.Function;
 import org.apache.zest.api.dataset.DataSet;
 import org.apache.zest.api.dataset.Query;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/NotQueryableException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/NotQueryableException.java b/core/api/src/main/java/org/apache/zest/api/query/NotQueryableException.java
index 403ba4c..d9208fe 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/NotQueryableException.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/NotQueryableException.java
@@ -57,7 +57,7 @@ public class NotQueryableException
             throw new NotQueryableException(
                 String.format(
                     "%1$s \"%2$s\" (%3$s) is not queryable as has been marked with @Queryable(false)",
-                    Classes.RAW_CLASS.map( GenericPropertyInfo.propertyTypeOf( accessor ) ).getSimpleName(),
+                    Classes.RAW_CLASS.apply( GenericPropertyInfo.propertyTypeOf( accessor ) ).getSimpleName(),
                     ( (Member) accessor ).getName(),
                     ( (Member) accessor ).getDeclaringClass().getName()
                 )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationFunction.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationFunction.java
index 8355114..4c02e3d 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationFunction.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationFunction.java
@@ -22,6 +22,7 @@ import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Member;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.util.function.Function;
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.association.AssociationStateHolder;
 import org.apache.zest.api.association.GenericAssociationInfo;
@@ -31,7 +32,6 @@ import org.apache.zest.api.composite.Composite;
 import org.apache.zest.api.composite.CompositeInstance;
 import org.apache.zest.api.query.QueryExpressionException;
 import org.apache.zest.api.util.Classes;
-import org.apache.zest.functional.Function;
 
 import static org.apache.zest.api.util.Classes.typeOf;
 
@@ -58,9 +58,9 @@ public class AssociationFunction<T>
         this.accessor = accessor;
 
         Type returnType = typeOf( accessor );
-        if( !Association.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) )
-            && !ManyAssociation.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) )
-            && !NamedAssociation.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) ) )
+        if( !Association.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) )
+            && !ManyAssociation.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) )
+            && !NamedAssociation.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) ) )
         {
             throw new QueryExpressionException( "Unsupported association type:" + returnType );
         }
@@ -92,14 +92,14 @@ public class AssociationFunction<T>
     }
 
     @Override
-    public Association<T> map( Composite entity )
+    public Association<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedAssociation != null )
             {
-                Association<?> association = traversedAssociation.map( entity );
+                Association<?> association = traversedAssociation.apply( entity );
                 if( association == null )
                 {
                     return null;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNotNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNotNullSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNotNullSpecification.java
index 1376029..30774f8 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNotNullSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNotNullSpecification.java
@@ -44,7 +44,7 @@ public class AssociationNotNullSpecification<T>
     {
         try
         {
-            Association<T> assoc = association.map( item );
+            Association<T> assoc = association.apply( item );
 
             if( assoc == null )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNullSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNullSpecification.java
index 7dd72b2..64f0171 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNullSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/AssociationNullSpecification.java
@@ -44,7 +44,7 @@ public class AssociationNullSpecification<T>
     {
         try
         {
-            Association<T> assoc = association.map( item );
+            Association<T> assoc = association.apply( item );
 
             if( assoc == null )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/ComparisonSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/ComparisonSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/ComparisonSpecification.java
index c53fe00..5cb6043 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/ComparisonSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/ComparisonSpecification.java
@@ -46,7 +46,7 @@ public abstract class ComparisonSpecification<T>
     {
         try
         {
-            Property<T> prop = property.map( item );
+            Property<T> prop = property.apply( item );
 
             if( prop == null )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsAllSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsAllSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsAllSpecification.java
index c5221d2..89902e6 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsAllSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsAllSpecification.java
@@ -52,7 +52,7 @@ public class ContainsAllSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        Collection<T> collection = collectionProperty.map( item ).get();
+        Collection<T> collection = collectionProperty.apply( item ).get();
 
         if( collection == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsSpecification.java
index 4f05aac..d1ecd88 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/ContainsSpecification.java
@@ -49,7 +49,7 @@ public class ContainsSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        Collection<T> collection = collectionProperty.map( item ).get();
+        Collection<T> collection = collectionProperty.apply( item ).get();
 
         if( collection == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationContainsSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationContainsSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationContainsSpecification.java
index a15bdb0..1814b26 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationContainsSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationContainsSpecification.java
@@ -49,7 +49,7 @@ public class ManyAssociationContainsSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        ManyAssociation<T> collection = manyAssociationFunction.map( item );
+        ManyAssociation<T> collection = manyAssociationFunction.apply( item );
         if( collection == null )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationFunction.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationFunction.java
index 540a901..11fa96a 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationFunction.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/ManyAssociationFunction.java
@@ -21,11 +21,11 @@ package org.apache.zest.api.query.grammar;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Member;
 import java.lang.reflect.Proxy;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationStateHolder;
 import org.apache.zest.api.association.ManyAssociation;
 import org.apache.zest.api.composite.Composite;
 import org.apache.zest.api.composite.CompositeInstance;
-import org.apache.zest.functional.Function;
 
 /**
  * Function to get Entity ManyAssociations.
@@ -71,14 +71,14 @@ public class ManyAssociationFunction<T>
     }
 
     @Override
-    public ManyAssociation<T> map( Composite entity )
+    public ManyAssociation<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedAssociation != null )
             {
-                target = traversedAssociation.map( entity ).get();
+                target = traversedAssociation.apply( entity ).get();
             }
             if( traversedManyAssociation != null )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/MatchesSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/MatchesSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/MatchesSpecification.java
index 4f54a47..c18c3c0 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/MatchesSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/MatchesSpecification.java
@@ -60,7 +60,7 @@ public class MatchesSpecification
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        Property<String> prop = property.map( item );
+        Property<String> prop = property.apply( item );
 
         if( prop == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsNameSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsNameSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsNameSpecification.java
index 5af9a51..fdcde0b 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsNameSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsNameSpecification.java
@@ -49,7 +49,7 @@ public class NamedAssociationContainsNameSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        NamedAssociation<T> collection = namedAssociationFunction.map( item );
+        NamedAssociation<T> collection = namedAssociationFunction.apply( item );
         if( collection == null )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsSpecification.java
index e4e4f7b..9838951 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationContainsSpecification.java
@@ -49,7 +49,7 @@ public class NamedAssociationContainsSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        NamedAssociation<T> collection = namedAssociationFunction.map( item );
+        NamedAssociation<T> collection = namedAssociationFunction.apply( item );
         if( collection == null )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationFunction.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationFunction.java
index d60468e..69b435c 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationFunction.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/NamedAssociationFunction.java
@@ -21,11 +21,11 @@ package org.apache.zest.api.query.grammar;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Member;
 import java.lang.reflect.Proxy;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationStateHolder;
 import org.apache.zest.api.association.NamedAssociation;
 import org.apache.zest.api.composite.Composite;
 import org.apache.zest.api.composite.CompositeInstance;
-import org.apache.zest.functional.Function;
 
 /**
  * Function to get Entity NamedAssociations.
@@ -71,14 +71,14 @@ public class NamedAssociationFunction<T>
     }
 
     @Override
-    public NamedAssociation<T> map( Composite entity )
+    public NamedAssociation<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedAssociation != null )
             {
-                target = traversedAssociation.map( entity ).get();
+                target = traversedAssociation.apply( entity ).get();
             }
             if( traversedManyAssociation != null )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyFunction.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyFunction.java
index 7b6db53..57249d5 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyFunction.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyFunction.java
@@ -23,6 +23,7 @@ import java.lang.reflect.Member;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.util.function.Function;
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.composite.Composite;
 import org.apache.zest.api.composite.CompositeInstance;
@@ -31,7 +32,6 @@ import org.apache.zest.api.property.Property;
 import org.apache.zest.api.query.NotQueryableException;
 import org.apache.zest.api.query.QueryExpressionException;
 import org.apache.zest.api.util.Classes;
-import org.apache.zest.functional.Function;
 
 import static org.apache.zest.api.util.Classes.typeOf;
 
@@ -65,7 +65,7 @@ public class PropertyFunction<T>
         // Verify that the property type itself (value composites) is not marked as non queryable
 
         Type returnType = typeOf( accessor );
-        if( !Property.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) ) )
+        if( !Property.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) ) )
         {
             throw new QueryExpressionException( "Not a property type:" + returnType );
         }
@@ -110,14 +110,14 @@ public class PropertyFunction<T>
     }
 
     @Override
-    public Property<T> map( Composite entity )
+    public Property<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedProperty != null )
             {
-                Property<?> property = traversedProperty.map( entity );
+                Property<?> property = traversedProperty.apply( entity );
                 if( property == null )
                 {
                     return null;
@@ -126,7 +126,7 @@ public class PropertyFunction<T>
             }
             else if( traversedAssociation != null )
             {
-                Association<?> association = traversedAssociation.map( entity );
+                Association<?> association = traversedAssociation.apply( entity );
                 if( association == null )
                 {
                     return null;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNotNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNotNullSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNotNullSpecification.java
index c140542..3519d87 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNotNullSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNotNullSpecification.java
@@ -42,7 +42,7 @@ public class PropertyNotNullSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        Property<T> prop = property.map( item );
+        Property<T> prop = property.apply( item );
 
         if( prop == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNullSpecification.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNullSpecification.java
index b0acfa7..7b62f13 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNullSpecification.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyNullSpecification.java
@@ -42,7 +42,7 @@ public class PropertyNullSpecification<T>
     @Override
     public boolean satisfiedBy( Composite item )
     {
-        Property<T> prop = property.map( item );
+        Property<T> prop = property.apply( item );
 
         if( prop == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyReference.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyReference.java b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyReference.java
index 4b30a56..88b70af 100644
--- a/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyReference.java
+++ b/core/api/src/main/java/org/apache/zest/api/query/grammar/PropertyReference.java
@@ -18,9 +18,9 @@
  */
 package org.apache.zest.api.query.grammar;
 
+import java.util.function.Function;
 import org.apache.zest.api.composite.Composite;
 import org.apache.zest.api.property.Property;
-import org.apache.zest.functional.Function;
 
 /**
  * Property Reference.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/service/importer/InstanceImporter.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/service/importer/InstanceImporter.java b/core/api/src/main/java/org/apache/zest/api/service/importer/InstanceImporter.java
index 35e0bd0..e13e9c5 100644
--- a/core/api/src/main/java/org/apache/zest/api/service/importer/InstanceImporter.java
+++ b/core/api/src/main/java/org/apache/zest/api/service/importer/InstanceImporter.java
@@ -14,6 +14,7 @@
 
 package org.apache.zest.api.service.importer;
 
+import java.util.function.Function;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.service.ImportedServiceDescriptor;
 import org.apache.zest.api.service.ServiceImporter;
@@ -22,7 +23,6 @@ import org.apache.zest.api.structure.Application;
 import org.apache.zest.api.structure.Layer;
 import org.apache.zest.api.structure.MetaInfoHolder;
 import org.apache.zest.api.structure.Module;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 
 import static org.apache.zest.functional.Iterables.filter;
@@ -58,7 +58,7 @@ public final class InstanceImporter<T>
             {
                 @Override
                 @SuppressWarnings( "unchecked" )
-                public T map( Class<?> type )
+                public T apply( Class<?> type )
                 {
                     return (T) metaInfoHolder.metaInfo( type );
                 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/type/CollectionType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/type/CollectionType.java b/core/api/src/main/java/org/apache/zest/api/type/CollectionType.java
index 872c07d..ad2c466 100644
--- a/core/api/src/main/java/org/apache/zest/api/type/CollectionType.java
+++ b/core/api/src/main/java/org/apache/zest/api/type/CollectionType.java
@@ -29,7 +29,7 @@ public final class CollectionType
 
     public static boolean isCollection( Type type )
     {
-        Class<?> cl = Classes.RAW_CLASS.map( type );
+        Class<?> cl = Classes.RAW_CLASS.apply( type );
         return cl.equals( Collection.class ) || cl.equals( List.class ) || cl.equals( Set.class );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/type/MapType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/type/MapType.java b/core/api/src/main/java/org/apache/zest/api/type/MapType.java
index f2baf77..9232e6d 100644
--- a/core/api/src/main/java/org/apache/zest/api/type/MapType.java
+++ b/core/api/src/main/java/org/apache/zest/api/type/MapType.java
@@ -31,7 +31,7 @@ public final class MapType
 
     public static boolean isMap( Type type )
     {
-        Class<?> cl = Classes.RAW_CLASS.map( type );
+        Class<?> cl = Classes.RAW_CLASS.apply( type );
         return Map.class.isAssignableFrom( cl );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/type/ValueCompositeType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/type/ValueCompositeType.java b/core/api/src/main/java/org/apache/zest/api/type/ValueCompositeType.java
index 67cc7bf..6d53b94 100644
--- a/core/api/src/main/java/org/apache/zest/api/type/ValueCompositeType.java
+++ b/core/api/src/main/java/org/apache/zest/api/type/ValueCompositeType.java
@@ -30,7 +30,7 @@ public final class ValueCompositeType
 
     public static boolean isValueComposite( Type type )
     {
-        return ValueComposite.class.isAssignableFrom( Classes.RAW_CLASS.map( type ) );
+        return ValueComposite.class.isAssignableFrom( Classes.RAW_CLASS.apply( type ) );
     }
 
     public ValueCompositeType( ValueDescriptor model )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/type/ValueType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/type/ValueType.java b/core/api/src/main/java/org/apache/zest/api/type/ValueType.java
index a13b509..a9ed888 100644
--- a/core/api/src/main/java/org/apache/zest/api/type/ValueType.java
+++ b/core/api/src/main/java/org/apache/zest/api/type/ValueType.java
@@ -15,8 +15,8 @@
 package org.apache.zest.api.type;
 
 import java.util.Collections;
+import java.util.function.Function;
 import org.apache.zest.api.util.NullArgumentException;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 
 import static org.apache.zest.functional.Iterables.first;
@@ -138,7 +138,7 @@ public class ValueType
             new Function<Class<?>, String>()
             {
                 @Override
-                public String map( Class<?> item )
+                public String apply( Class<?> item )
                 {
                     return item.getName();
                 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/unitofwork/EntityTypeNotFoundException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/unitofwork/EntityTypeNotFoundException.java b/core/api/src/main/java/org/apache/zest/api/unitofwork/EntityTypeNotFoundException.java
index 58da2e1..917c019 100644
--- a/core/api/src/main/java/org/apache/zest/api/unitofwork/EntityTypeNotFoundException.java
+++ b/core/api/src/main/java/org/apache/zest/api/unitofwork/EntityTypeNotFoundException.java
@@ -15,7 +15,8 @@
  */
 package org.apache.zest.api.unitofwork;
 
-import org.apache.zest.functional.Function;
+
+import java.util.function.Function;
 
 import static org.apache.zest.functional.Iterables.fold;
 
@@ -45,7 +46,7 @@ public class EntityTypeNotFoundException
             }
 
             @Override
-            public String map( String type )
+            public String apply( String type )
             {
                 result.append( type );
                 result.append( "\n" );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/unitofwork/NoSuchEntityException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/unitofwork/NoSuchEntityException.java b/core/api/src/main/java/org/apache/zest/api/unitofwork/NoSuchEntityException.java
index 297344b..8651470 100644
--- a/core/api/src/main/java/org/apache/zest/api/unitofwork/NoSuchEntityException.java
+++ b/core/api/src/main/java/org/apache/zest/api/unitofwork/NoSuchEntityException.java
@@ -13,9 +13,9 @@
  */
 package org.apache.zest.api.unitofwork;
 
+import java.util.function.Function;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.usecase.Usecase;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 
 /**
@@ -76,7 +76,7 @@ public class NoSuchEntityException
         Iterable<String> map = Iterables.map( new Function<Class<?>, String>()
         {
             @Override
-            public String map( Class<?> item )
+            public String apply( Class<?> item )
             {
                 return item.getName();
             }
@@ -92,7 +92,7 @@ public class NoSuchEntityException
             }
 
             @Override
-            public String map( String strings )
+            public String apply( String strings )
             {
                 if( !first )
                 {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/unitofwork/UnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/unitofwork/UnitOfWork.java b/core/api/src/main/java/org/apache/zest/api/unitofwork/UnitOfWork.java
index 47fa360..e8fce81 100644
--- a/core/api/src/main/java/org/apache/zest/api/unitofwork/UnitOfWork.java
+++ b/core/api/src/main/java/org/apache/zest/api/unitofwork/UnitOfWork.java
@@ -16,6 +16,7 @@
 package org.apache.zest.api.unitofwork;
 
 import java.util.Map;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.composite.AmbiguousTypeException;
 import org.apache.zest.api.entity.EntityBuilder;
@@ -27,7 +28,6 @@ import org.apache.zest.api.query.Query;
 import org.apache.zest.api.query.QueryBuilder;
 import org.apache.zest.api.structure.MetaInfoHolder;
 import org.apache.zest.api.usecase.Usecase;
-import org.apache.zest.functional.Function;
 
 /**
  * All operations on entities goes through an UnitOfWork.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/util/Annotations.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/util/Annotations.java b/core/api/src/main/java/org/apache/zest/api/util/Annotations.java
index 553e6c1..da2e929 100644
--- a/core/api/src/main/java/org/apache/zest/api/util/Annotations.java
+++ b/core/api/src/main/java/org/apache/zest/api/util/Annotations.java
@@ -18,7 +18,7 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Type;
-import org.apache.zest.functional.Function;
+import java.util.function.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 
@@ -37,9 +37,9 @@ public final class Annotations
     public static Function<Type, Iterable<Annotation>> ANNOTATIONS_OF = Classes.forTypes( new Function<Type, Iterable<Annotation>>()
     {
         @Override
-        public Iterable<Annotation> map( Type type )
+        public Iterable<Annotation> apply( Type type )
         {
-            return Iterables.iterable( Classes.RAW_CLASS.map( type ).getAnnotations() );
+            return Iterables.iterable( Classes.RAW_CLASS.apply( type ).getAnnotations() );
         }
     } );
 
@@ -60,7 +60,7 @@ public final class Annotations
         return new Function<Annotation, Class<? extends Annotation>>()
         {
             @Override
-            public Class<? extends Annotation> map( Annotation annotation )
+            public Class<? extends Annotation> apply( Annotation annotation )
             {
                 return annotation.annotationType();
             }
@@ -81,7 +81,7 @@ public final class Annotations
 
     public static <T extends Annotation> T annotationOn( Type type, Class<T> annotationType )
     {
-        return annotationType.cast( Classes.RAW_CLASS.map( type ).getAnnotation( annotationType ) );
+        return annotationType.cast( Classes.RAW_CLASS.apply( type ).getAnnotation( annotationType ) );
     }
 
     public static Iterable<Annotation> findAccessorAndTypeAnnotationsIn( AccessibleObject accessor )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/util/Classes.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/util/Classes.java b/core/api/src/main/java/org/apache/zest/api/util/Classes.java
index 5a29f7d..92a5e86 100644
--- a/core/api/src/main/java/org/apache/zest/api/util/Classes.java
+++ b/core/api/src/main/java/org/apache/zest/api/util/Classes.java
@@ -30,8 +30,8 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
 import org.apache.zest.api.composite.ModelDescriptor;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 
@@ -85,7 +85,7 @@ public final class Classes
     private static final Function<Type, Type> WRAPPER_CLASS = new Function<Type, Type>()
     {
         @Override
-        public Type map( Type aClass )
+        public Type apply( Type aClass )
         {
             Type wrapperClass = wrapperClasses.get( aClass );
             return wrapperClass == null ? aClass : wrapperClass;
@@ -101,7 +101,7 @@ public final class Classes
     private static final Function<Type, Type> PRIMITIVE_CLASS = new Function<Type, Type>()
     {
         @Override
-        public Type map( Type aClass )
+        public Type apply( Type aClass )
         {
             Type primitiveClass = primitiveClasses.get( aClass );
             return primitiveClass == null ? aClass : primitiveClass;
@@ -114,7 +114,7 @@ public final class Classes
     public static final Function<Type, Class<?>> RAW_CLASS = new Function<Type, Class<?>>()
     {
         @Override
-        public Class<?> map( Type genericType )
+        public Class<?> apply( Type genericType )
         {
             // Calculate raw type
             if( genericType instanceof Class )
@@ -145,7 +145,7 @@ public final class Classes
     private static final Function<AccessibleObject, Type> TYPE_OF = new Function<AccessibleObject, Type>()
     {
         @Override
-        public Type map( AccessibleObject accessor )
+        public Type apply( AccessibleObject accessor )
         {
             return accessor instanceof Method ? ( (Method) accessor ).getGenericReturnType() : ( (Field) accessor ).getGenericType();
         }
@@ -155,7 +155,7 @@ public final class Classes
     {
         @Override
         @SuppressWarnings( {"raw", "unchecked"} )
-        public Iterable<Class<?>> map( Type type )
+        public Iterable<Class<?>> apply( Type type )
         {
             if( type == null )
             {
@@ -168,9 +168,9 @@ public final class Classes
             }
             else
             {
-                type = RAW_CLASS.map( type );
+                type = RAW_CLASS.apply( type );
                 Class superclass = ( (Class) type ).getSuperclass();
-                return prepend( (Class<?>) type, map( superclass ) );
+                return prepend( (Class<?>) type, apply( superclass ) );
             }
         }
     };
@@ -179,9 +179,9 @@ public final class Classes
     private static final Function<Type, Iterable<Type>> INTERFACES_OF = new Function<Type, Iterable<Type>>()
     {
         @Override
-        public Iterable<Type> map( Type type )
+        public Iterable<Type> apply( Type type )
         {
-            Class clazz = RAW_CLASS.map( type );
+            Class clazz = RAW_CLASS.apply( type );
 
             if( clazz.isInterface() )
             {
@@ -199,7 +199,7 @@ public final class Classes
                 {
                     return flatten( flattenIterables( Iterables.map( INTERFACES_OF,
                                                                      iterable( clazz.getGenericInterfaces() ) ) ),
-                                    INTERFACES_OF.map( RAW_CLASS.map( type ).getSuperclass() ) );
+                                    INTERFACES_OF.apply( RAW_CLASS.apply( type ).getSuperclass() ) );
                 }
             }
         }
@@ -209,9 +209,9 @@ public final class Classes
     private static final Function<Type, Iterable<Type>> TYPES_OF = new Function<Type, Iterable<Type>>()
     {
         @Override
-        public Iterable<Type> map( Type type )
+        public Iterable<Type> apply( Type type )
         {
-            Class clazz = RAW_CLASS.map( type );
+            Class clazz = RAW_CLASS.apply( type );
 
             if( clazz.isInterface() )
             {
@@ -221,15 +221,15 @@ public final class Classes
             }
             else
             {
-                return flatten( CLASS_HIERARCHY.map( type ),
-                                flattenIterables( Iterables.map( INTERFACES_OF, CLASS_HIERARCHY.map( type ) ) ) );
+                return flatten( CLASS_HIERARCHY.apply( type ),
+                                flattenIterables( Iterables.map( INTERFACES_OF, CLASS_HIERARCHY.apply( type ) ) ) );
             }
         }
     };
 
     public static Type typeOf( AccessibleObject from )
     {
-        return TYPE_OF.map( from );
+        return TYPE_OF.apply( from );
     }
 
     public static Iterable<Type> typesOf( Iterable<Type> types )
@@ -244,7 +244,7 @@ public final class Classes
 
     public static Iterable<Type> typesOf( Type type )
     {
-        return TYPES_OF.map( type );
+        return TYPES_OF.apply( type );
     }
 
     public static Iterable<? extends Type> interfacesOf( Iterable<? extends Type> types )
@@ -259,17 +259,17 @@ public final class Classes
 
     public static Iterable<Type> interfacesOf( Type type )
     {
-        return INTERFACES_OF.map( type );
+        return INTERFACES_OF.apply( type );
     }
 
     public static Iterable<Class<?>> classHierarchy( Class<?> type )
     {
-        return CLASS_HIERARCHY.map( type );
+        return CLASS_HIERARCHY.apply( type );
     }
 
     public static Type wrapperClass( Type type )
     {
-        return WRAPPER_CLASS.map( type );
+        return WRAPPER_CLASS.apply( type );
     }
 
     public static Specification<Class<?>> isAssignableFrom( final Class clazz )
@@ -315,9 +315,9 @@ public final class Classes
         return new Function<Type, Iterable<T>>()
         {
             @Override
-            public Iterable<T> map( Type type )
+            public Iterable<T> apply( Type type )
             {
-                return flattenIterables( Iterables.map( function, CLASS_HIERARCHY.map( type ) ) );
+                return flattenIterables( Iterables.map( function, CLASS_HIERARCHY.apply( type ) ) );
             }
         };
     }
@@ -327,9 +327,9 @@ public final class Classes
         return new Function<Type, Iterable<T>>()
         {
             @Override
-            public Iterable<T> map( Type type )
+            public Iterable<T> apply( Type type )
             {
-                return flattenIterables( Iterables.map( function, TYPES_OF.map( type ) ) );
+                return flattenIterables( Iterables.map( function, TYPES_OF.apply( type ) ) );
             }
         };
     }
@@ -417,9 +417,9 @@ public final class Classes
         AnnotationType findAnnotationOfTypeOrAnyOfSuperTypes( Class<?> type, Class<AnnotationType> annotationClass )
     {
         AnnotationType result = null;
-        for( Type clazz : Classes.TYPES_OF.map( type ) )
+        for( Type clazz : Classes.TYPES_OF.apply( type ) )
         {
-            result = Classes.RAW_CLASS.map( clazz ).getAnnotation( annotationClass );
+            result = Classes.RAW_CLASS.apply( clazz ).getAnnotation( annotationClass );
             if( result != null )
             {
                 break;
@@ -482,7 +482,7 @@ public final class Classes
         List<Type> types = new ArrayList<>();
         for( Type type : current.getGenericInterfaces() )
         {
-            Iterable<Type> interfaces = Classes.INTERFACES_OF.map( type );
+            Iterable<Type> interfaces = Classes.INTERFACES_OF.apply( type );
             for( Type anInterface : interfaces )
             {
                 if( !types.contains( anInterface ) )
@@ -612,7 +612,7 @@ public final class Classes
                 }, map( new Function<Class<?>, String>()
                 {
                     @Override
-                    public String map( Class<?> item )
+                    public String apply( Class<?> item )
                     {
                         return item.getName();
                     }
@@ -686,9 +686,9 @@ public final class Classes
         return new Function<Type, String>()
         {
             @Override
-            public String map( Type type )
+            public String apply( Type type )
             {
-                return RAW_CLASS.map( type ).getName();
+                return RAW_CLASS.apply( type ).getName();
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/util/Constructors.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/util/Constructors.java b/core/api/src/main/java/org/apache/zest/api/util/Constructors.java
index 440c6fb..fd09eb3 100644
--- a/core/api/src/main/java/org/apache/zest/api/util/Constructors.java
+++ b/core/api/src/main/java/org/apache/zest/api/util/Constructors.java
@@ -20,7 +20,7 @@ package org.apache.zest.api.util;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Type;
-import org.apache.zest.functional.Function;
+import java.util.function.Function;
 
 import static org.apache.zest.functional.Iterables.iterable;
 
@@ -32,7 +32,7 @@ public final class Constructors
     public static final Function<Type, Iterable<Constructor<?>>> CONSTRUCTORS_OF = Classes.forClassHierarchy( new Function<Class<?>, Iterable<Constructor<?>>>()
     {
         @Override
-        public Iterable<Constructor<?>> map( Class<?> type )
+        public Iterable<Constructor<?>> apply( Class<?> type )
         {
             return iterable( type.getDeclaredConstructors() );
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/util/Fields.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/util/Fields.java b/core/api/src/main/java/org/apache/zest/api/util/Fields.java
index e6ecced..9e5768c 100644
--- a/core/api/src/main/java/org/apache/zest/api/util/Fields.java
+++ b/core/api/src/main/java/org/apache/zest/api/util/Fields.java
@@ -20,8 +20,8 @@ package org.apache.zest.api.util;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Type;
-import org.apache.zest.functional.Function;
-import org.apache.zest.functional.Function2;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.apache.zest.functional.Iterables;
 
 import static org.apache.zest.functional.Iterables.iterable;
@@ -31,19 +31,19 @@ import static org.apache.zest.functional.Iterables.iterable;
  */
 public final class Fields
 {
-    public static final Function2<Class<?>, String, Field> FIELD_NAMED = new Function2<Class<?>, String, Field>()
+    public static final BiFunction<Class<?>, String, Field> FIELD_NAMED = new BiFunction<Class<?>, String, Field>()
     {
         @Override
-        public Field map( Class<?> aClass, String name )
+        public Field apply( Class<?> aClass, String name )
         {
-            return Iterables.first( Iterables.filter( Classes.memberNamed( name ), FIELDS_OF.map( aClass ) ) );
+            return Iterables.first( Iterables.filter( Classes.memberNamed( name ), FIELDS_OF.apply( aClass ) ) );
         }
     };
 
     public static final Function<Type, Iterable<Field>> FIELDS_OF = Classes.forClassHierarchy( new Function<Class<?>, Iterable<Field>>()
     {
         @Override
-        public Iterable<Field> map( Class<?> type )
+        public Iterable<Field> apply( Class<?> type )
         {
             return iterable( type.getDeclaredFields() );
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/util/Methods.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/util/Methods.java b/core/api/src/main/java/org/apache/zest/api/util/Methods.java
index f87d58f..c091597 100644
--- a/core/api/src/main/java/org/apache/zest/api/util/Methods.java
+++ b/core/api/src/main/java/org/apache/zest/api/util/Methods.java
@@ -20,7 +20,7 @@ package org.apache.zest.api.util;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
-import org.apache.zest.functional.Function;
+import java.util.function.Function;
 import org.apache.zest.functional.Specification;
 
 import static org.apache.zest.functional.Iterables.iterable;
@@ -35,16 +35,16 @@ public class Methods
         @Override
         public boolean satisfiedBy( Type item )
         {
-            return Classes.RAW_CLASS.map( item ).getDeclaredMethods().length > 0;
+            return Classes.RAW_CLASS.apply( item ).getDeclaredMethods().length > 0;
         }
     };
 
     public static final Function<Type, Iterable<Method>> METHODS_OF = Classes.forTypes( new Function<Type, Iterable<Method>>()
     {
         @Override
-        public Iterable<Method> map( Type type )
+        public Iterable<Method> apply( Type type )
         {
-            return iterable( Classes.RAW_CLASS.map( type ).getDeclaredMethods() );
+            return iterable( Classes.RAW_CLASS.apply( type ).getDeclaredMethods() );
         }
     } );
 }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/value/ValueBuilderFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/value/ValueBuilderFactory.java b/core/api/src/main/java/org/apache/zest/api/value/ValueBuilderFactory.java
index 062c3fd..7e72673 100644
--- a/core/api/src/main/java/org/apache/zest/api/value/ValueBuilderFactory.java
+++ b/core/api/src/main/java/org/apache/zest/api/value/ValueBuilderFactory.java
@@ -14,11 +14,11 @@
 package org.apache.zest.api.value;
 
 import java.util.Map;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.common.ConstructionException;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.property.PropertyDescriptor;
-import org.apache.zest.functional.Function;
 
 /**
  * Factory for Values and ValueBuilders.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/value/ValueDeserializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/value/ValueDeserializer.java b/core/api/src/main/java/org/apache/zest/api/value/ValueDeserializer.java
index abdd7d1..cae79d6 100644
--- a/core/api/src/main/java/org/apache/zest/api/value/ValueDeserializer.java
+++ b/core/api/src/main/java/org/apache/zest/api/value/ValueDeserializer.java
@@ -16,9 +16,9 @@
 package org.apache.zest.api.value;
 
 import java.io.InputStream;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.apache.zest.api.type.ValueType;
-import org.apache.zest.functional.Function;
-import org.apache.zest.functional.Function2;
 
 /**
  * Use a ValueDeserializer to create new values instances from serialized state.
@@ -100,7 +100,7 @@ public interface ValueDeserializer
      * @param <T> the parametrized function return type
      * @return a deserialization function
      */
-    <T> Function2<ValueType, String, T> deserialize();
+    <T> BiFunction<ValueType, String, T> deserialize();
 
     /**
      * Deserialize a value from a state.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/main/java/org/apache/zest/api/value/ValueSerializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/value/ValueSerializer.java b/core/api/src/main/java/org/apache/zest/api/value/ValueSerializer.java
index 26db5e2..fc703dc 100644
--- a/core/api/src/main/java/org/apache/zest/api/value/ValueSerializer.java
+++ b/core/api/src/main/java/org/apache/zest/api/value/ValueSerializer.java
@@ -18,8 +18,8 @@ package org.apache.zest.api.value;
 import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Function;
 import org.apache.zest.api.composite.AmbiguousTypeException;
-import org.apache.zest.functional.Function;
 
 /**
  * Use a ValueSerializer to serialize values state.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/test/java/org/apache/zest/api/util/ClassesTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/zest/api/util/ClassesTest.java b/core/api/src/test/java/org/apache/zest/api/util/ClassesTest.java
index 151e5d5..4b9e79e 100644
--- a/core/api/src/test/java/org/apache/zest/api/util/ClassesTest.java
+++ b/core/api/src/test/java/org/apache/zest/api/util/ClassesTest.java
@@ -83,7 +83,7 @@ public class ClassesTest
     {
         Type returnType = Generics.class.getMethod( "wildcard" ).getGenericReturnType();
         Type wildcardType = ( (ParameterizedType) returnType ).getActualTypeArguments()[ 0];
-        assertThat( "Return type is A", Classes.RAW_CLASS.map( wildcardType ), equalTo( (Class) A.class ) );
+        assertThat( "Return type is A", Classes.RAW_CLASS.apply( wildcardType ), equalTo( (Class) A.class ) );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/api/src/test/java/org/apache/zest/api/value/DocumentationSupport.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/zest/api/value/DocumentationSupport.java b/core/api/src/test/java/org/apache/zest/api/value/DocumentationSupport.java
index 9cf0a14..43acbc2 100644
--- a/core/api/src/test/java/org/apache/zest/api/value/DocumentationSupport.java
+++ b/core/api/src/test/java/org/apache/zest/api/value/DocumentationSupport.java
@@ -27,6 +27,7 @@ import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.function.Function;
 import org.junit.Before;
 import org.junit.Test;
 import org.apache.zest.api.injection.scope.Service;
@@ -41,7 +42,6 @@ import org.apache.zest.bootstrap.Assembler;
 import org.apache.zest.bootstrap.AssemblyException;
 import org.apache.zest.bootstrap.Energy4Java;
 import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.functional.Function;
 import org.apache.zest.io.Inputs;
 import org.apache.zest.io.Outputs;
 import org.apache.zest.io.Transforms;
@@ -252,7 +252,7 @@ public class DocumentationSupport
                                     Function<Application, Module> valuesModuleFinder = new Function<Application, Module>()
                                     {
                                         @Override
-                                        public Module map( Application app )
+                                        public Module apply( Application app )
                                         {
                                             return app.findModule( "SINGLE-Layer", "VALUES-Module" );
                                         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/bootstrap/src/main/java/org/apache/zest/bootstrap/ClassScanner.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/zest/bootstrap/ClassScanner.java b/core/bootstrap/src/main/java/org/apache/zest/bootstrap/ClassScanner.java
index d8fb7b7..54cacae 100644
--- a/core/bootstrap/src/main/java/org/apache/zest/bootstrap/ClassScanner.java
+++ b/core/bootstrap/src/main/java/org/apache/zest/bootstrap/ClassScanner.java
@@ -23,10 +23,10 @@ import java.lang.reflect.Modifier;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.CodeSource;
+import java.util.function.Function;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.regex.Pattern;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 
@@ -90,7 +90,7 @@ public class ClassScanner
                                                      map( new Function<JarEntry, Class<?>>()
                                                      {
                                                          @Override
-                                                         public Class map( JarEntry jarEntry )
+                                                         public Class apply( JarEntry jarEntry )
                                                          {
                                                              String name = jarEntry.getName();
                                                              name = name.substring( 0, name.length() - 6 );
@@ -142,7 +142,7 @@ public class ClassScanner
                            map( new Function<File, Class<?>>()
                            {
                                @Override
-                               public Class<?> map( File f )
+                               public Class<?> apply( File f )
                                {
                                    String fileName = f.getAbsolutePath().substring( file.toString().length() + 1 );
                                    fileName = fileName.replace( File.separatorChar, '.' )
@@ -190,7 +190,7 @@ public class ClassScanner
                         flattenIterables( map( new Function<File, Iterable<File>>()
                         {
                             @Override
-                            public Iterable<File> map( File file )
+                            public Iterable<File> apply( File file )
                             {
                                 return findFiles( file, filter );
                             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/main/java/org/apache/zest/functional/ForEach.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/apache/zest/functional/ForEach.java b/core/functional/src/main/java/org/apache/zest/functional/ForEach.java
index 7126ff1..e7e815a 100644
--- a/core/functional/src/main/java/org/apache/zest/functional/ForEach.java
+++ b/core/functional/src/main/java/org/apache/zest/functional/ForEach.java
@@ -14,6 +14,7 @@
 package org.apache.zest.functional;
 
 import java.util.Iterator;
+import java.util.function.Function;
 
 /**
  * When using Iterables with map() and filter() the code often reads "in reverse", with the first item last in the code.

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/main/java/org/apache/zest/functional/Function.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/apache/zest/functional/Function.java b/core/functional/src/main/java/org/apache/zest/functional/Function.java
deleted file mode 100644
index 8107787..0000000
--- a/core/functional/src/main/java/org/apache/zest/functional/Function.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.zest.functional;
-
-/**
- * Generic function interface to map from one type to another.
- *
- * This can be used with the Iterables methods to transform lists of objects.
- *
- * @param <From>
- * @param <To>
- */
-public interface Function<From, To>
-{
-    /**
-     * Map a single item from one type to another
-     *
-     * @param from the input item
-     *
-     * @return the mapped item
-     */
-    To map( From from );
-}

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/main/java/org/apache/zest/functional/Function2.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/apache/zest/functional/Function2.java b/core/functional/src/main/java/org/apache/zest/functional/Function2.java
deleted file mode 100644
index 1cc01c3..0000000
--- a/core/functional/src/main/java/org/apache/zest/functional/Function2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.zest.functional;
-
-/**
- * Generic function interface to map from two parameters to a third.
- *
- * This can be used with the Iterables methods to transform lists of objects.
- */
-public interface Function2<First, Second, To>
-{
-    /**
-     * Map a single item from one type to another
-     *
-     * @param first
-     * @param second
-     *
-     * @return the mapped item
-     */
-    To map( First first, Second second );
-}

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/main/java/org/apache/zest/functional/Functions.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/apache/zest/functional/Functions.java b/core/functional/src/main/java/org/apache/zest/functional/Functions.java
index be72310..318c8c0 100644
--- a/core/functional/src/main/java/org/apache/zest/functional/Functions.java
+++ b/core/functional/src/main/java/org/apache/zest/functional/Functions.java
@@ -16,18 +16,20 @@ package org.apache.zest.functional;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 
 /**
  * Utility functions. Combine these with methods in Iterables, for example. See FunctionsTest for usages.
  */
 public final class Functions
 {
-    public static <A, B, C> Function2<Function<? super B, C>, Function<A, B>, Function<A, C>> compose()
+    public static <A, B, C> BiFunction<Function<? super B, C>, Function<A, B>, Function<A, C>> compose()
     {
-        return new Function2<Function<? super B, C>, Function<A, B>, Function<A, C>>()
+        return new BiFunction<Function<? super B, C>, Function<A, B>, Function<A, C>>()
         {
             @Override
-            public Function<A, C> map( Function<? super B, C> bcFunction, Function<A, B> abFunction )
+            public Function<A, C> apply( Function<? super B, C> bcFunction, Function<A, B> abFunction )
             {
                 return compose( bcFunction, abFunction );
             }
@@ -49,9 +51,9 @@ public final class Functions
         return new Function<FROM, TO>()
         {
             @Override
-            public TO map( FROM from )
+            public TO apply( FROM from )
             {
-                return outer.map( inner.map( from ) );
+                return outer.apply( inner.apply( from ) );
             }
         };
     }
@@ -61,7 +63,7 @@ public final class Functions
         return new Function<FROM, TO>()
         {
             @Override
-            public TO map( FROM from )
+            public TO apply( FROM from )
             {
                 return from;
             }
@@ -73,7 +75,7 @@ public final class Functions
         return new Function<FROM, TO>()
         {
             @Override
-            public TO map( FROM from )
+            public TO apply( FROM from )
             {
                 return map.get( from );
             }
@@ -85,7 +87,7 @@ public final class Functions
         return new Function<T, T>()
         {
             @Override
-            public T map( T from )
+            public T apply( T from )
             {
                 if( from == null )
                 {
@@ -106,7 +108,7 @@ public final class Functions
             long sum;
 
             @Override
-            public Long map( Number number )
+            public Long apply( Number number )
             {
                 sum += number.longValue();
                 return sum;
@@ -121,7 +123,7 @@ public final class Functions
             int sum;
 
             @Override
-            public Integer map( Number number )
+            public Integer apply( Number number )
             {
                 sum += number.intValue();
                 return sum;
@@ -132,7 +134,7 @@ public final class Functions
     /**
      * Count the number of items in an iterable that matches a given specification.
      *
-     * Sample usage: last( map( count( in( "X" ) ), iterable( "X","Y","X","X","Y" ) ) )
+     * Sample usage: last( apply( count( in( "X" ) ), iterable( "X","Y","X","X","Y" ) ) )
      * Returns: 3
      *
      * @param specification The items that adhere to the Specification is counted.
@@ -147,7 +149,7 @@ public final class Functions
             int count;
 
             @Override
-            public Integer map( T item )
+            public Integer apply( T item )
             {
                 if( specification.satisfiedBy( item ) )
                 {
@@ -177,7 +179,7 @@ public final class Functions
             int current = 0;
 
             @Override
-            public Integer map( T item )
+            public Integer apply( T item )
             {
                 if( index == -1 && specification.satisfiedBy( item ) )
                 {
@@ -221,9 +223,9 @@ public final class Functions
         return new Function<T, T>()
         {
             @Override
-            public T map( T from )
+            public T apply( T from )
             {
-                return specification.satisfiedBy( from ) ? function.map( from ) : from;
+                return specification.satisfiedBy( from ) ? function.apply( from ) : from;
             }
         };
     }
@@ -254,14 +256,14 @@ public final class Functions
                 Comparable key1 = compareKeys.get( o1 );
                 if( key1 == null )
                 {
-                    key1 = comparableFunction.map( o1 );
+                    key1 = comparableFunction.apply( o1 );
                     compareKeys.put( o1, key1 );
                 }
 
                 Comparable key2 = compareKeys.get( o2 );
                 if( key2 == null )
                 {
-                    key2 = comparableFunction.map( o2 );
+                    key2 = comparableFunction.apply( o2 );
                     compareKeys.put( o2, key2 );
                 }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/main/java/org/apache/zest/functional/Iterables.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/apache/zest/functional/Iterables.java b/core/functional/src/main/java/org/apache/zest/functional/Iterables.java
index a77a519..1b80bcc 100644
--- a/core/functional/src/main/java/org/apache/zest/functional/Iterables.java
+++ b/core/functional/src/main/java/org/apache/zest/functional/Iterables.java
@@ -26,6 +26,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Set;
+import java.util.function.Function;
 
 /**
  * Utility methods for working with Iterables. See test for examples of how to use.
@@ -338,7 +339,7 @@ public final class Iterables
                 final Iterable<Iterator<T>> iterators = toList( map( new Function<Iterable<T>, Iterator<T>>()
                 {
                     @Override
-                    public Iterator<T> map( Iterable<T> iterable )
+                    public Iterator<T> apply( Iterable<T> iterable )
                     {
                         return iterable.iterator();
                     }
@@ -437,7 +438,7 @@ public final class Iterables
         {
             @Override
             @SuppressWarnings( "unchecked" )
-            public TO map( FROM from )
+            public TO apply( FROM from )
             {
                 return (TO) from;
             }
@@ -574,15 +575,15 @@ public final class Iterables
         return map( new Function<T, T>()
         {
             @Override
-            public T map( T t )
+            public T apply( T t )
             {
                 if( functions.length != 0 )
                 {
                     String[] mapped = new String[ functions.length ];
                     for( int i = 0; i < functions.length; i++ )
                     {
-                        Function<T, String> function = functions[i];
-                        mapped[i] = function.map( t );
+                        Function<T, String> function = functions[ i ];
+                        mapped[ i ] = function.apply( t );
                     }
                 }
                 return t;
@@ -600,7 +601,7 @@ public final class Iterables
         return toString( iterable, new Function<T, String>()
         {
             @Override
-            public String map( T t )
+            public String apply( T t )
             {
                 return t == null ? "[null]" : t.toString();
             }
@@ -617,7 +618,7 @@ public final class Iterables
             {
                 builder.append( separator );
             }
-            builder.append( toStringFunction.map( item ) );
+            builder.append( toStringFunction.apply( item ) );
             first = false;
         }
         return builder.toString();
@@ -699,7 +700,7 @@ public final class Iterables
             public TO next()
             {
                 FROM from = fromIterator.next();
-                return function.map( from );
+                return function.apply( from );
             }
 
             @Override

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/main/java/org/apache/zest/functional/Specifications.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/apache/zest/functional/Specifications.java b/core/functional/src/main/java/org/apache/zest/functional/Specifications.java
index 6da1739..e81cd48 100644
--- a/core/functional/src/main/java/org/apache/zest/functional/Specifications.java
+++ b/core/functional/src/main/java/org/apache/zest/functional/Specifications.java
@@ -13,6 +13,8 @@
  */
 package org.apache.zest.functional;
 
+import java.util.function.Function;
+
 /**
  * Common generic specification expressions
  */
@@ -110,7 +112,7 @@ public class Specifications
             @Override
             public boolean satisfiedBy( FROM item )
             {
-                return specification.satisfiedBy( function.map( item ) );
+                return specification.satisfiedBy( function.apply( item ) );
             }
         };
     }


Mime
View raw message