flipt-io / docs

https://www.flipt.io/docs (powered by https://mintlify.com/)
https://www.flipt.io/docs
8 stars 14 forks source link

Update Java Example #271

Closed sdavids closed 1 month ago

sdavids commented 1 month ago

Please do not make Java look bad by using outdated code snippets, thanks.

https://www.flipt.io/#w-tabs-2-data-w-pane-4

FliptEvaluationClient fliptClient = FliptEvaluationClient.builder()
                    .build();

Map<String, String> context = new HashMap<>();
context.put("platform", "web");

Result<VariantEvaluationResponse> result =
    fliptClient.evaluateVariant("ui-color", "user-123", context);

var client = FliptEvaluationClient.builder().build();

var response = client.evaluateVariant("ui-color", "user-123", Map.of("platform", "web"));

This is Java 9 from 7 years ago.

The current supported Java versions are Java 11, 17, 21.

GeorgeMac commented 1 month ago

Hey @sdavids, thanks for bringing this to our attention! We're just a small team of maintainers and we're not very experienced in Java as we don't use it in our day to day. So we're very dependent on experts like yourself to help keep us up to date with current best practices.

Would you be open to contributing this update as a PR?

GeorgeMac commented 1 month ago

My mistake, I see you're referring to our marketing site! We will get that updated on our end, thank you again!

markphelps commented 1 month ago

FIxed, thanks @sdavids !!