Class EntityFactory<E extends IEntity,​S extends IEntity,​B extends IEntityBuilder>

  • Type Parameters:
    E - The type of the entity produced by this factory, i.e. the facade.
    S - The super type of the entity, i.e. the generated super class.
    B - The builder type of the entity.
    All Implemented Interfaces:
    IEntityFactory<E,​S,​B>

    public abstract class EntityFactory<E extends IEntity,​S extends IEntity,​B extends IEntityBuilder>
    extends Object
    implements IEntityFactory<E,​S,​B>
    A factory for an enclosing entity type.
    Author:
    Bruce Skingle
    • Constructor Detail

      • EntityFactory

        public EntityFactory()
    • Method Detail

      • newMutableList

        public List<E> newMutableList​(org.symphonyoss.s2.common.dom.json.JsonArray<?> jsonArray,
                                      IModelRegistry modelRegistry)
        Description copied from interface: IEntityFactory
        Return a list of new entity instances created from the given JSON array.
        Specified by:
        newMutableList in interface IEntityFactory<E extends IEntity,​S extends IEntity,​B extends IEntityBuilder>
        Parameters:
        jsonArray - An array of the JSON serialized form of the required entity.
        modelRegistry - A model registry to use to deserialize any nested objects.
        Returns:
        A list of instances of the entity represented by the given serialized form.
      • newMutableSet

        public Set<E> newMutableSet​(org.symphonyoss.s2.common.dom.json.JsonArray<?> jsonArray,
                                    IModelRegistry modelRegistry)
        Description copied from interface: IEntityFactory
        Return a set of new entity instances created from the given JSON array.
        Specified by:
        newMutableSet in interface IEntityFactory<E extends IEntity,​S extends IEntity,​B extends IEntityBuilder>
        Parameters:
        jsonArray - An array of the JSON serialized form of the required entity.
        modelRegistry - A model registry to use to deserialize any nested objects.
        Returns:
        A set of instances of the entity represented by the given serialized form.
      • newImmutableList

        public com.google.common.collect.ImmutableList<E> newImmutableList​(org.symphonyoss.s2.common.dom.json.JsonArray<?> jsonArray,
                                                                           IModelRegistry modelRegistry)
        Description copied from interface: IEntityFactory
        Return a list of new entity instances created from the given JSON array.
        Specified by:
        newImmutableList in interface IEntityFactory<E extends IEntity,​S extends IEntity,​B extends IEntityBuilder>
        Parameters:
        jsonArray - An array of the JSON serialized form of the required entity.
        modelRegistry - A model registry to use to deserialize any nested objects.
        Returns:
        A list of instances of the entity represented by the given serialized form.
      • newImmutableSet

        public com.google.common.collect.ImmutableSet<E> newImmutableSet​(org.symphonyoss.s2.common.dom.json.JsonArray<?> jsonArray,
                                                                         IModelRegistry modelRegistry)
        Description copied from interface: IEntityFactory
        Return a set of new entity instances created from the given JSON array.
        Specified by:
        newImmutableSet in interface IEntityFactory<E extends IEntity,​S extends IEntity,​B extends IEntityBuilder>
        Parameters:
        jsonArray - An array of the JSON serialized form of the required entity.
        modelRegistry - A model registry to use to deserialize any nested objects.
        Returns:
        A set of instances of the entity represented by the given serialized form.
      • newInstance

        public E newInstance​(org.symphonyoss.s2.common.immutable.ImmutableByteArray bytes,
                             IModelRegistry modelRegistry)