Class EnumUtils


  • public class EnumUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      EnumUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V extends VeniceEnumValue>
      V[]
      getEnumValuesArray​(java.lang.Class<V> enumToProvideArrayOf)
      Lots of defensive coding to ensure that control message type values are: 1.
      • Methods inherited from class java.lang.Object

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

      • EnumUtils

        public EnumUtils()
    • Method Detail

      • getEnumValuesArray

        public static <V extends VeniceEnumValue> V[] getEnumValuesArray​(java.lang.Class<V> enumToProvideArrayOf)
        Lots of defensive coding to ensure that control message type values are: 1. Unique 2. From 0 to N 3. Without gaps Checking these assumptions here helps to simplify valueOf(int) as much as possible, which is valuable since it's a hot path call. If these assumptions change (e.g. if we deprecate some message types such that there are gaps, then we may need to relax some constraints here and increase checks in valueOf(int) instead.