/* @see org.mindswap.owl.OWLProvider#castList(java.util.List, java.lang.Class) */ public <T extends OWLIndividual> OWLIndividualList<T> castList( final List<? extends OWLIndividual> list, final Class<T> castTarget) { assert (list != null && castTarget != null) : "Illegal: list and/or cast target parameter was null."; final OWLIndividualList<T> result = createIndividualList(); T element; for (final OWLIndividual individual : list) { element = individual.castTo(castTarget); result.add(element); } return result; }
/** * @param <T> * @param prop * @param result * @return */ protected <T extends OWLEntity> T getPropertyAs( final OWLObjectProperty prop, final Class<T> result) { final OWLIndividual value = individual.getProperty(prop); return (value == null) ? null : value.castTo(result); }
/** * Simply query the ontology for contactInformation property and cast the result to an Actor * object. */ public OwnerEntity getOwner() { final OWLIndividual ind = getServiceParameterValue(FLAServiceOnt.ownedBy); return (ind == null) ? null : ind.castTo(OwnerEntity.class); }
/* (non-Javadoc) * @see org.mindswap.owls.process.Parameter#getProfile() */ public Profile getProfile() { OWLIndividual ind = getIncomingProperty(OWLS.Profile.hasInput); return (ind == null) ? null : (Profile) ind.castTo(Profile.class); }
/* (non-Javadoc) * @see org.mindswap.owls.process.Parameter#getProcess() */ public Process getProcess() { OWLIndividual ind = getIncomingProperty(OWLS.Process.hasParameter); return (ind == null) ? null : (Process) ind.castTo(Process.class); }