Unnamed: 0 int64 0 6.7k | func stringlengths 12 89.6k | target bool 2
classes | project stringlengths 45 151 |
|---|---|---|---|
2,900 | private static class Consumer extends PropertyTypeDispatcher<String, Void>
{
private final MappingWriter writer;
Consumer( MappingWriter serializer )
{
this.writer = serializer;
}
@Override
protected Void dispatchBooleanProperty( boolean property, St... | false | community_server_src_main_java_org_neo4j_server_rest_repr_PropertiesRepresentation.java |
2,901 | class RepresentationTestBase
{
static final URI BASE_URI = URI.create( "http://neo4j.org/" );
static final String NODE_URI_PATTERN = "http://.*/node/[0-9]+";
static final String RELATIONSHIP_URI_PATTERN = "http://.*/relationship/[0-9]+";
static void assertUriMatches( String expectedRegex, ValueRepresen... | false | community_server_src_test_java_org_neo4j_server_rest_repr_RepresentationTestBase.java |
2,902 | {
@Override
public void onRepresentationStartWriting()
{
// do nothing
}
@Override
public void onRepresentationWritten()
{
// do nothing
}
@Override
public void onRepresentationFinal()
{
// ... | false | community_server_src_main_java_org_neo4j_server_rest_repr_RepresentationWriteHandler.java |
2,903 | private static class ParameterRepresentation extends MappingRepresentation
{
private final String name;
private final RepresentationType paramType;
private final String description;
private final boolean optional;
private final boolean list;
ParameterRepresentati... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ExtensionPointRepresentation.java |
2,904 | public class SchemaIndexRepresentationTest
{
@Test
public void shouldIncludeLabel() throws Exception
{
// GIVEN
String labelName = "person", propertyKey = "name";
IndexDefinition definition = mock( IndexDefinition.class );
when( definition.getLabel() ).thenReturn( label( labe... | false | community_server_src_test_java_org_neo4j_server_rest_repr_SchemaIndexRepresentationTest.java |
2,905 | NODE( Representation.NODE )
{
@Override
String render( Map<String, Object> serialized )
{
return JsonHelper.createJsonFrom( MapUtil.map( "self", serialized.get( "self" ), "data",
serialized.get( "data" ) ) );
}
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_formats_CompactJsonFormat.java |
2,906 | private static class CompactJsonWriter extends MapWrappingWriter
{
private final MappingTemplate template;
public CompactJsonWriter( MappingTemplate template )
{
super( new HashMap<String, Object>(), true );
this.template = template;
}
@Override
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_formats_CompactJsonFormat.java |
2,907 | @Service.Implementation( RepresentationFormat.class )
public class CompactJsonFormat extends RepresentationFormat
{
public static final MediaType MEDIA_TYPE = new MediaType( MediaType.APPLICATION_JSON_TYPE.getType(),
MediaType.APPLICATION_JSON_TYPE.getSubtype(), MapUtil.stringMap( "compact", "true" ) );... | false | community_server_src_main_java_org_neo4j_server_rest_repr_formats_CompactJsonFormat.java |
2,908 | public class WeightedPathRepresentation extends PathRepresentation<WeightedPath>
{
public WeightedPathRepresentation( WeightedPath path )
{
super( path );
}
@Mapping( "weight" )
public ValueRepresentation weight()
{
return ValueRepresentation.number( getPath().weight() );
}
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_WeightedPathRepresentation.java |
2,909 | {
@Override
protected Representation underlyingObjectToObject( Object object )
{
return property( object );
}
}; | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ValueRepresentation.java |
2,910 | {
@Override
protected Representation dispatchBooleanProperty( boolean property, Void param )
{
return bool( property );
}
@Override
protected Representation dispatchByteProperty( byte property, Void param )
{
return new ValueRepresenta... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ValueRepresentation.java |
2,911 | {
@Override
String serialize( RepresentationFormat format, URI baseUri, ExtensionInjector extensions )
{
return Serializer.joinBaseWithRelativePath( baseUri, path );
}
@Override
void addTo( ListSerializer serializer )
... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ValueRepresentation.java |
2,912 | {
@Override
String serialize( RepresentationFormat format, URI baseUri, ExtensionInjector extensions )
{
return Serializer.joinBaseWithRelativePath( baseUri, path );
}
@Override
void addTo( ListSerializer serializer )
... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ValueRepresentation.java |
2,913 | public class ValueRepresentation extends Representation
{
private final Object value;
private ValueRepresentation( RepresentationType type, Object value )
{
super( type );
this.value = value;
}
@Override
String serialize( RepresentationFormat format, URI baseUri, ExtensionInjec... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ValueRepresentation.java |
2,914 | public class TestExceptionRepresentation
{
@Test
public void shouldIncludeCause() throws Exception
{
// Given
ExceptionRepresentation rep = new ExceptionRepresentation(
new RuntimeException("Hoho",
new RuntimeException("Haha",
... | false | community_server_src_test_java_org_neo4j_server_rest_repr_TestExceptionRepresentation.java |
2,915 | public class ServerListRepresentation extends ListRepresentation
{
public ServerListRepresentation( RepresentationType type, Iterable<? extends Representation> content )
{
super( type, content );
}
protected void serialize( ListSerializer serializer )
{
for ( Object val : content )
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ServerListRepresentation.java |
2,916 | private static class EntityExtensionRepresentation extends MappingRepresentation
{
private final List<ExtensionPointRepresentation> extensions;
EntityExtensionRepresentation()
{
super( "entity-extensions" );
this.extensions = new ArrayList<ExtensionPointRepresent... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ServerExtensionRepresentation.java |
2,917 | public final class ServerExtensionRepresentation extends MappingRepresentation
{
private final Map<String, EntityExtensionRepresentation> extended;
public ServerExtensionRepresentation( String name, List<ExtensionPointRepresentation> methods )
{
super( RepresentationType.SERVER_PLUGIN_DESCRIPTION )... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ServerExtensionRepresentation.java |
2,918 | Serializer serializer = new Serializer(URI.create( baseUrl ), null){}; | false | community_server-api_src_test_java_org_neo4j_server_rest_repr_SerializerTest.java |
2,919 | public class SerializerTest
{
@Test
public void shouldPrependBaseUriToRelativePaths() {
String baseUrl = "http://baseurl/";
Serializer serializer = new Serializer(URI.create( baseUrl ), null){};
String aRelativeUrl = "/path/path/path";
assertThat(serializer.relativ... | false | community_server-api_src_test_java_org_neo4j_server_rest_repr_SerializerTest.java |
2,920 | abstract class Serializer
{
private final URI baseUri;
private final ExtensionInjector extensions;
Serializer( URI baseUri, ExtensionInjector extensions )
{
this.baseUri = baseUri;
this.extensions = extensions;
}
final void serialize( MappingWriter mapping, MappingRepresentatio... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_Serializer.java |
2,921 | public final class ScoredRelationshipRepresentation extends
ScoredEntityRepresentation<RelationshipRepresentation>
{
public ScoredRelationshipRepresentation(
RelationshipRepresentation delegate, float score )
{
super( delegate, score );
}
@Override
public String getIdent... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ScoredRelationshipRepresentation.java |
2,922 | public final class ScoredNodeRepresentation extends
ScoredEntityRepresentation<NodeRepresentation>
{
public ScoredNodeRepresentation( NodeRepresentation delegate, float score )
{
super( delegate, score );
}
@Mapping( "create_relationship" )
public ValueRepresentation relationshipCre... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ScoredNodeRepresentation.java |
2,923 | public abstract class ScoredEntityRepresentation<E extends ObjectRepresentation & ExtensibleRepresentation & EntityRepresentation>
extends ObjectRepresentation implements ExtensibleRepresentation,
EntityRepresentation
{
private final E delegate;
private final float score;
protected ScoredEn... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ScoredEntityRepresentation.java |
2,924 | public final class PropertiesRepresentation extends MappingRepresentation
{
private final PropertyContainer entity;
public PropertiesRepresentation( PropertyContainer entity )
{
super( RepresentationType.PROPERTIES );
this.entity = entity;
}
public boolean isEmpty()
{
r... | false | community_server_src_main_java_org_neo4j_server_rest_repr_PropertiesRepresentation.java |
2,925 | {
@Override
protected Representation underlyingObjectToObject( Relationship node )
{
return ValueRepresentation.uri( RelationshipRepresentation.path( node ) );
}
} ); | false | community_server_src_main_java_org_neo4j_server_rest_repr_PathRepresentation.java |
2,926 | {
@Override
protected Representation underlyingObjectToObject( Node node )
{
return ValueRepresentation.uri( NodeRepresentation.path( node ) );
}
} ); | false | community_server_src_main_java_org_neo4j_server_rest_repr_PathRepresentation.java |
2,927 | public class PathRepresentation<P extends Path> extends ObjectRepresentation // implements
// ExtensibleRepresentation
{
private final P path;
public PathRepresentation( P path )
{
super( RepresentationType.PATH );
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_PathRepresentation.java |
2,928 | public class MapRepresentationTest
{
@Test
public void shouldSerializeMapWithSimpleTypes() throws Exception
{
MapRepresentation rep = new MapRepresentation( map( "nulls", null, "strings", "a string", "numbers", 42,
"booleans", true ) );
OutputFormat format = new OutputFormat(... | false | community_server_src_test_java_org_neo4j_server_rest_repr_MapRepresentationTest.java |
2,929 | public class MapRepresentation extends MappingRepresentation
{
private final Map value;
public MapRepresentation( Map value )
{
super( RepresentationType.MAP );
this.value = value;
}
@Override
protected void serialize( MappingSerializer serializer )
{
for ( Object ... | false | community_server_src_main_java_org_neo4j_server_rest_repr_MapRepresentation.java |
2,930 | public abstract class ListWriter
{
MappingWriter newMapping( RepresentationType type )
{
return newMapping( type.valueName );
}
protected abstract MappingWriter newMapping( String type );
ListWriter newList( RepresentationType type )
{
if ( type.listName == null )
t... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListWriter.java |
2,931 | public class ListSerializer extends Serializer
{
final ListWriter writer;
ListSerializer( ListWriter writer, URI baseUri, ExtensionInjector extensions )
{
super( baseUri, extensions );
this.writer = writer;
}
public void addUri( String path )
{
writer.writeValue( Repres... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListSerializer.java |
2,932 | {
int pos = 0;
@Override
protected ValueRepresentation fetchNextOrNull()
{
if ( pos >= values.length ) return null;
ret... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,933 | {
@Override
public Iterator<ValueRepresentation> iterator()
{
return new PrefetchingIterator<ValueRepresentation>()
{
int pos = 0;
@Overrid... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,934 | {
int pos = 0;
@Override
protected ValueRepresentation fetchNextOrNull()
{
if ( pos >= values.length ) return null;
return ValueRepresentation.number( values[pos++] );
... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,935 | {
@Override
public Iterator<ValueRepresentation> iterator()
{
return new PrefetchingIterator<ValueRepresentation>()
{
int pos = 0;
@Override
protected ValueRepresentation fetchNextOrN... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,936 | {
@Override
protected Representation underlyingObjectToObject( RelationshipType value )
{
return ValueRepresentation.relationshipType( value );
}
} ); | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,937 | {
@Override
protected Representation underlyingObjectToObject( String value )
{
return ValueRepresentation.string( value );
}
} ); | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,938 | public class ListRepresentation extends Representation
{
protected final Iterable<? extends Representation> content;
public ListRepresentation( final String type, final Iterable<? extends Representation> content )
{
super( type );
this.content = content;
}
public ListRepresentation... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_ListRepresentation.java |
2,939 | public class ListEntityRepresentation extends Representation implements EntityRepresentation
{
private ListRepresentation listRepresentation;
private URI selfUfi;
public ListEntityRepresentation( ListRepresentation listRepresentation, URI selfUfi )
{
super( "list" );
this.listRepresenta... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ListEntityRepresentation.java |
2,940 | @Provider
public final class InputFormatProvider extends InjectableProvider<InputFormat>
{
private final RepresentationFormatRepository repository;
public InputFormatProvider( RepresentationFormatRepository repository )
{
super( InputFormat.class );
this.repository = repository;
}
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_InputFormatProvider.java |
2,941 | public final class IndexedEntityRepresentation extends MappingRepresentation implements ExtensibleRepresentation,
EntityRepresentation
{
private final MappingRepresentation entity;
private final ValueRepresentation selfUri;
@SuppressWarnings( "boxing" )
public IndexedEntityRepresentation( Node ... | false | community_server_src_main_java_org_neo4j_server_rest_repr_IndexedEntityRepresentation.java |
2,942 | public abstract class IndexRepresentation extends MappingRepresentation implements EntityRepresentation
{
private final String name;
private final Map<String, String> type;
public IndexRepresentation( String name, Map<String, String> type )
{
super( RepresentationType.INDEX );
this.name... | false | community_server_src_main_java_org_neo4j_server_rest_repr_IndexRepresentation.java |
2,943 | {
@Override
public Representation apply( String propertyKey )
{
return ValueRepresentation.string( propertyKey );
}
}; | false | community_server_src_main_java_org_neo4j_server_rest_repr_IndexDefinitionRepresentation.java |
2,944 | public class IndexDefinitionRepresentation extends MappingRepresentation
{
private final IndexDefinition indexDefinition;
public IndexDefinitionRepresentation( IndexDefinition indexDefinition )
{
super( RepresentationType.INDEX_DEFINITION );
this.indexDefinition = indexDefinition;
}
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_IndexDefinitionRepresentation.java |
2,945 | public class FullPathRepresentation extends ObjectRepresentation
{
private final Path path;
public FullPathRepresentation( Path path )
{
super( RepresentationType.FULL_PATH );
this.path = path;
}
@Mapping( "start" )
public NodeRepresentation startNode()
{
return new... | false | community_server_src_main_java_org_neo4j_server_rest_repr_FullPathRepresentation.java |
2,946 | public class FullPath {
private final Path path;
public FullPath(Path path) {
this.path = path;
}
public Path getPath() {
return path;
}
} | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_FullPath.java |
2,947 | public abstract class MappingRepresentation extends Representation
{
MappingRepresentation( RepresentationType type )
{
super( type );
}
public MappingRepresentation( String type )
{
super( type );
}
@Override
String serialize( RepresentationFormat format, URI baseUri, ... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_MappingRepresentation.java |
2,948 | public class MappingSerializer extends Serializer
{
final MappingWriter writer;
MappingSerializer( MappingWriter writer, URI baseUri, ExtensionInjector extensions )
{
super( baseUri, extensions );
this.writer = writer;
}
public void putUri( String key, String path )
{
w... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_MappingSerializer.java |
2,949 | public abstract class MappingWriter
{
MappingWriter newMapping( RepresentationType type, String param )
{
return newMapping( type.valueName, param );
}
protected boolean isInteractive()
{
return false;
}
protected abstract MappingWriter newMapping( String type, String key )... | false | community_server-api_src_main_java_org_neo4j_server_rest_repr_MappingWriter.java |
2,950 | public class ObjectToRepresentationConverter
{
public static Representation convert( final Object data )
{
if ( data instanceof Iterable )
{
return getListRepresentation( (Iterable) data );
}
if ( data instanceof Iterator )
{
Iterator iterator = (I... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ObjectToRepresentationConverter.java |
2,951 | public class OutputFormatProviderTest
{
@Test
public void shouldUseXForwardedHostHeaderWhenPresent() throws Exception
{
// given
OutputFormatProvider provider = new OutputFormatProvider( new RepresentationFormatRepository(
mock( AbstractNeoServer.class ) ) );
HttpReq... | false | community_server_src_test_java_org_neo4j_server_rest_repr_OutputFormatProviderTest.java |
2,952 | private class ForwardedProto
{
private final String headerValue;
public ForwardedProto( String headerValue )
{
if ( headerValue != null )
{
this.headerValue = headerValue;
}
else
{
this.headerVal... | false | community_server_src_main_java_org_neo4j_server_rest_repr_OutputFormatProvider.java |
2,953 | private class ForwardedHost
{
private String host;
private int port = -1;
private boolean isValid = false;
public ForwardedHost( String headerValue )
{
if ( headerValue == null )
{
this.isValid = false;
return;
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_OutputFormatProvider.java |
2,954 | @Provider
public final class OutputFormatProvider extends InjectableProvider<OutputFormat>
{
private final RepresentationFormatRepository repository;
public OutputFormatProvider( RepresentationFormatRepository repository )
{
super( OutputFormat.class );
this.repository = repository;
}
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_OutputFormatProvider.java |
2,955 | {
public void write( OutputStream output ) throws IOException, WebApplicationException
{
RepresentationFormat outputStreamFormat = streamingFormat.writeTo( output );
try
{
representation.serialize( outputStreamFormat, ba... | false | community_server_src_main_java_org_neo4j_server_rest_repr_OutputFormat.java |
2,956 | public class OutputFormat
{
private static final String UTF8 = "UTF-8";
private final RepresentationFormat format;
private final ExtensionInjector extensions;
private final URI baseUri;
private RepresentationWriteHandler representationWriteHandler = RepresentationWriteHandler.DO_NOTHING;
publi... | false | community_server_src_main_java_org_neo4j_server_rest_repr_OutputFormat.java |
2,957 | return new FirstItemIterable<>(new IterableWrapper<Representation,Object>(data) {
@Override
protected Representation underlyingObjectToObject(Object value) {
return convert(value);
}
}); | false | community_server_src_main_java_org_neo4j_server_rest_repr_ObjectToRepresentationConverter.java |
2,958 | final FirstItemIterable<Representation> results = new FirstItemIterable<>(new IteratorWrapper<Representation, Object>(data) {
@Override
protected Representation underlyingObjectToObject(Object value) {
if ( value instanceof Iterable )
{
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ObjectToRepresentationConverter.java |
2,959 | private static abstract class PropertyGetter
{
PropertyGetter( Method method )
{
if ( method.getParameterTypes().length != 0 )
{
throw new IllegalStateException( "Property getter method may not have any parameters." );
}
if ( !Repre... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ObjectRepresentation.java |
2,960 | public class MediaTypeNotSupportedException extends WebApplicationException
{
private static final long serialVersionUID = 5159216782240337940L;
public MediaTypeNotSupportedException( Response.Status status, Collection<MediaType> supported,
MediaType... requested )
{
super( createRespon... | false | community_server_src_main_java_org_neo4j_server_rest_repr_MediaTypeNotSupportedException.java |
2,961 | {
@Override
Object get( ObjectRepresentation object )
{
Throwable e;
try
{
return method.invoke( object );
}
catch ( InvocationTargetException ex )
{
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ObjectRepresentation.java |
2,962 | public abstract class ObjectRepresentation extends MappingRepresentation
{
@Target( ElementType.METHOD )
@Retention( RetentionPolicy.RUNTIME )
protected @interface Mapping
{
String value();
}
private final static ConcurrentHashMap<Class<?>, Map<String, PropertyGetter>> serializations = ... | false | community_server_src_main_java_org_neo4j_server_rest_repr_ObjectRepresentation.java |
2,963 | public class NodeRepresentationTest
{
@Test
public void shouldHaveSelfLink() throws BadInputException
{
assertUriMatches( uriPattern( "" ), noderep( 1234 ).selfUri() );
}
@Test
public void shouldHaveAllRelationshipsLink() throws BadInputException
{
assertUriMatches( uriPatte... | false | community_server_src_test_java_org_neo4j_server_rest_repr_NodeRepresentationTest.java |
2,964 | {
@Override
protected Representation underlyingObjectToObject( Node node )
{
return new NodeRepresentation( node );
}
} ); | false | community_server_src_main_java_org_neo4j_server_rest_repr_NodeRepresentation.java |
2,965 | public final class NodeRepresentation extends ObjectRepresentation implements ExtensibleRepresentation,
EntityRepresentation
{
private final Node node;
public NodeRepresentation( Node node )
{
super( RepresentationType.NODE );
this.node = node;
}
@Override
public String... | false | community_server_src_main_java_org_neo4j_server_rest_repr_NodeRepresentation.java |
2,966 | public class NodeIndexRootRepresentation extends MappingRepresentation
{
private IndexManager indexManager;
public NodeIndexRootRepresentation( IndexManager indexManager )
{
super( "node-index" );
this.indexManager = indexManager;
}
@Override
protected void serialize( final Map... | false | community_server_src_main_java_org_neo4j_server_rest_repr_NodeIndexRootRepresentation.java |
2,967 | public class NodeIndexRepresentation extends IndexRepresentation
{
public NodeIndexRepresentation( String name )
{
this( name, Collections.EMPTY_MAP );
}
public NodeIndexRepresentation( String name, Map<String, String> type )
{
super( name, type );
}
public String propertyC... | false | community_server_src_main_java_org_neo4j_server_rest_repr_NodeIndexRepresentation.java |
2,968 | public class NodeAutoIndexRepresentation extends IndexRepresentation {
public NodeAutoIndexRepresentation() {
super("", Collections.EMPTY_MAP);
}
@Override
protected String path()
{
return RestfulGraphDatabase.PATH_AUTO_INDEX.replace("{type}", RestfulGraphDatabase.NODE_AUTO_INDEX_TYPE) + "/";
... | false | community_server_src_main_java_org_neo4j_server_rest_repr_NodeAutoIndexRepresentation.java |
2,969 | public class IndexMapReference
{
private volatile IndexMap indexMap = new IndexMap();
public IndexMap getIndexMapCopy()
{
return indexMap.clone();
}
public IndexProxy getIndexProxy( long indexId )
{
return indexMap.getIndexProxy( indexId );
}
public Iterable<IndexProxy... | false | community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexMapReference.java |
2,970 | {
@Override
public void run() throws IOException
{
outer.force();
}
} ); | false | community_kernel_src_test_java_org_neo4j_kernel_impl_api_index_ContractCheckingIndexProxyTest.java |
2,971 | public class IndexIT extends KernelIntegrationTest
{
int labelId = 5, propertyKey = 8;
@Test
public void addIndexRuleInATransaction() throws Exception
{
// GIVEN
IndexDescriptor expectedRule;
{
SchemaWriteOperations statement = schemaWriteOperationsInNewTransaction()... | false | community_kernel_src_test_java_org_neo4j_kernel_impl_api_index_IndexIT.java |
2,972 | static class PathPrinter implements Traversal.PathDescriptor<Path>
{
private final String nodePropertyKey;
public PathPrinter( String nodePropertyKey )
{
this.nodePropertyKey = nodePropertyKey;
}
@Override
public String nodeRepresentation( Path path,... | false | community_embedded-examples_src_main_java_org_neo4j_examples_orderedpath_OrderedPath.java |
2,973 | public class OrderedPath
{
private static final RelationshipType REL1 = withName( "REL1" ), REL2 = withName( "REL2" ),
REL3 = withName( "REL3" );
static final String DB_PATH = "target/neo4j-orderedpath-db";
GraphDatabaseService db;
public OrderedPath( GraphDatabaseService db )
{
... | false | community_embedded-examples_src_main_java_org_neo4j_examples_orderedpath_OrderedPath.java |
2,974 | {
@Override
public Evaluation evaluate( Path path )
{
boolean endNodeIsTarget = path.endNode().equals( target );
return Evaluation.of( endNodeIsTarget, !endNodeIsTarget );
}
} ); | false | community_embedded-examples_src_test_java_org_neo4j_examples_UniquenessOfPathsDocTest.java |
2,975 | public class UniquenessOfPathsDocTest extends ImpermanentGraphJavaDocTestBase
{
/**
* Uniqueness of Paths in traversals.
*
* This example is demonstrating the use of node uniqueness.
* Below an imaginary domain graph with Principals
* that own pets that are descendant to other pets.
*... | false | community_embedded-examples_src_test_java_org_neo4j_examples_UniquenessOfPathsDocTest.java |
2,976 | public class TraversalExample
{
private GraphDatabaseService db;
private TraversalDescription friendsTraversal;
public TraversalExample( GraphDatabaseService db )
{
this.db = db;
// START SNIPPET: basetraverser
friendsTraversal = db.traversalDescription()
.depthF... | false | community_embedded-examples_src_main_java_org_neo4j_examples_TraversalExample.java |
2,977 | public class TraversalDocTest extends ImpermanentGraphJavaDocTestBase
{
/**
* A
* http://components.neo4j.org/neo4j/{neo4j-version}/apidocs/org/neo4j/graphdb/traversal/TraversalDescription.html[traversal description] is built using a
* fluent interface and such a description can then spawn
* htt... | false | community_embedded-examples_src_test_java_org_neo4j_examples_TraversalDocTest.java |
2,978 | public class StartWithConfigurationDocTest
{
@Test
public void loadFromFile()
{
String pathToConfig = "src/test/resources/";
// START SNIPPET: startDbWithConfig
GraphDatabaseService graphDb = new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder( storeDir )
.... | false | community_embedded-examples_src_test_java_org_neo4j_examples_StartWithConfigurationDocTest.java |
2,979 | public class RolesDocTest extends ImpermanentGraphJavaDocTestBase
{
private static final String NAME = "name";
public enum RoleRels implements RelationshipType
{
ROOT,
PART_OF,
MEMBER_OF
}
/**
* This is an example showing a hierarchy of
* roles.
* What's inte... | false | community_embedded-examples_src_test_java_org_neo4j_examples_RolesDocTest.java |
2,980 | public class Roles extends ImpermanentGraphJavaDocTestBase
{
private static final String NAME = "name";
public enum RoleRels implements RelationshipType
{
ROOT,
PART_OF,
MEMBER_OF
}
/**
* This is an example showing a hierarchy of
* roles.
* What's interesting... | false | community_embedded-examples_src_test_java_org_neo4j_examples_Roles.java |
2,981 | public class ReadOnlyDocTest
{
protected GraphDatabaseService graphDb;
/**
* Create read only database.
*/
@Before
public void prepareReadOnlyDatabase() throws IOException
{
File dir = new File( "target/read-only-db/location" );
if ( dir.exists() )
{
Fi... | false | community_embedded-examples_src_test_java_org_neo4j_examples_ReadOnlyDocTest.java |
2,982 | {
@Override
public Double getCost( final Node node, final Node goal )
{
double dx = (Double) node.getProperty( "x" ) - (Double) goal.getProperty( "x" );
double dy = (Double) node.getProperty( "y" ) - (Double) goal.getProperty( "y" );
... | false | community_embedded-examples_src_test_java_org_neo4j_examples_PathFindingDocTest.java |
2,983 | public class PathFindingDocTest
{
private static GraphDatabaseService graphDb;
private Transaction tx;
private static enum ExampleTypes implements RelationshipType
{
MY_TYPE
}
@BeforeClass
public static void startDb()
{
String storeDir = TargetDirectory.forTest( PathFin... | false | community_embedded-examples_src_test_java_org_neo4j_examples_PathFindingDocTest.java |
2,984 | {
@Override
public void run()
{
graphDb.shutdown();
}
} ); | false | community_embedded-examples_src_main_java_org_neo4j_examples_NewMatrix.java |
2,985 | public class NewMatrix
{
public enum RelTypes implements RelationshipType
{
NEO_NODE,
KNOWS,
CODED_BY
}
private static final String MATRIX_DB = "target/matrix-new-db";
private GraphDatabaseService graphDb;
private long matrixNodeId;
public static void main( String[]... | false | community_embedded-examples_src_main_java_org_neo4j_examples_NewMatrix.java |
2,986 | {
@Override
public void run()
{
shutdown();
}
} ); | false | community_embedded-examples_src_main_java_org_neo4j_examples_Neo4jShell.java |
2,987 | public class Neo4jShell
{
private static final String DB_PATH = "neo4j-store";
private static final String USERNAME_KEY = "username";
private static GraphDatabaseAPI graphDb;
private static enum RelTypes implements RelationshipType
{
USERS_REFERENCE, USER, KNOWS,
}
public static vo... | false | community_embedded-examples_src_main_java_org_neo4j_examples_Neo4jShell.java |
2,988 | public class Neo4jBasicDocTest
{
protected GraphDatabaseService graphDb;
/**
* Create temporary database for each unit test.
*/
// START SNIPPET: beforeTest
@Before
public void prepareTestDatabase()
{
graphDb = new TestGraphDatabaseFactory().newImpermanentDatabase();
}
... | false | community_embedded-examples_src_test_java_org_neo4j_examples_Neo4jBasicDocTest.java |
2,989 | public class MatrixDocTest
{
private static JavaDocsGenerator gen;
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
gen = new JavaDocsGenerator( "matrix-traversal-java", "dev" );
}
@Test
public void matrix() throws Exception
{
Matrix matrix = new Ma... | false | community_embedded-examples_src_test_java_org_neo4j_examples_MatrixDocTest.java |
2,990 | {
@Override
public void run()
{
graphDb.shutdown();
}
} ); | false | community_embedded-examples_src_main_java_org_neo4j_examples_Matrix.java |
2,991 | {
@Override
public boolean isReturnableNode(
final TraversalPosition currentPos )
{
return !currentPos.isStartNode()
&& currentPos.lastRelationshipTraversed()
.isType( RelTypes.CODED_BY );
}
... | false | community_embedded-examples_src_main_java_org_neo4j_examples_Matrix.java |
2,992 | {
@Override
public Evaluation evaluate( final Path path )
{
if ( path.length() == 0 )
{
return Evaluation.EXCLUDE_AND_CONTINUE;
}
... | false | community_embedded-examples_src_main_java_org_neo4j_examples_orderedpath_OrderedPath.java |
2,993 | public class OrderedPathDocTest
{
private static OrderedPath orderedPath;
private static JavaDocsGenerator gen;
private static GraphDatabaseService db;
@BeforeClass
public static void setUp() throws IOException
{
File dir = new File( OrderedPath.DB_PATH );
if ( dir.exists() )
... | false | community_embedded-examples_src_test_java_org_neo4j_examples_orderedpath_OrderedPathDocTest.java |
2,994 | public class JmxDocTest
{
@Test
public void readJmxProperties()
{
GraphDatabaseService graphDbService = new TestGraphDatabaseFactory().newImpermanentDatabase();
try
{
Date startTime = getStartTimeFromManagementBean( graphDbService );
Date now = new Date();
... | false | community_embedded-examples_src_test_java_org_neo4j_examples_JmxDocTest.java |
2,995 | public class AbstractPluginTestBase extends AbstractRestFunctionalTestBase
{
protected static FunctionalTestHelper functionalTestHelper;
protected static GraphDbHelper helper;
@BeforeClass
public static void setupServer() throws IOException
{
functionalTestHelper = new FunctionalTestHelper... | false | community_server-examples_src_test_java_org_neo4j_examples_server_AbstractPluginTestBase.java |
2,996 | public class PersonRepository
{
private final GraphDatabaseService graphDb;
private final Index<Node> index;
private final Node personRefNode;
public PersonRepository( GraphDatabaseService graphDb, Index<Node> index )
{
this.graphDb = graphDb;
this.index = index;
personRefN... | false | community_embedded-examples_src_main_java_org_neo4j_examples_socnet_PersonRepository.java |
2,997 | private final class RankedPerson
{
final Person person;
final int rank;
private RankedPerson( Person person, int rank )
{
this.person = person;
this.rank = rank;
}
public Person getPerson()
{
return person;
}... | false | community_embedded-examples_src_main_java_org_neo4j_examples_socnet_Person.java |
2,998 | private class RankedComparer implements Comparator<RankedPerson>
{
@Override
public int compare( RankedPerson a, RankedPerson b )
{
return b.getRank() - a.getRank();
}
} | false | community_embedded-examples_src_main_java_org_neo4j_examples_socnet_Person.java |
2,999 | {
@Override
protected Person underlyingObjectToObject( Node node )
{
return new Person( node );
}
}; | false | community_embedded-examples_src_main_java_org_neo4j_examples_socnet_Person.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.