Enum VarianceInfo

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<VarianceInfo>

    public enum VarianceInfo
    extends java.lang.Enum<VarianceInfo>
    • Enum Constant Detail

      • INVARIANT

        public static final VarianceInfo INVARIANT
          public <T> void method(List<T> list) {
            List<String> someList = ..
            method(someList)
          }
         
      • IN

        public static final VarianceInfo IN
          public <T> void method(List<? super T> list) {
            List<String> someList = ..
            method(someList)
          }
         
      • OUT

        public static final VarianceInfo OUT
          public <T> void method(List<? extends T> list) {
            List<String> someList = ..
            method(someList)
          }
         
    • Method Detail

      • values

        public static VarianceInfo[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (VarianceInfo c : VarianceInfo.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static VarianceInfo valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • mergeDeclaredWithActuals

        public VarianceInfo mergeDeclaredWithActuals​(java.util.List<VarianceInfo> actualVariances)
      • doMergeDeclaredWithActuals

        protected abstract VarianceInfo doMergeDeclaredWithActuals​(java.util.List<VarianceInfo> actualVariances)
      • doMergeDeclaredWithActual

        protected abstract VarianceInfo doMergeDeclaredWithActual​(VarianceInfo actualVariance)