#
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0 and the Server Side Public License, v 1; you may not use this file except
# in compliance with, at your election, the Elastic License 2.0 or the Server
# Side Public License, v 1.
#

# This file contains a whitelist for an example class which may be access from painless

class org.elasticsearch.example.painlesswhitelist.ExampleWhitelistedClass {
  # constructor
  (int, int)

  # static constants and methods look the same as instance members and methods
  int CONSTANT
  void staticMethod()

  # members lack parenthesis that methods have
  int publicMember

  # getter and setter for private member
  int getPrivateMemberAccessor()
  void setPrivateMemberAccessor(int)

  # annotation
  void annotate() @example_annotation[category="1",message="example annotation"]
}

class java.lang.String {
  # existing classes can be "augmented" to have additional methods, which take the object
  # to operate on as the first argument to a static method
  int org.elasticsearch.example.painlesswhitelist.ExampleWhitelistedClass toInt()
}

static_import {
  int exampleAddInts(int, int) from_class org.elasticsearch.example.painlesswhitelist.ExampleStaticMethodClass
}
