congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WithOptionalEntity
Code IndexAdd Tabnine to your IDE (free)

How to use
WithOptionalEntity
in
org.eclipse.ditto.signals.base

Best Java code snippets using org.eclipse.ditto.signals.base.WithOptionalEntity (Showing top 4 results out of 315)

origin: eclipse/ditto

/**
 * Returns the entity as JSON.
 *
 * @return the entity as JSON.
 */
default Optional<JsonValue> getEntity() {
  return getEntity(JsonSchemaVersion.LATEST);
}
origin: org.eclipse.ditto/ditto-signals-base

/**
 * Returns the entity as JSON.
 *
 * @return the entity as JSON.
 */
default Optional<JsonValue> getEntity() {
  return getEntity(JsonSchemaVersion.LATEST);
}
origin: eclipse/ditto

private static WithDittoHeaders checkForHarmfulEntity(final WithDittoHeaders withDittoHeaders) {
  if (withDittoHeaders instanceof Command && withDittoHeaders instanceof WithOptionalEntity) {
    final Optional<JsonValue> optionalEntity = ((WithOptionalEntity) withDittoHeaders).getEntity();
    if (optionalEntity.isPresent() && isJsonValueIllegal(optionalEntity.get())) {
      throw buildError(withDittoHeaders);
    }
  }
  return withDittoHeaders;
}
origin: eclipse/ditto

private static Function<HttpResponse, HttpResponse> createBodyAddingResponseMapper(
    final CommandResponse commandResponse, final WithOptionalEntity withOptionalEntity) {
  return response -> {
    if (StatusCodes.NO_CONTENT.equals(response.status())) {
      return response;
    } else {
      return withOptionalEntity.getEntity(commandResponse.getImplementedSchemaVersion())
          .map(entity ->
              addEntityAccordingToContentType(response, entity, commandResponse.getDittoHeaders()))
          .orElse(response);
    }
  };
}
org.eclipse.ditto.signals.baseWithOptionalEntity

Javadoc

Implementations of this interface are associated to an entity returned from #getEntity(JsonSchemaVersion) .

Most used methods

  • getEntity
    Returns the entity as JSON.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JComboBox (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now