package ml.duncte123.skybot.objects;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class Primitives {

    static Class<?> unwrap(Class<?> type) {
        return (wrapperToPrimitives.get(type) == null) ? type : wrapperToPrimitives.get(type);
    }

    static Class<?> wrap(Class<?> type) {
        return (primitivesToWrapper.get(type) == null) ? type : primitivesToWrapper.get(type);
    }

    private static final Map<Class<?>, Class<?>> primitivesToWrapper = new HashMap<>(16);
    private static final Map<Class<?>, Class<?>> wrapperToPrimitives = new HashMap<>(16);

    static {
        Map<Class<?>, Class<?>> primitivesToWrapper = new HashMap<>(16);
        Map<Class<?>, Class<?>> wrapperToPrimitives = new HashMap<>(16);

        put(primitivesToWrapper, wrapperToPrimitives, boolean.class, Boolean.class);
        put(primitivesToWrapper, wrapperToPrimitives, byte.class, Byte.class);
        put(primitivesToWrapper, wrapperToPrimitives, char.class, Character.class);
        put(primitivesToWrapper, wrapperToPrimitives, double.class, Double.class);
        put(primitivesToWrapper, wrapperToPrimitives, float.class, Float.class);
        put(primitivesToWrapper, wrapperToPrimitives, int.class, Integer.class);
        put(primitivesToWrapper, wrapperToPrimitives, long.class, Long.class);
        put(primitivesToWrapper, wrapperToPrimitives, short.class, Short.class);
        put(primitivesToWrapper, wrapperToPrimitives, void.class, Void.class);

        primitivesToWrapper = Collections.unmodifiableMap(primitivesToWrapper);
        wrapperToPrimitives = Collections.unmodifiableMap(primitivesToWrapper);
    }

    private static void put(Map<Class<?>, Class<?>> first, Map<Class<?>, Class<?>> second, Class<?> primitive, Class<?> wrapper) {
        first.put(primitive, wrapper);
        second.put(wrapper, primitive);
    }
}

@@ -137,24 +137,31 @@
 ives %7B%0A%0A    
+public 
 static Class
@@ -290,24 +290,31 @@
 %0A    %7D%0A%0A    
+public 
 static Class
@@ -509,36 +509,16 @@
 oWrapper
- = new HashMap%3C%3E(16)
 ;%0A    pr
@@ -579,36 +579,16 @@
 imitives
- = new HashMap%3C%3E(16)
 ;%0A%0A    s
@@ -628,34 +628,16 @@
 ss%3C?%3E%3E p
-rimitivesToWrapper
  = new H
@@ -683,34 +683,16 @@
 ss%3C?%3E%3E w
-rapperToPrimitives
  = new H
@@ -723,47 +723,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , bo
@@ -772,47 +772,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , by
@@ -815,47 +815,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , ch
@@ -863,47 +863,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , do
@@ -910,47 +910,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , fl
@@ -955,47 +955,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , in
@@ -1000,47 +1000,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , lo
@@ -1043,47 +1043,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , sh
@@ -1088,47 +1088,11 @@
 ut(p
-rimitivesToWrapper, wrapperToPrimitives
+, w
 , vo
@@ -1174,34 +1174,16 @@
 bleMap(p
-rimitivesToWrapper
 );%0A     
@@ -1235,35 +1235,17 @@
 ableMap(
-primitivesToWrapper
+w
 );%0A    %7D

Fix primitives