public AdapterType adaptTo()

in src/main/java/org/apache/sling/mongodb/impl/MongoDBResource.java [120:130]


    public <AdapterType> AdapterType adaptTo(final Class<AdapterType> type) {
        if ( type == ValueMap.class || type == Map.class ) {
            this.dbObject = this.provider.getUpdatedDBObject(this.resourcePath, this.dbObject);
            return (AdapterType) new DeepReadValueMapDecorator(this, new ReadableValueMap(this.dbObject));
        } else if ( type == ModifiableValueMap.class ) {
            this.dbObject = this.provider.getUpdatedDBObject(this.resourcePath, this.dbObject);
            return (AdapterType) new DeepReadModifiableValueMapDecorator(this, new ChangeableValueMap(this));
        }

        return super.adaptTo(type);
    }