@Override public Object unadapt(Class target) { if (target.equals(FeatureCollectionType.class)) { return adaptee; } else if (target.equals(net.opengis.wfs20.FeatureCollectionType.class)) { FeatureCollectionType source = (FeatureCollectionType) adaptee; net.opengis.wfs20.FeatureCollectionType result = Wfs20Factory.eINSTANCE.createFeatureCollectionType(); result.getMember().addAll(source.getFeature()); result.setNumberReturned(source.getNumberOfFeatures()); result.setLockId(source.getLockId()); result.setTimeStamp(source.getTimeStamp()); return result; } else { throw new WFSException( "Cannot transform " + adaptee + " to the specified target class " + target); } } }