Class EnsureEnum


  • public class EnsureEnum
    extends java.lang.Object
    Utility bean for ensuring that enumeration values do exist in the database.
    • Constructor Summary

      Constructors 
      Constructor Description
      EnsureEnum​(Executor executor, java.lang.String uuid, ome.system.Roles roles, ReadOnlyStatus readOnly)
      Construct a new enumeration ensurer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <E extends ome.model.IEnum & ome.model.IGlobal>
      java.util.List<java.lang.Long>
      ensure​(java.lang.Class<E> enumClass, java.util.Collection<java.lang.String> enumValues)
      Ensure that the given enumerations exist.
      • Methods inherited from class java.lang.Object

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

      • EnsureEnum

        public EnsureEnum​(Executor executor,
                          java.lang.String uuid,
                          ome.system.Roles roles,
                          ReadOnlyStatus readOnly)
        Construct a new enumeration ensurer. Expected to be instantiated via Spring.
        Parameters:
        executor - the internal task executor
        uuid - a UUID suitable for constructing a privileged principal
        roles - information about the system roles
        readOnly - the read-only status
    • Method Detail

      • ensure

        public <E extends ome.model.IEnum & ome.model.IGlobal> java.util.List<java.lang.Long> ensure​(java.lang.Class<E> enumClass,
                                                                                                     java.util.Collection<java.lang.String> enumValues)
        Ensure that the given enumerations exist.
        Parameters:
        enumClass - the model class of the enumeration
        enumValues - the names of the enumerations (case-sensitive)
        Returns:
        the IDs of the enumerations, with null for any that did not exist and could not be created