<commit_before>---
layout: post

title: "Taking Enums to the next level with Java 8"

author:
  name: <NAME>
  bio: Analytics API Jedi Master
  twitter: JoRochette
  image: jrochette.jpg
---

Taking Enums to the next level with Java8
===================


In our awesome cloud Usage Analytics API, there is a call that returns the analytics data in data points format (these are meant to be used to build a graph). Recently, we added a feature allowing the user to chose the time period (initially, only *days* was available). Problem is, the code was strongly coupled with the *day* period...

<!-- more -->

![image](/images/graphexemple.png)
<commit_msg>Hide JRochette's post until fixed<commit_after>---
layout: post

title: "Taking Enums to the next level with Java 8"

author:
  name: <NAME>
  bio: Analytics API Jedi Master
  twitter: JoRochette
  image: jrochette.jpg

published:false  
---

Taking Enums to the next level with Java8
===================


In our awesome cloud Usage Analytics API, there is a call that returns the analytics data in data points format (these are meant to be used to build a graph). Recently, we added a feature allowing the user to chose the time period (initially, only *days* was available). Problem is, the code was strongly coupled with the *day* period...

<!-- more -->

![image](/images/graphexemple.png)

{'fraction_non_alphanumeric': 0.10790835181079084, 'fraction_numerical': 0.0029563932002956393, 'mean_word_length': 3.95970695970696, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5390077', 'n_tokens_mistral': 399, 'n_tokens_neox': 374, 'n_words': 193}