Java implementation now accepts Enums instead of strings