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

com.xlrit.gears.base.collection.CollectionRefFromRelation Maven / Gradle / Ivy

There is a newer version: 1.17.5
Show newest version
package com.xlrit.gears.base.collection;

import java.util.List;

import com.xlrit.gears.base.meta.Relation;

public class CollectionRefFromRelation implements CollectionRef {
    private final O owner;
    private final Relation.ToMany relation;

    public CollectionRefFromRelation(O owner, Relation.ToMany relation) {
        this.owner = owner;
        this.relation = relation;
    }

    @Override
    public Class getElementType() {
        return relation.getElementType();
    }

    public List getElements() {
        return relation.get(owner);
    }

    public void updateElements(List newElements) {
        relation.set(owner, newElements);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy