com.atlassian.confluence.api.impl.service.content.factory
Class ModelFactory<H,M>

java.lang.Object
  extended by com.atlassian.confluence.api.impl.service.content.factory.ModelFactory<H,M>
Type Parameters:
H -
M -
Direct Known Subclasses:
AttachmentFactory, ContentFactory, SpaceFactory

public abstract class ModelFactory<H,M>
extends java.lang.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
ModelFactory()
           
 
Method Summary
 com.google.common.base.Function<H,M> asFunction(Expansions expansions)
          produces a Function that can be used to convert a list of hibernate objects to a list of model objects that this factory produces
abstract  M buildFrom(H hibernateObject, Expansions expansions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelFactory

public ModelFactory()
Method Detail

buildFrom

public abstract M buildFrom(H hibernateObject,
                            Expansions expansions)

asFunction

public final com.google.common.base.Function<H,M> asFunction(Expansions expansions)
produces 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


Copyright © 2003-2014 Atlassian. All Rights Reserved.