com.instaclustr.operations.OperationRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons Show documentation
Show all versions of commons Show documentation
Common classes and utilities integrated with various projects
package com.instaclustr.operations;
import javax.inject.Inject;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import com.instaclustr.guice.GuiceInjectorHolder;
@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "type", include = As.EXISTING_PROPERTY)
@JsonTypeIdResolver(OperationRequest.TypeIdResolver.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class OperationRequest implements Cloneable {
@JsonProperty
public String type;
static class TypeIdResolver extends MapBackedTypeIdResolver {
public TypeIdResolver() {
this(GuiceInjectorHolder.INSTANCE.getInjector().getInstance(Key.get(
new TypeLiteral