public SetValues<Conjunction<Graph>> set( final Name propertyName ) {
return new SetValues<Conjunction<Graph>>() {
public SetValuesTo<Conjunction<Graph>> on( final Location location ) {
return new SetValuesTo<Conjunction<Graph>>() {
public Conjunction<Graph> to( Node value ) {
Reference ref = (Reference)convertReferenceValue(value);
Property property = getContext().getPropertyFactory().create(propertyName, ref);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
public Conjunction<Graph> to( Location value ) {
Reference ref = (Reference)convertReferenceValue(value);
Property property = getContext().getPropertyFactory().create(propertyName, ref);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
protected Conjunction<Graph> toValue( Object value ) {
Property property = getContext().getPropertyFactory().create(propertyName, value);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
public Conjunction<Graph> to( String value ) {
return toValue(value);
}
public Conjunction<Graph> to( int value ) {
return toValue(Integer.valueOf(value));
}
public Conjunction<Graph> to( long value ) {
return toValue(Long.valueOf(value));
}
public Conjunction<Graph> to( boolean value ) {
return toValue(Boolean.valueOf(value));
}
public Conjunction<Graph> to( float value ) {
return toValue(Float.valueOf(value));
}
public Conjunction<Graph> to( double value ) {
return toValue(Double.valueOf(value));
}
public Conjunction<Graph> to( BigDecimal value ) {
return toValue(value);
}
public Conjunction<Graph> to( Calendar value ) {
return toValue(value);
}
public Conjunction<Graph> to( Date value ) {
return toValue(value);
}
public Conjunction<Graph> to( DateTime value ) {
return toValue(value);
}
public Conjunction<Graph> to( Name value ) {
return toValue(value);
}
public Conjunction<Graph> to( Path value ) {
return toValue(value);
}
public Conjunction<Graph> to( Reference value ) {
return toValue(value);
}
public Conjunction<Graph> to( URI value ) {
return toValue(value);
}
public Conjunction<Graph> to( UUID value ) {
return toValue(value);
}
public Conjunction<Graph> to( Binary value ) {
return toValue(value);
}
public Conjunction<Graph> to( byte[] value ) {
return toValue(value);
}
public Conjunction<Graph> to( InputStream stream,
long approximateLength ) {
Binary value = getContext().getValueFactories().getBinaryFactory().create(stream, approximateLength);
return toValue(value);
}
public Conjunction<Graph> to( Reader reader,
long approximateLength ) {
Binary value = getContext().getValueFactories().getBinaryFactory().create(reader, approximateLength);
return toValue(value);
}
public Conjunction<Graph> to( Object value ) {
value = convertReferenceValue(value);
Property property = getContext().getPropertyFactory().create(propertyName, value);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
public Conjunction<Graph> to( Object firstValue,
Object... otherValues ) {
firstValue = convertReferenceValue(firstValue);
for (int i = 0, len = otherValues.length; i != len; ++i) {
otherValues[i] = convertReferenceValue(otherValues[i]);
}
Property property = getContext().getPropertyFactory().create(propertyName, firstValue, otherValues);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
public Conjunction<Graph> to( Object[] values ) {
for (int i = 0, len = values.length; i != len; ++i) {
values[i] = convertReferenceValue(values[i]);
}
Property property = getContext().getPropertyFactory().create(propertyName, values);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
public Conjunction<Graph> to( Iterable<?> values ) {
List<Object> valueList = new LinkedList<Object>();
for (Object value : values) {
value = convertReferenceValue(value);
valueList.add(value);
}
Property property = getContext().getPropertyFactory().create(propertyName, valueList);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
public Conjunction<Graph> to( Iterator<?> values ) {
List<Object> valueList = new LinkedList<Object>();
while (values.hasNext()) {
Object value = values.next();
valueList.add(value);
}
Property property = getContext().getPropertyFactory().create(propertyName, valueList);
requests.setProperty(location, getCurrentWorkspaceName(), property);
return nextGraph;
}
};
}
public SetValuesTo<Conjunction<Graph>> on( String path ) {
return on(Location.create(createPath(path)));
}
public SetValuesTo<Conjunction<Graph>> on( Path path ) {
return on(Location.create(path));
}
public SetValuesTo<Conjunction<Graph>> on( Property idProperty ) {
return on(Location.create(idProperty));
}
public SetValuesTo<Conjunction<Graph>> on( Property firstIdProperty,
Property... additionalIdProperties ) {
return on(Location.create(firstIdProperty, additionalIdProperties));
}
public SetValuesTo<Conjunction<Graph>> on( Iterable<Property> idProperties ) {
return on(Location.create(idProperties));
}
public SetValuesTo<Conjunction<Graph>> on( UUID uuid ) {
return on(Location.create(uuid));
}
public On<Conjunction<Graph>> to( Node node ) {
Reference value = (Reference)convertReferenceValue(node);
return set(getContext().getPropertyFactory().create(propertyName, value));
}
public On<Conjunction<Graph>> to( Location location ) {
Reference value = (Reference)convertReferenceValue(location);
return set(getContext().getPropertyFactory().create(propertyName, value));
}
protected On<Conjunction<Graph>> toValue( Object value ) {
return set(getContext().getPropertyFactory().create(propertyName, value));