Class ModelFactory<H,M>
- java.lang.Object
-
- com.atlassian.confluence.api.impl.service.content.factory.ModelFactory<H,M>
-
- Type Parameters:
H
-M
-
- Direct Known Subclasses:
ContentFactory
,ContentRestrictionFactory
,ContributorsFactory
,DefaultContentTemplateFactory
,GroupFactory
,LabelFactory
,PersonFactory
,RelatableFactory
,RelationInstanceFactory
,SpaceFactory
public abstract class ModelFactory<H,M> extends Object
An abstract factory for producing API model objects from our hibernate business objects.Uses expansions to only include requested properties in the model objects produced. The expansions use property names of the API model objects.
-
-
Constructor Summary
Constructors Constructor Description ModelFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.google.common.base.Function<H,M>
asFunction(Expansions expansions)
Deprecated.since 5.10 use buildFrom or asListFunction insteadabstract M
buildFrom(H hibernateObject, Expansions expansions)
<HC extends H>
Iterable<M>buildFrom(Iterable<HC> hibernateObjects, Expansions expansions)
-
-
-
Method Detail
-
buildFrom
public abstract M buildFrom(H hibernateObject, Expansions expansions)
-
buildFrom
public <HC extends H> Iterable<M> buildFrom(Iterable<HC> hibernateObjects, Expansions expansions)
-
asFunction
@Deprecated public final com.google.common.base.Function<H,M> asFunction(Expansions expansions)
Deprecated.since 5.10 use buildFrom or asListFunction insteadProduces a Function that can be used to convert a list of hibernate objects to a list of model objects that this factory produces- Parameters:
expansions
- - the expansions to apply when converting the hibernate object, be careful these will be expanded on each and every object- Returns:
- a Function wrapping this factory
-
-