/** * We don't have Node, Relationship, Property available down here - and don't strictly want to, * we want the procedures to be independent of which Graph API is being used (and we don't want * them to get tangled up with kernel code). So, we only register the "core" type system here, * scalars and collection types. Node, Relationship, Path and any other future graph types should * be registered from the outside in the same place APIs to work with those types is registered. */ private void registerScalarsAndCollections() { registerType( String.class, TO_STRING ); registerType( long.class, TO_INTEGER ); registerType( Long.class, TO_INTEGER ); registerType( double.class, TO_FLOAT ); registerType( Double.class, TO_FLOAT ); registerType( Number.class, TO_NUMBER ); registerType( boolean.class, TO_BOOLEAN ); registerType( Boolean.class, TO_BOOLEAN ); registerType( Map.class, TO_MAP ); registerType( List.class, TO_LIST ); registerType( Object.class, TO_ANY ); registerType( byte[].class, TO_BYTEARRAY ); registerType( ZonedDateTime.class, new DefaultValueConverter( NTDateTime, ZonedDateTime.class ) ); registerType( LocalDateTime.class, new DefaultValueConverter( NTLocalDateTime, LocalDateTime.class ) ); registerType( LocalDate.class, new DefaultValueConverter( NTDate, LocalDate.class ) ); registerType( OffsetTime.class, new DefaultValueConverter( NTTime, OffsetTime.class ) ); registerType( LocalTime.class, new DefaultValueConverter( NTLocalTime, LocalTime.class ) ); registerType( TemporalAmount.class, new DefaultValueConverter( NTDuration, TemporalAmount.class ) ); }
private static DefaultValueConverter toList( DefaultValueConverter inner, Type type ) { return new DefaultValueConverter( NTList( inner.type() ), List.class, new ListConverter( type, inner.type() ) ); }
/** * Registers a type and its mapping to Neo4jTypes * * @param javaClass * the class of the native type * @param type * the mapping to Neo4jTypes */ public void registerType( Class<?> javaClass, Neo4jTypes.AnyType type ) { typeMappers.registerType( javaClass, new TypeMappers.DefaultValueConverter( type, javaClass ) ); }
/** * We don't have Node, Relationship, Property available down here - and don't strictly want to, * we want the procedures to be independent of which Graph API is being used (and we don't want * them to get tangled up with kernel code). So, we only register the "core" type system here, * scalars and collection types. Node, Relationship, Path and any other future graph types should * be registered from the outside in the same place APIs to work with those types is registered. */ private void registerScalarsAndCollections() { registerType( String.class, TO_STRING ); registerType( long.class, TO_INTEGER ); registerType( Long.class, TO_INTEGER ); registerType( double.class, TO_FLOAT ); registerType( Double.class, TO_FLOAT ); registerType( Number.class, TO_NUMBER ); registerType( boolean.class, TO_BOOLEAN ); registerType( Boolean.class, TO_BOOLEAN ); registerType( Map.class, TO_MAP ); registerType( List.class, TO_LIST ); registerType( Object.class, TO_ANY ); registerType( byte[].class, TO_BYTEARRAY ); registerType( ZonedDateTime.class, new DefaultValueConverter( NTDateTime, ZonedDateTime.class ) ); registerType( LocalDateTime.class, new DefaultValueConverter( NTLocalDateTime, LocalDateTime.class ) ); registerType( LocalDate.class, new DefaultValueConverter( NTDate, LocalDate.class ) ); registerType( OffsetTime.class, new DefaultValueConverter( NTTime, OffsetTime.class ) ); registerType( LocalTime.class, new DefaultValueConverter( NTLocalTime, LocalTime.class ) ); registerType( TemporalAmount.class, new DefaultValueConverter( NTDuration, TemporalAmount.class ) ); }
/** * Registers a type and its mapping to Neo4jTypes * * @param javaClass * the class of the native type * @param type * the mapping to Neo4jTypes */ public void registerType( Class<?> javaClass, Neo4jTypes.AnyType type ) { typeMappers.registerType( javaClass, new TypeMappers.DefaultValueConverter( type, javaClass ) ); }
private static DefaultValueConverter toList( DefaultValueConverter inner, Type type ) { return new DefaultValueConverter( NTList( inner.type() ), List.class, new ListConverter( type, inner.type() ) ); }