@Override protected Representation dispatchStringProperty( String property, Void param ) { return string( property ); }
@Override @SuppressWarnings( "boxing" ) Representation convert( Object obj ) { return ValueRepresentation.bool( (Boolean) obj ); } };
@Override protected Representation dispatchFloatProperty( float property, String param ) { return number( property ); }
return ValueRepresentation.ofNull(); return ValueRepresentation.number( ( (Number) result ).doubleValue() ); return ValueRepresentation.number( ( (Long) result ).longValue() ); return ValueRepresentation.number( ( (Integer) result ).intValue() ); return ValueRepresentation.bool( ( (Boolean) result ).booleanValue() ); return ValueRepresentation.string( result.toString() );
@SuppressWarnings("unchecked") public static Representation getObjectRepresentation(Object value) { Representation rep = null; Class<?> valueClass = value.getClass(); if (Map.class.isAssignableFrom(valueClass)) { rep = new RecursiveMappingRepresentation(Representation.MAP, (Map<String, Object>) value); } else if (valueClass.equals(String.class)) { rep = ValueRepresentation.string((String) value); } else if (valueClass.isArray()) { rep = getArrayRepresentation(value); } else if (Iterable.class.isAssignableFrom(valueClass)) { rep = getIterableRepresentation((Iterable<?>) value); } else if (valueClass.equals(Boolean.class)) { rep = ValueRepresentation.bool((Boolean) value); } else if (valueClass.equals(String.class)) { rep = ValueRepresentation.string((String) value); } else if (Number.class.isAssignableFrom(valueClass)) { rep = getNumberRepresentation((Number) value, valueClass); } else if (Node.class.isAssignableFrom(valueClass)) { rep = new NodeRepresentation((Node) value); } else { throw new IllegalArgumentException( "Encountered " + valueClass + ". This class is currently not supported."); } return rep; }
@Override protected Representation dispatchIntegerProperty( int property, Void param ) { return new ValueRepresentation( RepresentationType.INTEGER, property ); }
@Override protected Representation underlyingObjectToObject( RelationshipType value ) { return ValueRepresentation.relationshipType( value ); } } );
@Override protected Representation underlyingObjectToObject( TemporalAmount value ) { return ValueRepresentation.temporalAmount( value ); } } );
@Override protected Representation underlyingObjectToObject( Temporal value ) { return ValueRepresentation.temporal( value ); } } );
@Override protected Representation underlyingObjectToObject( Point value ) { return ValueRepresentation.point( value ); } } );
return ValueRepresentation.ofNull(); return ValueRepresentation.number( ( (Number) result ).doubleValue() ); return ValueRepresentation.number( ( (Long) result ).longValue() ); return ValueRepresentation.number( ( (Integer) result ).intValue() ); return ValueRepresentation.bool( ( (Boolean) result ).booleanValue() ); return ValueRepresentation.string( result.toString() );
@Override protected Representation dispatchPointProperty( Point point, Void param ) { return new ValueRepresentation( RepresentationType.POINT, point ); }
@Mapping( "type" ) public ValueRepresentation getType() { return ValueRepresentation.relationshipType( rel.getType() ); }
@Override protected Representation dispatchTemporalAmountArrayProperty( TemporalAmount[] array, String param ) { ArrayList<Representation> values = new ArrayList<>(); for ( TemporalAmount t : array ) { values.add( temporalAmount( t ) ); } return new ListRepresentation( "", values ); }
@Override protected Representation dispatchTemporalArrayProperty( Temporal[] array, String param ) { ArrayList<Representation> values = new ArrayList<>(); for ( Temporal t : array ) { values.add( temporal( t ) ); } return new ListRepresentation( "", values ); }
@Override protected Representation dispatchPointArrayProperty( Point[] array, String param ) { ArrayList<Representation> values = new ArrayList<>(); for ( Point p : array ) { values.add( point( p ) ); } return new ListRepresentation( "", values ); }
@Override protected Representation underlyingObjectToObject( String directionString ) { return ValueRepresentation.string(directionString); } } );
@Override protected Representation dispatchBooleanProperty( boolean property, Void param ) { return bool( property ); }
@Override @SuppressWarnings( "boxing" ) Representation convert( Object obj ) { return ValueRepresentation.number( (Character) obj ); } };
@Override protected Representation dispatchTemporalProperty( Temporal temporal, Void param ) { return new ValueRepresentation( RepresentationType.TEMPORAL, temporal ); }