All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.buschmais.xo.impl.proxy.collection.AbstractCollectionProxy Maven / Gradle / Ivy

The newest version!
package com.buschmais.xo.impl.proxy.collection;

import java.util.AbstractCollection;
import java.util.Collection;
import java.util.Iterator;

import com.buschmais.xo.api.metadata.method.AbstractRelationPropertyMethodMetadata;
import com.buschmais.xo.impl.SessionContext;

public abstract class AbstractCollectionProxy>
    extends AbstractCollection implements Collection {

    private final SessionContext sessionContext;
    private final Entity entity;
    private final PropertyMetadata metadata;

    public AbstractCollectionProxy(SessionContext sessionContext, Entity entity, PropertyMetadata metadata) {
        this.sessionContext = sessionContext;
        this.entity = entity;
        this.metadata = metadata;
    }

    public SessionContext getSessionContext() {
        return sessionContext;
    }

    public Entity getEntity() {
        return entity;
    }

    public PropertyMetadata getMetadata() {
        return metadata;
    }

    public int size() {
        int size = 0;
        for (Iterator iterator = iterator(); iterator.hasNext(); ) {
            iterator.next();
            size++;
        }
        return size;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy