Commit 357fbd61 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

Add min/max value enum to Java

C++ bindings have a kMinValue and kMaxValue in mojo
enums. This adds the same to the Java bindings.

BUG=899802

Change-Id: Ic3dd6ca5b665c6ed6adbd5ffcc80e93573dc51c6
Reviewed-on: https://chromium-review.googlesource.com/c/1305193Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603917}
parent 8d1b37ba
......@@ -15,6 +15,13 @@ public {{ 'static ' if not top_level }}final class {{enum|name}} {
public static final int {{field|name}} = {{enum_value(enum, field, loop.index0)}};
{% endfor %}
{%- if enum.min_value is not none %}
public static final int MIN_VALUE = (int) ({{enum.min_value}});
{%- endif %}
{%- if enum.max_value is not none %}
public static final int MAX_VALUE = (int) ({{enum.max_value}});
{%- endif %}
private static final boolean IS_EXTENSIBLE = {% if enum.extensible %}true{% else %}false{% endif %};
public static boolean isKnownValue(int value) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment