Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparing with other Yandex Cloud services
    • Overview
      • Overview
      • Function interface
      • YcFunction interface
      • HttpServlet class
      • Spring Boot
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Error handling
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Developing in Java
  2. Programming model
  3. Overview

Java programming model

Written by
Yandex Cloud
Updated at July 2, 2026
View in Markdown

Cloud Functions provides four Java programming models which are based on the Function and YcFunction interfaces, the HttpServlet class, and Spring Boot. The first three ways of setting a function handler involve implementing custom implementations of these interfaces or classes, while the last one involves uploading the application in its original form without any changes.

The difference between the Function and YcFunction models is the availability of the invocation context. For example, if you need to work with Yandex Cloud services using the SDK, we recommend opting for YcFunction. With the HttpServlet model, you can fully manage the return value and HTTP method used to invoke the function, and, like the YcFunction model, provides access to the invocation context.

There are two separate types for the Function and YcFunction models: byte[] and String. They are used differently from other types. If you use them as the handler argument type, the runtime will not convert the incoming request into JSON and instead will provide it directly to the user-defined handler, unless ?integration=raw is used.

Note

The jsoniter library is used for serializing and deserializing JSON.

Handler requirementsHandler requirements

No matter which model you select, the project can be uploaded as source code, a JAR archive, or a Maven project. The class that contains the handler must also meet the following requirements:

  • It must be public.

  • It must have a public no-argument constructor.

    It is provided by default. However, if you created your own constructor with arguments, you should also create a no-argument one.

  • It must not be generic.

Was the article helpful?

Previous
Overview
Next
Function interface
© 2026 Direct Cursus Technology L.L.C.