/** * Loads a single Object that is assumed to be of the given concept. */ public <T> T getObject(Class<T> concept, Resource resource) throws RepositoryException, QueryEvaluationException { return getObjects(concept, resource).singleResult(); }
public float asFloat() throws OpenRDFException { return asResult(Float.class).singleResult().floatValue(); }
public char asChar() throws OpenRDFException { return asResult(Character.class).singleResult().charValue(); }
public long asLong() throws OpenRDFException { return asResult(Long.class).singleResult().longValue(); }
public char asChar() throws OpenRDFException { return asResult(Character.class).singleResult().charValue(); }
public short asShort() throws OpenRDFException { return asResult(Short.class).singleResult().shortValue(); }
public float asFloat() throws OpenRDFException { return asResult(Float.class).singleResult().floatValue(); }
public byte asByte() throws OpenRDFException { return asResult(Byte.class).singleResult().byteValue(); }
public int asInt() throws OpenRDFException { return asResult(Integer.class).singleResult().intValue(); }
/** * Loads a single Object that is assumed to be of the given concept. */ public <T> T getObject(Class<T> concept, Resource resource) throws RepositoryException, QueryEvaluationException { RDFObject cached = cached(resource); if (concept.isInstance(cached)) return concept.cast(cached); return getObjects(concept, resource).singleResult(); }
public CharSequence asCharSequence() throws OpenRDFException { Result<CharSequence> result = asResult(CharSequence.class); if (result.hasNext()) return result.singleResult(); return null; }
public <T> T as(Class<T> of) throws OpenRDFException { Result<T> result = asResult(of); if (result.hasNext()) return result.singleResult(); return null; }
public String asString() throws OpenRDFException { Result<String> result = asResult(String.class); if (result.hasNext()) return result.singleResult(); return null; }
public byte[] asByteArray() throws OpenRDFException { Result<byte[]> result = asResult(byte[].class); if (result.hasNext()) return result.singleResult(); return null; }
public String asString() throws OpenRDFException { Result<String> result = asResult(String.class); if (result.hasNext()) return result.singleResult(); return null; }
public CharSequence asCharSequence() throws OpenRDFException { Result<CharSequence> result = asResult(CharSequence.class); if (result.hasNext()) return result.singleResult(); return null; }
public byte[] asByteArray() throws OpenRDFException { Result<byte[]> result = asResult(byte[].class); if (result.hasNext()) return result.singleResult(); return null; }
public <T> T as(Class<T> of) throws OpenRDFException { Result<T> result = asResult(of); if (result.hasNext()) return result.singleResult(); return null; }
public boolean asBoolean() throws OpenRDFException { if (query.isBooleanQuery()) return prepareBooleanQuery().evaluate(); return asResult(Boolean.class).singleResult().booleanValue(); }
public boolean asBoolean() throws OpenRDFException { if (query.isBooleanQuery()) return prepareBooleanQuery().evaluate(); return asResult(Boolean.class).singleResult().booleanValue(); }