All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.core.PrimitivePromoter Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version

package org.snapscript.core;

public class PrimitivePromoter {

   public PrimitivePromoter() {
      super();
   }
   
   public Class promote(Class type) {
      if (type == int.class) {
         return Integer.class;
      }
      if (type == double.class) {
         return Double.class;
      }
      if (type == float.class) {
         return Float.class;
      }
      if (type == boolean.class) {
         return Boolean.class;
      }
      if (type == byte.class) {
         return Byte.class;
      }
      if (type == short.class) {
         return Short.class;
      }
      if (type == long.class) {
         return Long.class;
      }
      if (type == char.class) {
         return Character.class;
      }
      if (type == void.class) {
         return Void.class;
      }
      return type;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy