@Test public void fromString_Integer() throws BindingSetConversionException { final String bindingSetString = "5<<~>>http: final BindingSetConverter<String> converter = new BindingSetStringConverter(); final BindingSet bindingSet = converter.convert(bindingSetString, new VariableOrder("x")); final MapBindingSet expected = new MapBindingSet(); expected.addBinding("x", VF.createLiteral((BigInteger.valueOf(5)))); assertEquals(expected, bindingSet); }
@Override public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); }
BindingSetStringConverter implements BindingSetConverter<String> { @Override public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); } }
BindingSetStringConverter implements BindingSetConverter<String> { @Override public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); }  }
BindingSetStringConverter implements BindingSetConverter<String> { @Override public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); }  @Override String convert(final BindingSet bindingSet, final VariableOrder varOrder); @Override BindingSet convert(final String bindingSetString, final VariableOrder varOrder); }
BindingSetStringConverter implements BindingSetConverter<String> { @Override public String convert(final BindingSet bindingSet, final VariableOrder varOrder) { requireNonNull(bindingSet); requireNonNull(varOrder); final List<String> bindingStrings = new ArrayList<>(); for(final String varName : varOrder) { if(bindingSet.hasBinding(varName)) { final Value value = bindingSet.getBinding(varName).getValue(); final RyaType ryaValue = RdfToRyaConversions.convertValue(value); final String bindingString = ryaValue.getData() + TYPE_DELIM + ryaValue.getDataType(); bindingStrings.add(bindingString); } else { bindingStrings.add(NULL_VALUE_STRING); } } return Joiner.on(BINDING_DELIM).join(bindingStrings); }  @Override String convert(final BindingSet bindingSet, final VariableOrder varOrder); @Override BindingSet convert(final String bindingSetString, final VariableOrder varOrder); static final String BINDING_DELIM; static final String TYPE_DELIM; static final String NULL_VALUE_STRING; }