To fix this issue There is indeed no way to do what you want with a statically guaranteed length, unless you are prepared to have a new class for every length: FixedBarString4, FixedBarString5, etc. (It is possible to create a class for single linked list of chars which uses generics to encode the length. But I doubt you would like to use that in your real world scenario.
will be helpful for those in need What you are describing is an associative array, also called a table, dictionary, or map. In Java, you want the Map interface, and probably the HashMap class as the implementation.
Map<String, Integer> myMap = new HashMap<String, Integer>();
Integer value = myMap.get("cat"); //123
Any effective opensource alternative for New Relic for Java
hope this fix your issue Even though it does not have all the features of new relic, you can take a look at stagemonitor. It is a open source java web application performance monitor. It captures response time metrics, JVM metrics, request details (including a call stack captured by the request profiler) and more. The overhead is very low. Optionally, you can use the great timeseries database graphite with it to store a long history of datapoints that you can look at with fancy dashboards.
What's the preferred sequence to read Effective, More Effective & Effective Modern C++ (and STL)?