public static MemoryTrimType fromInt(int type) {
    for (MemoryTrimType trimType : MemoryTrimType.values()) {
      if (trimType.ordinal() == type) {
        return trimType;
      }
    }
    throw new IllegalArgumentException("Unknown type: " + type);
  }
Map an integer to a MemoryTrimType enum.
fbcore/src/main/java/com/facebook/common/memory/MemoryTrimType.java