Class EntityHelper

java.lang.Object
com.cloudimpl.outstack.runtime.domainspec.EntityHelper

public class EntityHelper
extends java.lang.Object
Author:
nuwan
  • Constructor Summary

    Constructors
    Constructor Description
    EntityHelper()  
  • Method Summary

    Modifier and Type Method Description
    static <R extends RootEntity,​ T extends ChildEntity<R>>
    T
    createChildEntity​(java.lang.Class<? extends RootEntity> rootType, java.lang.String rootId, java.lang.Class<T> childType, java.lang.String entityId, java.lang.String tenantId)  
    static <T extends Entity>
    T
    createEntity​(java.lang.Class<T> type, Event event)  
    static <T extends RootEntity>
    T
    createRootEntity​(java.lang.Class<T> type, java.lang.String entityId, java.lang.String tenantId)  
    static <T extends Entity>
    boolean
    hasTenant​(java.lang.Class<T> entityType)  
    static <T extends Entity>
    boolean
    isRootEntity​(java.lang.Class<T> entityType)  
    static void setCreatedDate​(Entity e, long millis)  
    static void setCreatedDate​(Event e, long millis)  
    static void setUpdatedDate​(Entity e, long millis)  
    static void updateId​(Entity entity, java.lang.String id)  
    static void updateRootId​(ChildEntity entity, java.lang.String rootId)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EntityHelper

      public EntityHelper()
  • Method Details

    • updateId

      public static void updateId​(Entity entity, java.lang.String id)
    • updateRootId

      public static void updateRootId​(ChildEntity entity, java.lang.String rootId)
    • hasTenant

      public static <T extends Entity> boolean hasTenant​(java.lang.Class<T> entityType)
    • setCreatedDate

      public static void setCreatedDate​(Entity e, long millis)
    • setUpdatedDate

      public static void setUpdatedDate​(Entity e, long millis)
    • setCreatedDate

      public static void setCreatedDate​(Event e, long millis)
    • isRootEntity

      public static <T extends Entity> boolean isRootEntity​(java.lang.Class<T> entityType)
    • createEntity

      public static <T extends Entity> T createEntity​(java.lang.Class<T> type, Event event)
    • createRootEntity

      public static <T extends RootEntity> T createRootEntity​(java.lang.Class<T> type, java.lang.String entityId, java.lang.String tenantId)
    • createChildEntity

      public static <R extends RootEntity,​ T extends ChildEntity<R>> T createChildEntity​(java.lang.Class<? extends RootEntity> rootType, java.lang.String rootId, java.lang.Class<T> childType, java.lang.String entityId, java.lang.String tenantId)