Tabnine Logo
LazyDeserializingObject
Code IndexAdd Tabnine to your IDE (free)

How to use
LazyDeserializingObject
in
org.axonframework.serialization

Best Java code snippets using org.axonframework.serialization.LazyDeserializingObject (Showing top 20 results out of 315)

origin: AxonFramework/AxonFramework

/**
 * Initializes a {@link SerializedMessage} with given {@code identifier} from the given serialized payload and
 * metadata. The given {@code serializer} will be used to deserialize the data.
 *
 * @param identifier         the message identifier
 * @param serializedPayload  the serialized message payload
 * @param serializedMetaData the serialized message metadata
 * @param serializer         the serializer required when the data needs to be deserialized
 */
public SerializedMessage(String identifier, SerializedObject<?> serializedPayload,
             SerializedObject<?> serializedMetaData, Serializer serializer) {
  this(identifier, new LazyDeserializingObject<>(serializedPayload, serializer),
     new LazyDeserializingObject<>(serializedMetaData, serializer));
}
origin: AxonFramework/AxonFramework

  @Override
  public LazyDeserializingObject<MetaData> getMetaData() {
    if (metaData == null) {
      metaData = new LazyDeserializingObject<>(metaDataUpcastFunction.apply(source.getMetaData().getObject()));
    }
    return metaData;
  }
}
origin: AxonFramework/AxonFramework

@Override
public Class<R> getPayloadType() {
  if (serializedPayload == null) {
    return null;
  }
  return serializedPayload.getType();
}
origin: AxonFramework/AxonFramework

@SuppressWarnings("unchecked")
@Override
public <R> SerializedObject<R> serializePayload(Serializer serializer, Class<R> expectedRepresentation) {
  if (serializer.equals(payload.getSerializer())) {
    return serializer.getConverter().convert(payload.getSerializedObject(), expectedRepresentation);
  }
  return serializer.serialize(payload.getObject(), expectedRepresentation);
}
origin: AxonFramework/AxonFramework

@Override
public R getPayload() {
  if (serializedPayload == null) {
    return null;
  }
  return serializedPayload.getObject();
}
origin: AxonFramework/AxonFramework

/**
 * Indicates whether the metaData of this message has already been deserialized.
 *
 * @return {@code true} if the metaData is deserialized, otherwise {@code false}
 */
public boolean isMetaDataDeserialized() {
  return metaData.isDeserialized();
}
origin: AxonFramework/AxonFramework

@SuppressWarnings("unchecked")
@Override
public <R> SerializedObject<R> serializeMetaData(Serializer serializer, Class<R> expectedRepresentation) {
  if (serializer.equals(metaData.getSerializer())) {
    return serializer.getConverter().convert(metaData.getSerializedObject(), expectedRepresentation);
  }
  return serializer.serialize(metaData.getObject(), expectedRepresentation);
}
origin: AxonFramework/AxonFramework

@Override
public MetaData getMetaData() {
  return metaData.getObject();
}
origin: AxonFramework/AxonFramework

/**
 * Indicates whether the payload of this message has already been deserialized.
 *
 * @return {@code true} if the payload is deserialized, otherwise {@code false}
 */
public boolean isPayloadDeserialized() {
  return payload.isDeserialized();
}
origin: AxonFramework/AxonFramework

@Override
protected SerializedMessage<T> withMetaData(MetaData metaData) {
  if (getMetaData().equals(metaData)) {
    return this;
  }
  return new SerializedMessage<>(this, new LazyDeserializingObject<>(metaData));
}
origin: org.axonframework/axon-messaging

  @Override
  public LazyDeserializingObject<MetaData> getMetaData() {
    if (metaData == null) {
      metaData = new LazyDeserializingObject<>(metaDataUpcastFunction.apply(source.getMetaData().getObject()));
    }
    return metaData;
  }
}
origin: org.axonframework/axon-core

@SuppressWarnings("unchecked")
@Override
public <R> SerializedObject<R> serializePayload(Serializer serializer, Class<R> expectedRepresentation) {
  if (serializer.equals(payload.getSerializer())) {
    return serializer.getConverter().convert(payload.getSerializedObject(), expectedRepresentation);
  }
  return serializer.serialize(payload.getObject(), expectedRepresentation);
}
origin: AxonFramework/AxonFramework

@Override
public Q getPayload() {
  return serializedPayload.getObject();
}
origin: AxonFramework/AxonFramework

@Override
public Class<Q> getPayloadType() {
  return serializedPayload.getType();
}
origin: AxonFramework/AxonFramework

/**
 * De-serializes the object and returns the result.
 *
 * @return the deserialized object
 */
public T getObject() {
  if (!isDeserialized()) {
    deserializedObject = serializer.deserialize(serializedObject.get());
  }
  return deserializedObject;
}
origin: AxonFramework/AxonFramework

public GrpcBackedQueryMessage(QueryRequest query, Serializer messageSerializer, Serializer genericSerializer) {
  this.query = query;
  this.messageSerializer = messageSerializer;
  this.serializedPayload = new LazyDeserializingObject<>(new GrpcSerializedObject(query.getPayload()), messageSerializer);
  this.serializedResponseType = new LazyDeserializingObject<>(new GrpcSerializedObject(query.getResponseType()), genericSerializer);
  this.metadata = new GrpcMetadata(query.getMetaDataMap(), messageSerializer);
}
origin: org.axonframework/axon-core

  @Override
  public LazyDeserializingObject<MetaData> getMetaData() {
    if (metaData == null) {
      metaData = new LazyDeserializingObject<>(metaDataUpcastFunction.apply(source.getMetaData().getObject()));
    }
    return metaData;
  }
}
origin: org.axonframework/axon-messaging

@SuppressWarnings("unchecked")
@Override
public <R> SerializedObject<R> serializeMetaData(Serializer serializer, Class<R> expectedRepresentation) {
  if (serializer.equals(metaData.getSerializer())) {
    return serializer.getConverter().convert(metaData.getSerializedObject(), expectedRepresentation);
  }
  return serializer.serialize(metaData.getObject(), expectedRepresentation);
}
origin: AxonFramework/AxonFramework

@Override
public ResponseType<U> getUpdateResponseType() {
  return updateType.getObject();
}
origin: AxonFramework/AxonFramework

@Override
public Class<U> getPayloadType() {
  return payload.getType();
}
org.axonframework.serializationLazyDeserializingObject

Javadoc

Represents a serialized object that can be deserializedObjects upon request. Typically used as a wrapper class for keeping a SerializedObject and its Serializer together.

Most used methods

  • <init>
    Creates an instance which will deserialize given serializedObject upon request. Use this constructor
  • getObject
    De-serializes the object and returns the result.
  • getType
    Returns the class of the serialized object.
  • getSerializedObject
    Returns the serialized object to deserialize upon request
  • getSerializer
    Returns the serializer to deserialize this object
  • isDeserialized
    Indicates whether this object has already been deserialized. When this method returns true, the #get

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top PhpStorm plugins
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