code: public T getValueByString(String key) {
          for (T value : values) {
              if (keyFactory.generateKey(value).equals(key)) {
                  return value;
              }
          }
          return null;
      }
docs: TODO: Optimize performance (maybe use a map)