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

com.crashinvaders.basisu.wrapper.UniqueIdUtils Maven / Gradle / Ivy

The newest version!
package com.crashinvaders.basisu.wrapper;

public class UniqueIdUtils {
    static  T findOrThrow(T[] values, int id) {
        for (int i = 0; i < values.length; i++) {
            if (values[i].getId() == id) {
                return values[i];
            }
        }
        throw new IllegalArgumentException("Cannot find an enum value with ID: " + id);
    }

    public interface UniqueIdValue {
        int getId();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy