Skip to content

Commit

Permalink
Remove custom Operators
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Dec 10, 2015
1 parent 7a25ef7 commit 72a564f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 176 deletions.

This file was deleted.

Expand Up @@ -87,17 +87,10 @@ public To apply( From from )
};
}

private static UnaryOperator IDENTITY = new UnaryOperator()
{
@Override
public Object apply( Object value )
{
return value;
}
};
private static Function IDENTITY = value -> value;

@SuppressWarnings( "unchecked" )
public static <T> UnaryOperator<T> identity()
public static <T> Function<T,T> identity()
{
return IDENTITY;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -834,27 +834,13 @@ public char arrayDelimiter()

private <ENTITY extends InputEntity> DataFactory<ENTITY> given( final CharSeeker data )
{
return new DataFactory<ENTITY>()
{
@Override
public Data<ENTITY> create( Configuration config )
{
return dataItem( data, Functions.<ENTITY>identity() );
}
};
return config -> dataItem( data, Functions.<ENTITY>identity() );
}

private <ENTITY extends InputEntity> DataFactory<ENTITY> data( final CharSeeker data,
final Function<ENTITY,ENTITY> decorator )
{
return new DataFactory<ENTITY>()
{
@Override
public Data<ENTITY> create( Configuration config )
{
return dataItem( data, decorator );
}
};
return config -> dataItem( data, decorator );
}

private static <ENTITY extends InputEntity> Data<ENTITY> dataItem( final CharSeeker data,
Expand Down Expand Up @@ -921,14 +907,7 @@ private Set<String> labels( String... labels )

private Header.Factory header( final Header.Entry... entries )
{
return new Header.Factory()
{
@Override
public Header create( CharSeeker from, Configuration configuration, IdType idType )
{
return new Header( entries );
}
};
return ( from, configuration, idType ) -> new Header( entries );
}

private Header.Entry entry( String name, Type type, Extractor<?> extractor )
Expand All @@ -949,14 +928,7 @@ private static <ENTITY extends InputEntity> DataFactory<ENTITY> data( final Stri
private static <ENTITY extends InputEntity> DataFactory<ENTITY> data( final String data,
final Function<ENTITY,ENTITY> decorator )
{
return new DataFactory<ENTITY>()
{
@Override
public Data<ENTITY> create( Configuration config )
{
return dataItem( charSeeker( data ), decorator );
}
};
return config -> dataItem( charSeeker( data ), decorator );
}

private static final org.neo4j.csv.reader.Configuration SEEKER_CONFIG =
Expand Down

0 comments on commit 72a564f

Please sign in to comment.